How to Maximize Partition Size in Ubuntu Linux
I have a 1000 GB USB HDD that I'm trying to partition and then format in ext4. It was previously formatted in ExFat and provided 931.3G of space.
lsblk -f
Disk formatted in ExFat
However, with ext4, it only has 869.2G of usuable space.
lsblk -f
Disk formatted in ext4
I'm running Ubuntu Linux 21.04. I've tried partitioning the drive with fdisk and parted, but in both cases I only get 869.2G of space. Any help on using parted or fdisk to maximize the partition size using the ext4 file system would be greatly appreciated.
Perhaps ext4 has more overhead than ExFat?
Solution 1:
When I run df -H
The 1000GB HDD displays as 1.0 T when formatted in ExFat but 984G when formatted in ext4
exFAT is a very simple file system with low overhead, so formatting a 1TB drive will you almost 100% the usable space. However ext4 needs far more space for metadata and the available space for you is much lower. Besides ext4 reserves 5% of the space for the root by default, which means 50GB on a 1TB partition. To check that run the below command:
tune2fs -l /dev/sdaX | grep 'Reserved'
You can use mkfs.ext4 -m 1
to reduce the reserved space to 1% and df -H
will show significantly more free space
See also
- Can I make the system reserve for partitions smaller?
- Reserved space for root on a filesystem - why?
- Partitioning - Is 5% reserved blocks required/recommended?