I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?
21 Answer
I assume you already create some backups of your important data (because they are hard to recover after a reformat).
The following step should do it:
Login as root (required, since you will remove the home folder of the current user)
$ sudo su –Unmount the /home folder
$ umount /homeReformat the home partition (make sure, hat you select the right partition. Check in
/etc/fstaband runlsblk)$ mkfs.ext4 -F /dev/sdXXMount the empty filesystem to
/home(if the filesystem has changed, modify/etc/fstabaccordingly)$ mount /homeRe-Create home folders for existing users.
$ cp -r /etc/skel /home/username $ chown -R username:usergroup /home/username
That’s it.