Score:0

How to Maximize Partition Size in Ubuntu Linux

kp flag

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?

phuclv avatar
sd flag
probably just a misunderstanding between GB and GiB: 931.3GB = 867GiB
youngfong avatar
kp flag
Will the ExFat partition be listed in GB and the ext4 partition in GiB?
phuclv avatar
sd flag
no, it depends on the tools. They're simply different units. Modern macOS and Linux GUI tools use decimal units but if you use Linux CLI tools then it's usually binary units, so the number will be smaller
phuclv avatar
sd flag
please show the output of `fdisk -l` (don't take screenshots of texts, just copy and paste here) or the screenshot of gparted
Score:1
sd flag

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

youngfong avatar
kp flag
Thanks very much! Using mkfs.ext4 -m 1 I get 906.5G
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.