Linux Creating a Partition Size Larger Than 2TB

Frankly speaking, you cannot create a Linux partition larger than 2 TB using the fdisk command. The fdisk won’t create partitions larger than 2 TB. This is fine for desktop and laptop users, but on a server, you need a large partition. For example, you cannot create 3TB or 4TB partition size (RAID based) using the fdisk command. It will not allow you to create a partition that is greater than 2TB. In this tutorial, you will learn more about creating Linux filesystems greater than 2 Terabytes to support enterprise-grade operation under any Linux distribution.

To solve this problem use, GNU parted command with GPT. It supports Intel EFI/GPT partition tables. Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. It is a part of the Extensible Firmware Interface (EFI) standard proposed by Intel as a replacement for the outdated PC BIOS, one of the few remaining relics of the original IBM PC. EFI uses GPT where BIOS uses a Master Boot Record (MBR).

GUID Partition Table
(Fig.01: Diagram illustrating the layout of the GUID Partition Table scheme. Each logical block (LBA) is 512 bytes in size. LBA addresses that are negative indicate position from the end of the volume, with −1 being the last addressable block. Imaged Credit Wikipedia)

Linux GPT Kernel Support

EFI GUID Partition support works on both 32bit and 64bit platforms. You must include GPT support in the kernel to use GPT. If you don’t add GPT support in Linux kernel, after rebooting the server, the file system will no longer be mountable, or the GPT table will get corrupted. By default, Redhat Enterprise Linux / CentOS comes with GPT kernel support. However, if you are using Debian or Ubuntu Linux, you need to recompile the kernel. Set CONFIG_EFI_PARTITION to y to compile this feature. Please note that almost all new kernel and latest distro supports GPT.

File Systems
   Partition Types
     [*] Advanced partition selection
     [*] EFI GUID Partition support (NEW)

Find Out Current Disk Size

Type the following command:
# fdisk -l /dev/sdb
Sample outputs:

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Linux Create 3TB partition size

To create a partition start GNU parted as follows:
# parted /dev/sdb

GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.

Creates a new GPT disklabel i.e. partition table:

(parted) mklabel gpt

Sample outputs:

Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes

Next, set the default unit to TB, enter:

(parted) unit TB

To create a 3TB partition size, enter:

(parted) mkpart primary 0 0


(parted) mkpart primary 0.00TB 3.00TB

To print the current partitions, enter:

(parted) print

Sample outputs:

Model: ATA ST33000651AS (scsi)
Disk /dev/sdb: 3.00TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  3.00TB  3.00TB  ext4         primary

Quit and save the changes, enter:

(parted) quit

Sample outputs:

Information: You may need to update /etc/fstab.

Use the mkfs.ext3 or mkfs.ext4 command to format the file system, enter:
# mkfs.ext3 /dev/sdb1
# mkfs.ext4 /dev/sdb1
Sample outputs:

mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183148544 inodes, 732566272 blocks
36628313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
	102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Type the following commands to mount /dev/sdb1, enter:
# mkdir /data
# mount /dev/sdb1 /data
# df -H

Sample outputs:

Filesystem             Size   Used  Avail Use% Mounted on
/dev/sdc1               16G   819M    14G   6% /
tmpfs                  1.6G      0   1.6G   0% /lib/init/rw
udev                   1.6G   123k   1.6G   1% /dev
tmpfs                  1.6G      0   1.6G   0% /dev/shm
/dev/sdb1              3.0T   211M   2.9T   1% /data

Make sure you replace /dev/sdb1 with actual RAID or Disk name or Block Ethernet device such as /dev/etherd/e0.0. Do not forget to update your /etc/fstab file, if necessary. Also note that booting from a GPT volume requires support in your BIOS / firmware. This is not supported on non-EFI platforms. I suggest you boot server from another disk such as IDE / SATA / SSD disk and store data on /data. It is also possible to use the whole disk such as /dev/sdb if needed. Please note that the latest version of fdisk dose support GPT. From the man page:

fdisk is able to optimize the disk layout for a 4K-sector size and use an alignment offset on modern devices for MBR and GPT. GPT is modern standard for the layout of the partition table. GPT uses 64-bit logical block addresses, checksums, UUIDs and names for partitions and an unlimited number of partitions (although the number of partitions is usually restricted to 128 in many partitioning tools). Note that the first sector is still reserved for a protective MBR in the GPT specification. It prevents MBR-only partitioning tools from mis-recognizing and overwriting GPT disks.

