on
dns
technitium
ubuntu
- Get link
- X
- Other Apps
Recently add a 4TB HDD as secondary data drive on my Lubuntu 22.04 LTS. It use ext4 as default file system and I notice the free disk space does not add up compare to the used disk space.
user1@user1-pc:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 1.6M 3.2G 1% /run
/dev/sda2 439G 156G 261G 38% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /run/qemu
tmpfs 16G 0 16G 0% /tmp
/dev/sda1 300M 6.0M 294M 3% /boot/efi
/dev/sdb1 3.6T 2.6T 882G 75% /mnt/sdb1
tmpfs 3.2G 84K 3.2G 1% /run/user/1000
Upon further checking, I found out ext4 file system will reserve 5% disk space for root as emergency. Since the drive is for data storage, there is no need to reserve the disk space.
user1@user1-pc:~$ sudo tune2fs -l /dev/sdb1 | egrep "Block size:|Reserved block count"
Reserved block count: 48837683
Block size: 4096
Use tune2fs utility to set the reserved blocks to 1% or 0% to disable it.
user1@user1-pc:~$ sudo tune2fs -m 1 /dev/sdb1
tune2fs 1.46.5 (30-Dec-2021)
Setting reserved blocks percentage to 1% (9767536 blocks)
user1@user1-pc:~$ sudo tune2fs -l /dev/sdb1 | egrep "Block size:|Reserved block count"
Reserved block count: 9767536
Block size: 4096
user1@user1-pc:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 1.6M 3.2G 1% /run
/dev/sda2 439G 156G 261G 38% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /run/qemu
tmpfs 16G 0 16G 0% /tmp
/dev/sda1 300M 6.0M 294M 3% /boot/efi
/dev/sdb1 3.6T 2.6T 1.1T 72% /mnt/sdb1
tmpfs 3.2G 84K 3.2G 1% /run/user/1000
Comments