I need to shrink an ext4 /home
partition (/dev/sda9
) to make space for something else.
I would prefer avoid live CDs (boot troubles with new EFI and. I don't have a CD/USB in hand in the office).
I can boot as root directly to command line so I can unmount /home
but then, for some reasons, I can't use the GUI even for the root user, so I can't use GParted.
Is there a terminal command to resize an unmounted ext4 partition without losing data ?
Just comment out the corresponding line in
/etc/fstab
, reboot into recovery mode and make shure that/home/$your_user
exists and has the correct permissions (mkdir -p /home/$your_user && chown $your_user:$your_user /home/$your_user
). Reboot and you can use the GUI to shrink the partition.The terminal command for EXT filesystems is
resize2fs
, depending on the partition table you have to use different tools to resize the partition (e.g.fdisk
orgdisk
), but I would recommend using the GUI.