Say hello to gdisk

The gdisk is an GPT alternative to fdisk command. The syntax is same as fdisk command. For example:
$ sudo fdisk /dev/sdb
$ sudo gdisk /dev/sdb
Sample outputs:

GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help):

Type n to create a new partition:

Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-XXXXXXX, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-XXXXXXX, default = XXXXXXX) or {+-}size{KMGTP}: 
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300)

Press w to write new table to disk and exit to the shell prompt:

Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to hdd.img.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

Now you can format /dev/sdb1 and mount it as usual.

Further readings:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 75 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
75 comments… add one
  • Ryan Nov 10, 2007 @ 20:02

    Typically with Linux and large disks, I prefer just to use LVM directly on the disk, no partitioning at all. I find this to be very stable and manageable.

  • Benjamin Schweizer Nov 26, 2007 @ 16:53

    Ryan, how do you tell grub to load the kernel from a lvm partition? IMHO, grub wont mount logical volumes and thus, cannot find your kernel.

  • Paul Mar 12, 2008 @ 7:40

    Thanks for the CLI verify – I used gPartED for the same – with graphical confirmation;)

  • John Mar 17, 2008 @ 1:10

    Using the default distro kernel in Debian 4.0 (etch):

    $ uname -a

    Linux video-server 2.6.18-4-amd64 #1 SMP Mon Mar 26 11:36:53 CEST 2007 x86_64 GNU/Linux
    $ zgrep _EFI_ /proc/config.gz


  • Wessel Aug 7, 2008 @ 18:03

    Another tip, instead of doing

    # mkpart primary 0 3001G


    # mkpart primary 0 -0

    This will tell parted to fill up the entire drive with one volume.

  • Gadgetman Oct 16, 2008 @ 21:35

    I could create on 3TB volume following guide above. But when rebooting, the pratition tabled is wrong. Pleas Help /T

  • svrmarty Nov 11, 2008 @ 14:28

    when i’m booting my own build debian kernel,
    it stocks when the system want’s to mount to root filesystem.

    it says somthing like
    the following disks found
    0800 sd sda
    0810 sd sdb

  • svrmarty Nov 12, 2008 @ 12:07

    the error is

    VFS: cannot open root device “sda2” or unknown-block(8,2)
    Please append a correct “root=” boot option; here are the available partitions:
    0800 244129792 sda driver: sd
    0810 9765519360 sdb driver: sd

  • Jamie Nov 20, 2008 @ 23:30

    All supported releases of Ubuntu (ie 6.06 LTS and higher) do have ‘CONFIG_EFI_PARTITION=’y compiled into the kernel.

  • Randall Jan 8, 2009 @ 15:07

    Since recent versions of Ubuntu and Debian have CONFIG_EFI_PARTITION compiled into their stock kernels, you should remove the part about having to recompile the kernel so that readers don’t needlessly recompile their kernels.

  • Luke Jan 28, 2009 @ 6:42

    What tripped me up is mkpart gpt is actually a lone command followed by a sub-command.
    Don’t type them both at once, wait for the next prompt before typing gpt.

  • John Jun 9, 2009 @ 14:28

    With EXT3 on most systems the max block size is 4096 bytes, which will still limit you to ~8TB for your filesystem.

  • Manish Patel Jun 27, 2009 @ 4:56


    How to Create a Partition Size Larger than 2TB in Freebsd 7.2 64-bit and 32-bit OS. I have a hardware raid 5 disk contains total 8TB of size and want to create a partition like one 5TB and one 3TB.

    How I can get it done in FreeBsd.

    Thank you

  • what? Dec 20, 2009 @ 8:45

    i don’t understand the premise.

    since i can’t buy a > 2tb drive, i don’t see the problem.

    fdisk /dev/sda
    (make a partition of type fd, that spans the entire 2tb drive)
    fdisk /dev/sdb
    ditto sdc
    ditto sdd

    mdadm (assemble sda through sdd into a raid 5 of size 6 terabytes)

    then mkfs /dev/md0

    show me where with the biggest drives you can buy as of today, that you’ll have to run “fdisk” against something larger then 2tb????

    • 🐧 nixCraft Dec 20, 2009 @ 11:18

      Clearly you never worked in an enterprise setup where you can put 24 x 1TB size drive put in RAID mode.

  • Amit Sinha Dec 22, 2009 @ 20:42

    Thanks for the great tut. There is 1 basic part I could not understand, once you create a single 3 TB partition using “mkpart primary 0 3001G”, how do you create partitions for OS, swap and other stuff.

  • SassyZ Jan 16, 2010 @ 21:11

    Great Post!!!

    Prior to this article, I was having trouble partitioning a 6TB Raid 5 Array (4 x 2TB disks).
    I’m running CentOS (2.6.18-164.10.1.el5) and used the following commands from this article and comments. Thanks!

    parted /dev/sda
    mklabel gpt
    mkpart primary 0 -0
    mkfs.ext3 /dev/sda

    * Note: I first tried using “gparted” but something with the data types in the graphical interface didn’t like the size of the raid array and was displaying negative values. Stupid gui.

    • Chad Farmer Jul 18, 2011 @ 21:29

      Just for people who get search hits on this page…I suggest the commands:

      parted /dev/sda
      mklabel gpt
      mkpart primary 0 -0
      mkfs.ext3 /dev/sda1

      SassyZ needs to understand that file systems are created within partitions while GPT are applied to disks. In other words, “parted mklabel gpt /dev/sda” writes a partition table to the first few sectors of a disk drive. The “mkpart” command creates a partition entry in that GPT. The first partition is named “/dev/sda1”. So the mistake in the last command is specifying the wrong device special file name. The command should be “mkfs.ext3 /dev/sda1” to create a file system in the first partition. The command “mkfs.ext3” will create a file system starting at sector zero and overwrite the GPT. (Note I’ve never tried a size of -0, so use print to verify the partition that was created.)

  • Jon Kiji Jan 19, 2010 @ 11:33

    [quote]show me where with the biggest drives you can buy as of today, that you’ll have to run “fdisk” against something larger then 2tb????[/quote]

    Try a hardware RAID for a change. The RAID controller will report a single huge drive to your OS. I just skip partitioning the RAID device altogether. *shrug*. Just mkfs /dev/sdb.
    No fiddling with exotic partitions. Not the prettiest of solutions, but very reliable nontheless.

  • Chris Feb 9, 2010 @ 1:10

    This isnt working for me.

    (parted) mklabel
    New disk label type? gpt
    Error: Invalid argument during write on /dev/sdb

    Would this have anything to do with it…

    Warning: Device /dev/sdb has a logical sector size of 4096. Not all parts of
    GNU Parted support this at the moment, and the working code is HIGHLY

    If so, how can I get around this? I’m using four 2TB drives in RAID5 – volume size is 5.9TB – it is ISCSI.

  • Chris Feb 9, 2010 @ 1:22

    [QUOTE]I just skip partitioning the RAID device altogether. *shrug*. Just mkfs /dev/sdb[/QUOTE]

    I tried that but if I run fdisk -l i get….

    Disk /dev/sdb doesn’t contain a valid partition table.

    Will this cause any problems?

  • andrew Mar 12, 2010 @ 11:49

    I tried that but if I run fdisk -l i get….
    Disk /dev/sdb doesn’t contain a valid partition table.
    Will this cause any problems?

    No. Not unless you try to read the drive with a different operating system or reinstall the operating system. Without the partition table, other OSes will think the drive is unpartitioned (blank). As long as you keep using Linux or perhaps BSD, just tell the system that the drive is a big single partition (mount /dev/sdb -t ext3 /mnt/bigdrive -o noatime) and it should work fine.

    If you want to protect the drive from another OS (I don’t know why you’d dual boot with a massive RAID like that) or make it more portable then you should follow the instructions in the article for creating a GPT instead.

  • Cristian Mar 29, 2010 @ 16:54

    Excelent ! works as a charm

  • Anonymous Jun 11, 2010 @ 0:23

    The BIOS does NOT use the MBR. It simply loads the first sector of the disk into memory at 0x7c00, and runs whatever is there. IBM way back when decided to use an MBR to partition drives. The bios knows nothing about the partitions or how the MBR is layed out, and can perform perfectly without an MBR. So much mis information for such a small article. You can use a GPT with a standard bios, it’s just that EFI is ‘aware’ of the GPT, where a standard bios knows nothing of it, and just loads the first sector of the disk, and lets it do it’s thing. All they did was move some code from the hard drive into the firmware, doesn’t really make any difference where it resides, it’s all software that performs the same function

  • Joe the mechanic Jul 7, 2010 @ 12:07

    I thought I setup everything correctly but I am also getting

    Disk /dev/sdb doesn’t contain a valid partition table.

    The drive seems to work correctly but I dont like to see errors even if it is a false positive

    ATL support systems

  • 🐧 nixCraft Jul 7, 2010 @ 12:50

    Disk /dev/sdb doesn’t contain a valid partition table.

    A common message as there is not partition table. This also displayed when you have software raid devices such as /dev/md0

    fdisk -l /dev/md0
    Disk /dev/md0: 58.0 GB, 58004537344 bytes
    2 heads, 4 sectors/track, 14161264 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Disk /dev/md0 doesn't contain a valid partition table

    Nothing to worry. Just ignore warning.

  • Dmitry Sherman Nov 3, 2010 @ 16:47

    i have an ISCSI 4TB storage, i have partitioned it as needed with GPT label, but suddenly after almost a year of usage when it reached now about 2.5TB i get those messages in the kernel:
    kernel: attempt to access beyond end of device
    its debian lenny, parted looks good, no errors.
    Model: IBM 1726-3xx FAStT (scsi)
    Disk /dev/sdb: 3999GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 17.4kB 3999GB 3999GB ext3 primary

    any suggestions?

  • Jay Shepherd Dec 14, 2010 @ 0:30

    Awesome! Thanks for this, after tweaking fdisk settings for ages i came accross your article. Sorted 😀

  • Adrian Schmid Feb 22, 2011 @ 16:36

    I used parted as described to work with large arrays, so I am quite happy with it. One question though. What would be the easiest way to copy partition tables between disks (not partitions!). I know in fdisk there was a tool called sfdisk that let you dump / rewrite partition tables from one disk to another…. is there a similar procedure in parted? any hints greatly appreciated! Adrian

    • Chad Farmer Jul 18, 2011 @ 21:53

      GPT stands for GUID Partition Table. This mean that each partition is assigned a unique ID when the partition is created. So, copying the partition table is a BAD IDEA, even if you know to also copy the backup partition table at the end of the disk. You should run parted (or whatever) on each disk that needs the “same” partition table and create a new partition table with the same partition types and sizes, but with new (unique) GUID values.

      Although not well documented, parted will accept starting location and size in sectors, if values in MB are being rounded and causing slightly different values than desired. To repartition the fourth disk sdd (and lose all of its content):
      parted -s /dev/sdd mkpart fat16 34s 1048609s

      Note that I’m worried about duplicating the GUID that uniquely identifies each partition, not the standardized GUID value that identifies the partition type.

  • Jord Wegge Feb 26, 2011 @ 16:16

    Great Tut as always.

    One question though… All this assumes you’ve got a running system to which you plan to add a second >2TB device. When using GPT, most modern linux distro’s will do as you described.

    However, how do you install to such a device?

    Situation = 8x2TB raid6 (hardware), and boot-able debian 6.0 cd -> The installer recognizes a 500 GB disk (I previously GPT’ed the device & partitioned it to my liking with gparted livecd).



    • Jord Wegge Mar 11, 2011 @ 19:36

      Solution for my original problem: ubuntu install cd (in my case 10.10) will only create GPT when the drive is large enough to require it, otherwise it will stick to msdos mbr.
      So: make you’re raid as you wish it to be and install straight from cd.

      One smaller problem I’m facing now is also GPT-related:
      I installed ubuntu on 3x2TB hw raid whilst there still was a 5X2TB soft raid in the same machine. Next I moved the data from the soft raid to the hw raid and expanded the hw raid to its full 8x2TB in raid 6.
      When now I want to enlarge /dev/sda3 (ext4) to full raid size I get blocked of by the GPT backup table <>

      But I don’t quite see how to do that.


      • Jord Wegge Mar 11, 2011 @ 19:38

        quote missing in previous reply:

        The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?

  • perrysong May 16, 2011 @ 1:49

    Thanks a lot…

  • Jeff May 26, 2011 @ 17:01

    If you get this…
    Warning: The resulting partition is not properly aligned for best performance.

    You really should run parted like so…

    parted -a optimal /dev/sdb

    • Damien Apr 15, 2012 @ 17:05

      Even when starting parted with: parted -a optimal, I was still seeing:
      Warning: The resulting partition is not properly aligned for best performance.
      on a large (3TB) Advanced Format 4k sector drive.

      I found the solution is just to start at 1, not 0:

      (parted) mkpart primary 1 -1

      Will start the partition at the correct sector boundary, and the warning no loner appears. More info.

    • edson Aug 24, 2013 @ 12:36

      Thank you.
      Finally it works!!
      Ubuntu 12.10

  • Sean S Aug 11, 2011 @ 23:46

    I running problem on this. I try to mount a 4*2T RAID5 array with USB connect to NAS IOMEGA IX2-200, the IX2-200 is running Debian Lenny. How could I know if GPT is enabled?

    I applied mklabel gpt successfully, but I still see my RAID5 as 2T disk.

  • KIRAN Sep 10, 2011 @ 15:09

    how to create a mount point of 20 TB LUN in RHEL 5.4 32 bit?

  • Tokynet Sep 11, 2011 @ 10:04

    When you get ready to format your new huge partition, I recommend using “-m0” with the mkfs command. This will give you the maximum amount of space to use.
    The ‘-m’ sets the reserved block to zero (0).

    If you do not add that to the command, you will loose (i think) either 5 or 10% of the drive to reserved blocks.

    # mkfs.ext3 -m0 /dev/sda1

  • 🐧 nixCraft Sep 19, 2011 @ 12:13


    I’ve updated the tutorial with step by step instructions.

  • Sean Oct 9, 2011 @ 23:49

    I’m getting the same errors from Parted as mentioned by Chris above…
    Warning: Device /dev/sdd has a logical sector size of 4096.” and “Error: Invalid argument during write on /dev/sdd Retry/Ignore/Cancel?” At which point only Cancel does anything.

    In my case the drive is a Hitachi XL3000 3TB (external USB 2.0) and I wanted to format it ext3. Since Parted didn’t work for me, I partitioned it under OS X (Disk Utility) as a single 3TB partition. And then mkfs.ext3 and tune2fs -L for the label. Seems to be working now, but if someone smarter than me wanted to explain how to do it without resorting to OS X, that would be awesome.

    Any help?

  • Nick Oct 15, 2011 @ 17:33


    I seem to have just purchased the same drive you are talking about, and yes I had the same problem. I ended it up there by making an error in following the instructions above. If you look at the drive, you will notice two partitions on it. Both zero in size. Use rm command for each partition and go carefully back to the beginning.
    Note, though, that the above instructions result with some empty space at the beginning of the drive. If you select units as Bytes, the empty space will be moved to the end of the drive.

  • Sean Oct 15, 2011 @ 21:55

    Hi Nick,

    Thanks for the reply. While in Parted, I still can’t get anywhere because the disk’s label remains unrecognized, and the mklabel command simply returns the above-mentioned error (pretty much every command in Parted returns the same error: “unrecognised disk label”). Should I be using a different Linux tool to look at the drive?

  • DMC Nov 10, 2011 @ 16:22

    >Gadgetman October 16, 2008
    >I could create on 3TB volume following guide above. But when rebooting, the pratition tabled is wrong. Pleas Help /T

    I’ve just found the cause of this problem.
    Maybe reply #9 explains the reason.
    Could anyone tell me whether this issue has already resolved or not.


  • Stefan Lasiewski Jan 4, 2012 @ 21:59

    Now the other question, how long will it take to fsck one of these 3TB filesystem? This could take many hours. We’ve seen it take over 12 hours for a large filesystem.

    By default the OS will automatically fsck the filesystem “every 25 mounts or 180 days, whichever comes first”. This could be a serious issue if you want to reboot the system 180 days from now, as your 4 minute reboot could turn into a 4+ hour wait for fsck to complete.

    If you want to disable the automatic fsck upon boot, try this command:

    # tune2fs -c 0 /dev/sdb1
    tune2fs 1.41.12 (17-May-2010)
    Setting maximal mount count to -1

    `tune2fs -i 0 /dev/sdb1` will also disable the automatic fsck.

    -= Stefan

  • Ezequiel Feb 3, 2012 @ 20:16

    Every time i need some tech advise i go to google to find information, every other site is kind of scrambled, no clear information, until i find this page.

    NOTHING needs to be explained…..everything clear as water.
    Thank you so much guys, keep up the GREAT work

  • er0n Mar 18, 2012 @ 7:39

    Great work, mate!

  • Devon Schreiner Apr 3, 2012 @ 14:07

    Awesome, thank you so much. That’s exactly what I was looking for. *Thumbs up*

  • Tom Apr 4, 2012 @ 22:28

    Thank you so much for this information/tutorial!

    Keep up the good work! 🙂

    *thumbs up*

  • Brett Webb Apr 25, 2012 @ 13:47

    I am a little confused. Do I need to perform these steps prior to OS install, during the install or after the install?

    • 🐧 nixCraft Apr 25, 2012 @ 16:30

      Most modern installer will do these steps for you during installation only. If you add a new raid or large disk storage after the install, then you need to boot into os and type the commands.

  • Andy May 9, 2012 @ 18:12

    “(parted) mkpart primary 0 0”
    …should be…
    (parted) mkpart primary 0 3

    And Ubuntu appears to support GPT now (May 2012)

  • yuria May 29, 2012 @ 6:24

    Hi Master,
    i have problem when i create new partition:

    Use the mkfs.ext3

    #mkfs.ext3 /dev/mapper/mpath0
    /dev/mapper/mpath0 is apparently in use by the system; will not make a filesystem here!

    I’ve been working on this issue for almost day and I can’t figure out how to format these partition.

  • Ha May 29, 2012 @ 10:33

    How can I type those commands in the OS install beginning?

    My problem: 2.4Tb Raid5 with oracle Linux 5 U6

    the error message with GPT don’t allow me to do NEXT when I tried to format a layout 🙁

    Too BAD.

  • Pete Jun 1, 2012 @ 9:43


    If I got a 20TB device /dev/sdb & I creat a 16TB parition /dev/sdb1

    How do I create a second partition with the remaining space using parted?

  • 🐧 nixCraft Jun 1, 2012 @ 10:45


    You can use the same command to create a partition:

    mkpart primary 0.00TB 16.00TB
    mkpart primary 16.00TB 20.00TB

    You can do it interactively too. Just type mkpat and it will ask you various questions as follows:

    (parted) mkpart
    Partition type?  primary/extended? primary
    File system type?  [ext2]? ext4
    Start? 16TB
    End? 20TB
    (parted) print free
  • Victor Nov 20, 2012 @ 11:39

    Yeah, I should prbboaly wipe it clean and start over I just don’t feel like reinstalling everything. There was a time when reinstalling windows felt exciting a new beginning, and all that shit. Now it just feels like work.I think I’m gonna get one of those external USB drives. I saw dell selling 270 GB LaCie for $100 yesterday which seemed like a decent deal. Then I can back up both drives nightly (80G + 160G). a0|a0

  • Mudassir Nov 22, 2012 @ 9:36

    Many thanks

  • Bart Nov 25, 2012 @ 0:06

    correction to the step which shows the command (parted) mkpart primary 0 0
    should read (parted) mkpart primary 0 3

  • Christopher Dec 22, 2012 @ 21:37

    And this is why I hate Linux. Having to use a damned command-line thing for something that should be an easy GUI thing.

    Tried Linux for 3 months-, was pissed off by it, went back to Windows.

    • Dave Jun 6, 2013 @ 23:24

      Chris, and we are all the better off because of it.

  • shahzaib.cb Jan 2, 2013 @ 10:44

    Warning: Partition(s) on /dev/sda are being used and after ignoring it another error comes with resource busy, and server got down 🙁 unable to extent partition to 5tb . Please help me

  • Christop-HER Jan 9, 2013 @ 17:06

    Christoper: Cry me a river. We won’t miss you 🙂

  • Sporo Jul 1, 2013 @ 10:28

    Hi, Am trying to create a partition and i have a 28TB.

    WARNING: GPT (GUID Partition Table) detected on ‘/dev/sdb’! The util fdisk doesn’t support GPT. Use GNU Parted.

    WARNING: The size of this disk is 27.0 TB (26999991042048 bytes).
    DOS partition table format can not be used on drives for volumes
    larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
    partition table format (GPT).

    Disk /dev/sdb: 26999.9 GB, 26999991042048 bytes
    255 heads, 63 sectors/track, 3282561 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 267350 2147483647+ ee EFI GPT

    I followed all the steps on this page but a, stil getting error when ever i try to mount the device. Please note that am still learning linux.
    [root@eca ~]#mkfs.ext4 /dev/sdb1
    bash: mkfs.ext4: command not found
    [root@eca ~]# mkfs.ext3 /dev/sdb1
    mke2fs 1.39 (29-May-2006)
    mkfs.ext3: Size of device /dev/sdb1 too big to be expressed in 32 bits
    using a blocksize of 4096.
    Please help?

  • eieiei Oct 28, 2013 @ 18:08


    I am glad you went back to m$$, stay there.

    How the hell ppl get >20TB of storage? That’s over a grand!!

  • seb Jul 23, 2014 @ 13:15

    Thank you very much for the tip! It works very well!

  • Polyprogrammer Aug 13, 2014 @ 0:29

    First, Thanks to everyone for all of the support.

    As a newcomer to the Linux community I have made a firm commitment to making the transition from XP to Linux (14.04 LTS) just as I had to transition from DEC PDP-11’s to Apple and Windows GUI’s long ago.

    While attempting to format my 3TB drive via the previous directions it seems that my drive has mysteriously shrunk – LOL leaving the following:

    (parted) print free
    Model: WDC WD30 EURX-63T0FY0 (scsi)
    Disk /dev/sdb: 802GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 17.4kB 802GB 802GB primary

    What I am looking for is how to get access to all of the 3TB I started with and not have the partition change from one to many and lose data in the process.

    Clearly I must have missed a step or someone has assumed that all of us knew what steps were missing somewhere.

    Either that or my drive has fallen victim to the same form of inflation that has befallen the Dollar and Euro – LOL.

    Thank you.

  • Tony Nov 12, 2014 @ 4:15

    I would like to apply the same technique to a 4TB drive where I would like to have two 2TB partitions. As much traffic as there is on this I would appreciate some clarification on the procedure given.

    The implication is that rather than

    “mkpart primary 0.00TB 3.00TB”

    I can invoke

    mkpart primary 0.00TB 2.00TB and mkpart secondary 2.00TB 4.00TB

    Is it that simple?

    Thank you.

  • Wernher Sep 23, 2015 @ 9:16

    Why don’t they just add this functionality to fdisk so that it can can create partitions larger than 2TB instead that use another tool to get this done.

  • Daniel Ibm Oct 17, 2015 @ 0:59

    So The 4th partition (extended) on linux can’t be higher than 2TB?

  • FreeSoftwareServers Oct 13, 2016 @ 18:09

    parted /dev/sdb
    mklabel gpt
    mkpart primary 2048s 100%
    align-check optimal 1
    mkfs.ext4 /dev/sdb1

  • sam Nov 5, 2016 @ 8:57

    Dear I have 5 TB , in that iu need to create 3 partition , not allow me to do , please let me know how i need to do thi8s

  • Arko Mar 6, 2017 @ 8:02

    I’m having a problem creating partitions in CentOS 7 on my raid array
    Model: HP LOGICAL VOLUME (scsi)
    Disk /dev/sdb: 8002GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt

    the command “mkpart primary 0 -0” or mkpart primary 1 -1 throws a warning:
    Warning: You requested a partition from 0.00B to 8002GB (sectors 0..15627941551).
    The closest location we can manage is 17.4kB to 1048kB (sectors 34..2047).
    Any idea why I can’t create partitions?

  • Arko Mar 6, 2017 @ 12:30

    needded to run dd if=/dev/zero of=/dev/sdb bs=512 count=1 conv=notrunc. After that I could create the partition using your instructions.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum