brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tune2fs -m 1 gives back the reserved space on a large data disk

Disk
~/tips/tip-disk-tune2fs-reserved-blocks

sudo tune2fs -m 1 /dev/sdb1

Lowers the share of an ext4 disk that is reserved for root, so you get the space back.

ext4 keeps 5% of the disk for root by default. On a 10 TB data disk that is half a terabyte nobody can use.

sudo tune2fs -l /dev/sdb1 | grep -i 'reserved block count'
sudo tune2fs -m 1 /dev/sdb1

-m sets the reserved percentage, and it works on a mounted filesystem. Use it on disks that only hold data. Leave the root filesystem alone, because the reserve is what lets the system keep working when a user fills the rest. It only applies to ext2, ext3 and ext4, not to XFS or Btrfs.

Further reading: tune2fs manual page

More Disk tips sudo e2freefrag /dev/sdb1 sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' lsscsi -s udisksctl power-off -b /dev/sdX du -sh — .[!.]* * 2>/dev/null | sort -h All Disk tips (44) All topics

Link