Ubuntu – Resize ext4 Partition to >2TB without data loss


Is it possible to resize an ext4 partition to >2TB without data loss?

I added 1TB disk from a RAID 5 Hardware RAID (from 2TB usable to 3TB usable)

fdisk command output:

Disk /dev/sdb: 3000.5 GB, 3000512503808 bytes
255 heads, 63 sectors/track, 364791 cylinders, total 5860375984 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 786432 bytes
Disk identifier: 0xd625ec35

   Device Boot      Start         End      Blocks   Id  System

Note: I already tried deleting partition, resizing but still device shows 2TB, then I read about the 2TB limit.


Best Answer

  • Looks like your partitions are using the MBR table format, which has a 2 TB limit. If you convert to a GPT format, you can have larger partitions.

    The good news is that you don't have to reformat/restore your drive to convert your drive from MBR to GPT. There is a tool called gdisk which can handle the conversion for you.

    sgdisk is a non-interactive version of gdisk, and you can check whether the conversion is possible by first running sgisk -p /dev/sda (assuming sda is the device you want to resize). Then you can run the MBR -> GPT conversion by running sgdisk -g /dev/sda. See the above link for the sgdisk docs.

    Backups are highly recommended, just in case.