Reformat only the home partition

I have 3 partitions: swap, / and /home. How can I safely reformat /home? Do I have to take additional steps aside from ordinary reformating?

2

1 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 /home
  • Reformat the home partition (make sure, hat you select the right partition. Check in /etc/fstab and run lsblk)

    $ mkfs.ext4 -F /dev/sdXX
  • Mount the empty filesystem to /home (if the filesystem has changed, modify /etc/fstab accordingly)

    $ mount /home
  • Re-Create home folders for existing users.

    $ cp -r /etc/skel /home/username
    $ chown -R username:usergroup /home/username

That’s it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like