ext3 full but not _FULL_

root@horsepr0n:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sde1 9.3G 8.8G 0 100% /

8.8gb of 9.3gb isnt 100%. This is because the default behaviour of ext3 is to reserve 5% of the filesystem to the superuser. (in case things get full, so your system wont ubercrash)

How to fix:
root@horsepr0n:~# tune2fs -m 0 /dev/sde1
tune2fs 1.41.3 (12-Oct-2008)
Setting reserved blocks percentage to 0% (0 blocks)

Now we got room for some more horsepr0n:

root@horsepr0n:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sde1 9.3G 8.8G 473M 96% /

Tags: ,

Howto resize an ext2/3 filesystem on a partition or an image of a partition

Unmount disk or image
umount /dev/sda1
fsck -n /dev/sda1

Next we remove the journal from /dev/sda1, thus turning it into an ext2 partition:
tune2fs -O ^has_journal /dev/sda1

And fsck again..
e2fsck -f /dev/sda1

Now we resize our file system with resize2fs. resize2fs can resize ext2 file systems, but not ext3 file systems, that’s why we had to turn /dev/sda1 to ext2. Currently, 4.1GB are used on /dev/sda1 (see the df -h output above), So it’s safe to shrink it from 10GB to about 6GB (if you make it smaller than 4.1GB, you will lose data!). Therefore we run
resize2fs /dev/sda1 6000M

Aaaaand fsck again…
fsck -n /dev/sda1

Then we create the journal on our new /dev/sda1, thus turning it into an ext3 partition again:
tune2fs -j /dev/sda1

Tags: , , , , , , ,