0

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.

Thanks

  • It might be possible but you will have to create a GPT partitions on your disk using tools such as gpartedor parted. – Ron May 21 '15 at 8:00
  • I read about using parted via command line but when I invoke command: mklabel gpt. Warning appears: 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? – Freeda Suing May 21 '15 at 8:02
  • What is the size of your current partition? Can you add the output of sudo fdisk -l to your question? – Mitch May 21 '15 at 8:06
  • Do you currently have GPT? Make sure the partition is unmounted before partitioning. It is better to use gparted's GUI if it helps. – Ron May 21 '15 at 8:09
  • 1
    Have you truncated your fdisk output? It currently shows no partitions. If you have existing partitions and if your disk currently uses the MBR partition table, you can convert it from MBR to GPT using gdisk -- see rodsbooks.com/gdisk/mbr2gpt.html for details. As psusi says, you may need to change boot modes or re-install your boot loader. As to future expansion, that's possible, but you may need to move the backup partition data if you add space to your RAID. IIRC, parted does that semi-automatically. gdisk does it via an explicit command. – Rod Smith May 21 '15 at 13:31
2

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.

1

The problem is your partition table, not ext4. You'll need to backup, format, and restore to convert from MBR to GPT. Booting from GPT requires either an EFI system partition ( if your motherboard supports UEFI ) or a 1 mb bios_grub partition. After that, resizing in the future is done easily with gparted.

  • As long as the start of the partiton is on the same place, the file system doesn't really care about the partition table. It's dangerous, but often very possible to change partition without any real impact - as long as the partition itself is intact. – vidarlo Oct 21 '17 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.