How to overcome msdos partition size limit

It is really easy to hit 2 TB (using 512-byte sectors) partition size limit when using MBR disk partition table. I just hit this problem myself and solved it using GUID partition table format to create one huge partition for data storage.

Install parted utility.

$ sudo apt-get install parted

Start parted interactive mode.

$ sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.

Select device to edit - /dev/sdc in this example.

(parted) select /dev/sdc
Using /dev/sdc

Select tebibyte (240 bytes) as default unit.

(parted) unit TiB

Create fresh GPT partition table.

(parted) mklabel gpt
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes

Create one big partition for data storage.

(parted) mkpart primary 0 -1

Displays partition table.

(parted) print
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdc: 9.10TiB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start    End      Size     File system  Name     Flags
 1      0.00TiB  9.10TiB  9.10TiB  ext4         primary

Quit interactive mode.

(parted) quit
Information: You may need to update /etc/fstab.

Create filesystem on /dev/sdc1 device.

$ sudo mkfs.ext4 /dev/sdc1

Create /mnt/disk mount point.

$ sudo mkdir /mnt/disk

Mount created filesystem.

$ sudo mount /dev/sdc1 disk

Display free space, note that 5% is reserved by default.

$ df -h /mnt/disk/
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc1       9.1T  168M  8.6T   1% /mnt/disk

Get the filesystem UUID.

$ sudo tune2fs -l /dev/sdc1 | grep UUID | awk -F: '{print $2}' | tr -d ' '
d27a4404-cc8d-46b0-92b6-00de5437e281

Add an fstab entry using filesystem UUID.

$ cat << EOF | sudo tee -a /etc/fstab
UUID=d27a4404-cc8d-46b0-92b6-00de5437e281    /mnt/disk    ext4    defaults    0    0
EOF

Additional notes

Partition table using mebibyte (220 bytes) as default unit.

$ sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdc
(parted) unit MiB
(parted) print
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdc: 9538485MiB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start    End         Size        File system  Name     Flags
 1      1.25MiB  9538485MiB  9538484MiB  ext4         primary

(parted) quit
Information: You may need to update /etc/fstab.
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a system administrator working for a successful Polish company and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu