Linux Creating a Partition Size Larger Than 2TB - NixCraft

Embed Size (px)

Citation preview

  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    1/14

    AboutContact usForumsHomeLinux How-to & TutorialsShell ScriptsRSS/Feed

    nixCraft

    Linux Creating a Partition Size Larger Than 2TBby NIX Crafton November 6, 2007 66 comments LAST UPDATED September 19, 2011

    in CentOS, Debian Linux, File system

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

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

    (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 64bitplatforms. You must include GPT support in kernelin order to use GPT. If you don't includeGPT support in Linux kernelt, after rebooting the server, the file system will no longer be mountable or the GPT table will get corrupted. By default RedhatEnterprise Linux / CentOS comes with GPT kernel support. However, if you are using Debian or Ubuntu Linux, you need to recompile the kernel. SetCONFIG_EFI_PARTITION

    to y to compile this feature.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 bytesI/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

    http://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://en.wikipedia.org/wiki/Image:GUID_Partition_Table_Scheme.svghttp://files.cyberciti.biz/uploads/tips/2007/11/guid-partition-table-schemesvg.pnghttp://www.cyberciti.biz/tips/category/file-systemhttp://www.cyberciti.biz/tips/category/debian-linuxhttp://www.cyberciti.biz/tips/category/centoshttp://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/http://feeds.cyberciti.biz/Nixcraft-LinuxFreebsdSolarisTipsTrickshttp://bash.cyberciti.biz/http://www.cyberciti.biz/faq/http://www.cyberciti.biz/http://nixcraft.com/forum.phphttp://www.cyberciti.biz/tips/contact-ushttp://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/tips/category/linuxhttp://www.cyberciti.biz/tips/category/file-system
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    2/14

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

    Output:

    GNU Parted 2.3

    Using /dev/sdb

    Welcome to GNU Parted! Type 'help' to view a list of commands.

    (parted)

    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

    (parted)

    Next, set the default unit to TB, enter:

    (parted) unit TB

    To create a 3TB partition size, enter:

    (parted)mkpart primary 0 0

    OR

    (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

    OR# 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 userFirst 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

    http://www.cyberciti.biz/faq/unix-disk-usage-command-examples/
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    3/14

    /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 /etc/fstab, ifnecessary. 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 bootserver from another disk such as IDE / SATA / SSD disk and store data on /data.

    Further readings:

    How Basic Disks and Volumes Work(little outdated but good to understand basic concept)GUID Partition Table from the Wikipediaman pages parted

    Updated for accuracy!

    TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!Featured Articles:

    30 Cool Open Source Software I Discovered in 201330 Handy Bash Shell Aliases For Linux / Unix / Mac OS XTop 30 Nmap Command Examples For Sys/Network Admins25 PHP Security Best Practices For Sys Admins20 Linux System Monitoring Tools Every SysAdmin Should Know20 Linux Server Hardening Security TipsLinux: 20 Iptables Examples For New SysAdminsTop 20 OpenSSH Server Best Security PracticesTop 20 Nginx WebServer Best Security Practices20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors15 Greatest Open Source Terminal Applications Of 2012

    My 10 UNIX Command Line MistakesTop 10 Open Source Web-Based Project Management SoftwareTop 5 Email Client For Linux, Mac OS X, and Windows UsersThe Novice Guide To Buying A Linux Laptop

    { 66 comments read them below or add one}

    1Ryan November 10, 2007 at 8:02 pm

    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.

    Reply

    2Benjamin Schweizer November 26, 2007 at 4:53 pm

    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.

    Reply

    3Paul March 12, 2008 at 7:40 am

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

    Reply

    4John March 17, 2008 at 1:10 am

    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

  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    4/14

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

    Reply

    7svrmarty November 11, 2008 at 2:28 pm

    when im booting my own build debian kernel,it stocks when the system wants to mount to root filesystem.

    it says somthing likethe following disks found0800 sd sda0810 sd sdb

    Reply

    8svrmarty November 12, 2008 at 12:07 pm

    the error is

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

    Reply

    9Jamie November 20, 2008 at 11:30 pm

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

    Reply

    10Randall January 8, 2009 at 3:07 pm

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

    Reply

    11Luke January 28, 2009 at 6:42 am

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

    Reply

    12John June 9, 2009 at 2:28 pm

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

    Reply

    13Manish Patel June 27, 2009 at 4:56 am

    Hi,

    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 tocreate a partition like one 5TB and one 3TB.

    How I can get it done in FreeBsd.

    Thank youManish

    Reply

    14what? December 20, 2009 at 8:45 am

    i dont understand the premise.

    since i cant buy a > 2tb drive, i dont see the problem.

    fdisk /dev/sda(make a partition of type fd, that spans the entire 2tb drive)fdisk /dev/sdbditto sdcditto 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 youll have to run fdisk against something larger then 2tb????

    Reply

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=152386#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=149158#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=148884#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=146945#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=146612#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=145672#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=145560#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=145554#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=145284#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    5/14

    15nixCraftDecember 20, 2009 at 11:18 am

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

    Reply

    16Amit Sinha December 22, 2009 at 8:42 pm

    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 doyou create partitions for OS, swap and other stuff.

    Reply

    17SassyZ January 16, 2010 at 9:11 pm

    Great Post!!!

    Prior to this article, I was having trouble partitioning a 6TB Raid 5 Array (4 x 2TB disks).Im 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

    quit

    mkfs.ext3 /dev/sda

    -

    * Note:I first tried using gparted but something with the data types in the graphical interface didnt like the size of the raid array and was displaying

    negative values. Stupid gui.

    Reply

    18Chad Farmer July 18, 2011 at 9:29 pm

    Just for people who get search hits on this pageI suggest the commands:

    parted /dev/sdamklabel gptmkpart primary 0 -0printquitmkfs.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 firstpartition is named /dev/sda1. So the mistake in the last command is specifying the wrong device special file name. The command should bemkfs.ext3 /dev/sda1to create a file system in the first partition. The command mkfs.ext3will create a file system starting at sector zero andoverwrite the GPT. (Note Ive never tried a size of -0, so use print to verify the partition that was created.)

    Reply

    19Jon Kiji January 19, 2010 at 11:33 am

    [quote]show me where with the biggest drives you can buy as of today, that youll 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.

    Reply

    20Chris February 9, 2010 at 1:10 am

    This isnt working for me.

    (parted) mklabelNew disk label type? gptError: Invalid argument during write on /dev/sdbRetry/Ignore/Cancel?

    Would this have anything to do with it

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

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

    Reply

    21Chris February 9, 2010 at 1:22 am

    [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.

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=153413#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=152993#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=172566#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=152952#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=152425#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=152387#respondhttp://www.cyberciti.biz/tips/about-us
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    6/14

    Disk /dev/sdb doesnt contain a valid partition table.

    Will this cause any problems?

    Reply

    22andrew March 12, 2010 at 11:49 am

    I tried that but if I run fdisk -l i get.Disk /dev/sdb doesnt 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 dont know why youd dual boot with a massive RAID like that) or make it more portable then youshould follow the instructions in the article for creating a GPT instead.

    Reply

    23Cristian March 29, 2010 at 4:54 pm

    Excelent ! works as a charm

    Reply

    24Anonymous June 11, 2010 at 12:23 am

    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 whendecided 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 withoutan MBR. So much mis information for such a small article. You can use a GPT with a standard bios, its just that EFI is aware of the GPT, where astandard bios knows nothing of it, and just loads the first sector of the disk, and lets it do its thing. All they did was move some code from the hard driveinto the firmware, doesnt really make any difference where it resides, its all software that performs the same function

    Reply

    25Joe the mechanic July 7, 2010 at 12:07 pm

    I thought I setup everything correctly but I am also getting

    Disk /dev/sdb doesnt 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

    JoeATL support systems678-243-5712

    Reply

    26nixCraftJuly 7, 2010 at 12:50 pm

    Disk /dev/sdb doesnt 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.

    Reply

    27Dmitry Sherman November 3, 2010 at 4:47 pm

    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.5TBi get those messages in the kernel:kernel: attempt to access beyond end of deviceits debian lenny, parted looks good, no errors.Model: IBM 1726-3xx FAStT (scsi)Disk /dev/sdb: 3999GBSector size (logical/physical): 512B/512BPartition Table: gpt

    Number Start End Size File system Name Flags

    1 17.4kB 3999GB 3999GB ext3 primary

    any suggestions?

    Reply

    28Jay Shepherd December 14, 2010 at 12:30 am

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=160703#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=157451#respondhttp://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=157447#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=156462#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=154594#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=154233#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=153414#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    7/14

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

    Reply

    29Adrian Schmid February 22, 2011 at 4:36 pm

    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 partitiontables 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

    Reply

    30Chad Farmer July 18, 2011 at 9:53 pm

    GPT stands for GUID Partition Table. This mean that each partition is assigned a unique ID when the partition is created. So, copying the partitiontable 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 eachdisk that needs the same partition table and create a new partition table with the same partition types and sizes, but with new (unique) GUIDvalues.

    Although not well documented, parted will accept starting location and size in sectors, if values in MB are being rounded and causing slightlydifferent 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 Im worried about duplicating the GUID that uniquely identifies each partition, not the standardized GUID value that identifies thepartition type.

    Reply

    31Jord Wegge February 26, 2011 at 4:16 pm

    Great Tut as always.

    One question though All this assumes youve got a running system to which you plan to add a second >2TB device. When using GPT, most modernlinux distros 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 GPTed the device &partitioned it to my liking with gparted livecd).

    Suggestions?

    TIA,Jord.

    Reply

    32Jord Wegge March 11, 2011 at 7:36 pm

    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, otherwiseit will stick to msdos mbr.So: make youre raid as you wish it to be and install straight from cd.

    One smaller problem Im 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 thehw 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 dont quite see how to do that.

    Regards,Jord

    Reply

    33Jord Wegge March 11, 2011 at 7:38 pm

    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 issmaller. Fix, by moving the backup to the end (and removing the old backup)?

    Reply

    34perrysong May 16, 2011 at 1:49 am

    UsefulThanks a lot

    Reply

    35Jeff May 26, 2011 at 5:01 pm

    If you get thisWarning: The resulting partition is not properly aligned for best performance.

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=171333#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=169773#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=169772#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=169226#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=172567#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=168983#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=163246#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    8/14

    You really should run parted like so

    parted -a optimal /dev/sdb

    Reply

    36Damien April 15, 2012 at 5:05 pm

    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.

    Reply

    37edson August 24, 2013 at 12:36 pm

    Thank you.Finally it works!!Ubuntu 12.10

    Reply

    38Sean S August 11, 2011 at 11:46 pm

    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.

    Reply

    39KIRAN September 10, 2011 at 3:09 pm

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

    Reply

    40Tokynet September 11, 2011 at 10:04 am

    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

    Reply

    41nixCraftSeptember 19, 2011 at 12:13 pm

    @All,

    Ive updated the tutorial with step by step instructions.

    Reply

    42Sean October 9, 2011 at 11:49 pm

    Im getting the same errors from Parted as mentioned by Chris aboveWarning: Device /dev/sdd has a logical sector size of 4096. and Error: Invalid argument during write on /dev/sdd Retry/Ignore/Cancel? At whichpoint 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 didnt work for me, I partitioned it underOS 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 thanme wanted to explain how to do it without resorting to OS X, that would be awesome.

    Any help?

    Reply

    43Nick October 15, 2011 at 5:33 pm

    Sean,

    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 followingthe 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 carefullyback 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 bemoved to the end of the drive.

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=174725#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=174128#respondhttp://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=173860#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=173843#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=173228#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=192161#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179822#respondhttp://blog.derakkilgo.com/2010/06/12/warning-the-resulting-partition-is-not-properly-aligned-for-best-performance/http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=171570#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    9/14

    Reply

    44Sean October 15, 2011 at 9:55 pm

    Hi Nick,

    Thanks for the reply. While in Parted, I still cant get anywhere because the disks label remains unrecognized, and the mklabel command simply returnsthe above-mentioned error (pretty much every command in Parted returns the same error: unrecognised disk label). Should I be using a different Linuxtool to look at the drive?

    Reply

    45DMC November 10, 2011 at 4:22 pm

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

    Ive just found the cause of this problem.http://www.linuxquestions.org/questions/showthread.php?p=4519659#post4519659Maybe reply #9 explains the reason.Could anyone tell me whether this issue has already resolved or not.

    DMC

    Reply

    46Stefan Lasiewski January 4, 2012 at 9:59 pm

    Now the other question, how long will it take to fsck one of these 3TB filesystem? This could take many hours. Weve 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 wantto 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

    Reply

    47Ezequiel February 3, 2012 at 8:16 pm

    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

    Reply

    48er0n March 18, 2012 at 7:39 am

    Great work, mate!

    Reply

    49Devon Schreiner April 3, 2012 at 2:07 pm

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

    Reply

    50Tom April 4, 2012 at 10:28 pm

    Thank you so much for this information/tutorial!

    Keep up the good work! :)

    *thumbs up*

    Reply

    51Brett Webb April 25, 2012 at 1:47 pm

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

    Reply

    52nixCraftApril 25, 2012 at 4:30 pm

    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 needto boot into os and type the commands.

    http://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179987#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179695#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179677#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179515#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=178997#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=178003#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=175579#respondhttp://www.linuxquestions.org/questions/showthread.php?p=4519659#post4519659http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=174875#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=174869#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    10/14

    Reply

    53Andy May 9, 2012 at 6:12 pm

    Typo:(parted) mkpart primary 0 0should be(parted) mkpart primary 0 3

    And Ubuntu appears to support GPT now (May 2012)

    Reply

    54yuria May 29, 2012 at 6:24 am

    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!

    Ive been working on this issue for almost day and I cant figure out how to format these partition.

    Reply

    55Ha May 29, 2012 at 10:33 am

    Hello,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 dont allow me to do NEXT when I tried to format a layout :(

    Too BAD.

    Reply

    56Pete June 1, 2012 at 9:43 am

    Hi,

    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?

    Reply

    57nixCraftJune 1, 2012 at 10:45 am

    @Pete,

    You can use the same command to create a partition:

    mkpart primary 0.00TB 16.00TB

    mkpart primary 16.00TB 20.00TB

    print

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

    (parted)mkpart

    Partition type? primary/extended? primaryFile system type? [ext2]? ext4

    Start? 16TB

    End? 20TB

    (parted) print free

    Reply

    58Victor November 20, 2012 at 11:39 am

    Yeah, I should prbboaly wipe it clean and start over I just dont feel like reinstalling everything. There was a time when reinstalling windows felt excitinga new beginning, and all that shit. Now it just feels like work.I think Im 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

    Reply

    59Mudassir November 22, 2012 at 9:36 am

    Many thanks

    Reply

    60Bart November 25, 2012 at 12:06 am

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

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=182297#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=182170#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=180502#respondhttp://www.cyberciti.biz/tips/about-ushttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=180498#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=180453#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=180446#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=180207#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=179988#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    11/14

    should read (parted) mkpart primary 0 3

    Reply

    61Christopher December 22, 2012 at 9:37 pm

    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.

    Reply

    62Dave June 6, 2013 at 11:24 pm

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

    Reply

    63shahzaib.cb January 2, 2013 at 10:44 am

    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 extentpartition to 5tb . Please help me

    Reply

    64Christop-HER January 9, 2013 at 5:06 pm

    Christoper: Cry me a river. We wont miss you :)

    Reply65Sporo July 1, 2013 at 10:28 am

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

    WARNING: GPT (GUID Partition Table) detected on /dev/sdb! The util fdisk doesnt 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 volumeslarger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUIDpartition table format (GPT).

    Disk /dev/sdb: 26999.9 GB, 26999991042048 bytes255 heads, 63 sectors/track, 3282561 cylindersUnits = 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/sdb1bash: mkfs.ext4: command not found[root@eca ~]# mkfs.ext3 /dev/sdb1mke2fs 1.39 (29-May-2006)mkfs.ext3: Size of device /dev/sdb1 too big to be expressed in 32 bitsusing a blocksize of 4096.Please help?

    Reply

    66eieiei October 28, 2013 at 6:08 pm

    cristopher,

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

    How the hell ppl get >20TB of storage? Thats over a grand!!

    Reply

    Leave a Comment

    Name *

    E-mail *

    Notify me of followup comments via e-mail.

    http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=193084#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=191895#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=184858#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=184541#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=191755#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=184169#respondhttp://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html?replytocom=182375#respond
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    12/14

    nixCraft

    + 13 842

    Seguir +1

    Related Posts

    Linux: Boot a 2TB+ partition or Larger Array Using Grub

    Vmware Linux Guest Add a New Hard Disk Without Rebooting Guest

    Linux: How to backup hard disk partition table (MBR)

    CentOS 4 / Redhat Enterprise Linux 4 iSCSI Installation and Configuration ( iscsi initiators )

    Re-read The Partition Table Without Rebooting Linux System

    RAID 5 vs RAID 10: Recommended RAID For Safety and Performance

    http://www.cyberciti.biz/tips/raid5-vs-raid-10-safety-performance.htmlhttp://www.cyberciti.biz/tips/raid5-vs-raid-10-safety-performance.htmlhttp://www.cyberciti.biz/tips/raid5-vs-raid-10-safety-performance.htmlhttp://www.cyberciti.biz/tips/re-read-the-partition-table-without-rebooting-linux-system.htmlhttp://www.cyberciti.biz/tips/re-read-the-partition-table-without-rebooting-linux-system.htmlhttp://www.cyberciti.biz/tips/howto-centos-rhel4-iscsi-initiators.htmlhttp://www.cyberciti.biz/tips/howto-centos-rhel4-iscsi-initiators.htmlhttp://www.cyberciti.biz/tips/linux-how-to-backup-hard-disk-partition-table-mbr.htmlhttp://www.cyberciti.biz/tips/linux-how-to-backup-hard-disk-partition-table-mbr.htmlhttp://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.htmlhttp://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.htmlhttp://www.cyberciti.biz/tips/howto-linux-boot-2tb-larger-raidarray-harddisk.htmlhttp://www.cyberciti.biz/tips/howto-linux-boot-2tb-larger-raidarray-harddisk.htmlhttp://feedburner.google.com/fb/a/mailverify?uri=Nixcraft-LinuxFreebsdSolarisTipsTrickshttp://feeds.cyberciti.biz/Nixcraft-LinuxFreebsdSolarisTipsTrickshttps://facebook.com/nixcrafthttps://plus.google.com/+CybercitiBiz?prsrc=5https://youtube.com/user/nixcraftcomhttps://twitter.com/nixcrafthttp://www.cyberciti.biz/tips/happy-diwali.htmlhttp://www.cyberciti.biz/tips/linux-migrate-printer-configuration.htmlhttp://www.cyberciti.biz/tips/tag/table-de-partition-2tbhttp://www.cyberciti.biz/tips/tag/raid-5-arrayhttp://www.cyberciti.biz/tips/tag/partition-tablehttp://www.cyberciti.biz/tips/tag/partition-sizehttp://www.cyberciti.biz/tips/tag/parted-commandhttp://www.cyberciti.biz/tips/tag/mkfs-ext3-2tb-systemshttp://www.cyberciti.biz/tips/tag/linux-large-partition-sizehttp://www.cyberciti.biz/tips/tag/linux-gpthttp://www.cyberciti.biz/tips/tag/linuxhttp://www.cyberciti.biz/tips/tag/how-to-parted-linux-command-over-2-tbhttp://www.cyberciti.biz/tips/tag/how-to-make-3-tb-partition-in-linuxhttp://www.cyberciti.biz/tips/tag/gpt-partitionhttp://www.cyberciti.biz/tips/tag/gpthttp://www.cyberciti.biz/tips/tag/gparted-commandhttp://www.cyberciti.biz/tips/tag/fdisk-partition-in-centoshttp://www.cyberciti.biz/tips/tag/fdisk-commandhttp://www.cyberciti.biz/tips/tag/fdisk-2tbhttp://www.cyberciti.biz/tips/tag/extensible-firmware-interfacehttp://www.cyberciti.biz/tips/tag/errorhttp://www.cyberciti.biz/tips/tag/efi-parititonshttp://www.cyberciti.biz/tips/tag/config-efi-partitionhttp://www.cyberciti.biz/tips/tag/centos-gpt-partitionhttps://plus.google.com/+CybercitiBiz?prsrc=5
  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    13/14

  • 8/10/2019 Linux Creating a Partition Size Larger Than 2TB - NixCraft

    14/14

    Linux / Unix: Find And List All Hidden Files RecursivelyOS X Terminal: -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory FixMac OS X: Force Quit An Unresponsive Full Screen Application Shortcut KeyUnix: Find Directory Name From PathFix: /bin/dbus-launch terminated abnormally without any error message and solutionX11 forwarding request failed on channel 0 Error and SolutionHowTo: Uninstall MySQL Server in Ubuntu LinuxLinux/Unix: Find Command Ignore Case Insensitive SearchHowTo: Setup SSH Keys on a Linux / Unix SystemLinux / Unix: chroot Command ExamplesMinify and Compress CSS & Javascript Files At a Linux/Unix Shell PromptCentOS Install Lighttpd Web-server With yum Command

    CentOS Install Java SDK using yum CommandCentOS: rpmdb: PANIC: fatal region error detected; run recovery error and solutionHowTo: Update gcutil / gcloud Components On a Linux / Unix / OS Xcurl Command Resume Broken DownloadFreeBSD Show Disk Quota Limits CommandExplain: {,} in cp or mv Bash Shell CommandsUbuntu Copy File CommandLinux: Log Suspicious Martian Packets / Un-routable Source Addresses

    Subscribe to nixCraft

    Learn something new about Linux/Unix by emailEnter your email address:

    Subscribe

    2004-2014 nixCraft. All rights reserved. Privacy Policy- Terms of Service- Questions or Comments- We are proudly powered by Linux + Nginx +WordPress.The content is copyrighted to nixCraftand may not be reproduced on other websites.

    http://www.cyberciti.biz/tips/copyrighthttp://www.cyberciti.biz/tips/contact-ushttp://www.cyberciti.biz/tips/disclaimerhttp://www.cyberciti.biz/tips/privacyhttp://www.cyberciti.biz/faq/linux-log-suspicious-martian-packets-un-routable-source-addresses/http://www.cyberciti.biz/faq/ubuntu-copy-file-command/http://www.cyberciti.biz/faq/explain-brace-expansion-in-cp-mv-bash-shell-commands/http://www.cyberciti.biz/faq/freebsd-checking-quota-limits-and-disk-usage/http://www.cyberciti.biz/faq/curl-command-resume-broken-download/http://www.cyberciti.biz/faq/howto-update-gcutil-gcloud-components-on-a-linux-unix-os-x/http://www.cyberciti.biz/faq/centos-rpmdb-panic-fatal-region-error-detected-run-recovery-error-and-solution/http://www.cyberciti.biz/faq/centos-linux-6-install-java-sdk/http://www.cyberciti.biz/faq/centos-install-lighttpd-web-server-with-yum-command/http://www.cyberciti.biz/faq/linux-unix-minify-compress-css-javascript-files-shell-prompt/http://www.cyberciti.biz/faq/unix-linux-chroot-command-examples-usage-syntax/http://www.cyberciti.biz/faq/how-to-set-up-ssh-keys-on-linux-unix/http://www.cyberciti.biz/faq/find-command-ignore-case-insensitive-search-on-unixlinux/http://www.cyberciti.biz/faq/uninstall-mysql-ubuntu-linux-command/http://www.cyberciti.biz/faq/how-to-fix-x11-forwarding-request-failed-on-channel-0/http://www.cyberciti.biz/faq/fix-bindbus-launch-terminated-abnormally-without-on-centos-rhel/http://www.cyberciti.biz/faq/unix-get-directory-name-from-path-command/http://www.cyberciti.biz/faq/how-to-force-quit-fullscreen-application-in-mac-os-x/http://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-cannot-change-locale/http://www.cyberciti.biz/faq/unix-linux-centos-ubuntu-find-hidden-files-recursively/