Can't Get Full Drive Capacity in Fdisk

5,053

Don't use MBR on a disk with over 2^32 sectors (2TiB, assuming 512-byte logical sectors)!

MBR uses 32-bit sector pointers, so anything with more than 2^32 sectors is simply incompatible with MBR -- or at least, MBR tops out at 2^32 sectors, so you won't be able to use the full capacity of the disk, as you've discovered. There are hackish workarounds that can be used to get up to about twice that capacity, but they're unreliable, especially if the disk is to be used across multiple OSes. (As a side note, you seem to be confusing TB and TiB; they aren't the same. See this page for details.)

Instead, use the GUID Partition Table to partition the disk. You can do this with GPT fdisk (gdisk, sgdisk, or cgdisk), or with most libparted-based tools (parted, GParted, and others). Recent versions of fdisk also support GPT, but Ubuntu 14.04 doesn't yet provide that version. (I think one of the later non-LTS releases does, but I don't recall when it was introduced, in Ubuntu version terms.) GPT fdisk is a GPT-specific tool modeled after fdisk, and so uses GPT by default. The others require explicit commands to use GPT rather than MBR.

If you plan to boot from the disk, you should either switch from BIOS-mode to EFI-mode booting (if your computer supports it) or add a BIOS Boot Partition to the disk. The former approach will also require an EFI System Partition (ESP). Switching to EFI-mode booting is preferable, if your computer supports that option. If you're not booting from the disk, you don't need to worry about this; just partition and use it as you see fit.

Share:
5,053

Related videos on Youtube

spcurtis81
Author by

spcurtis81

So, to be fair, I'm a novice with a considerable appetite for gaining new skills and knowledge. I am an advocate of making people's work and play experiences easier, more efficient and enjoyable through the use of technology and software. This interest is my main drive for understanding more about the way software works and how it can be molded to support a user's needs thus improving their day to day experience. Most commonly in my work environment, I use Microsoft Access and more recently I have been starting to use more VBA code and have been expanding my ability to automate and change the way colleagues access and experience date within our business; this is one of my main interests for learning and development. In considerable contrast, my other interest has been through beginning to develop iOS apps through Apple's Xcode tool. Both are areas I am seeking to gain and hopefully with time share advice and experience. Oh... and I might want to learn about Bash code.

Updated on September 18, 2022

Comments

  • spcurtis81
    spcurtis81 over 1 year

    So I recently purchased a 4 TB WD Red for my Linux Server and am now trying to partition it for use. I've already come up against the 2TB limit challenge and decided for ease, I'd just have two partitions that come in under the limit. However, I'm having difficulty getting two partitions which add up to anywhere near the size of the disk.

    I created my first partition of +2000GB and it has created the following partition...

    Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
    255 heads, 63 sectors/track, 486401 cylinders, total 7814037168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048  3906252047  1953125000   83  Linux
    

    However when I try to create the second partition using any remaining blocks (I used the defaults in fsdisk for the second partition), it only manages to create a partition in the region of 185GB...

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048  3906252047  1953125000   83  Linux
    /dev/sdb2      3906252048  4294967294   194357623+  83  Linux
    

    This is basically just my lsblk...

    sdb       8:16   0   3.7T  0 disk  
    ├─sdb1    8:17   0   1.8T  0 part  
    └─sdb2    8:18   0 185.4G  0 part  
    

    I'm sure I must be doing something wrong but even googling around the internet, I'm struggling to work out what it is. It looks as though I'm still being limited to the 2TB thing but I'm not sure if that's my problem or not. Would be grateful some pointers please.

    Thanks.

  • spcurtis81
    spcurtis81 over 8 years
    Got there eventually. Thanks for this. Used parted which allowed me to create the size I was after.