The other day, my home partition got corrupted. Thankfully, my home and root directories are on separate partitions. Here is how to replace just the home partition with the KDE partition manager.
Boot into a live CD.
lsblk
sudo cryptsetup luksOpen /dev/sdX myvolume
Don't forget to close cryptsetup when you are done!
Mount external drive for back up.
sudo apt install testdisk
sudo testdisk
Shred the old home partition and create a new one via KDE partition manager. Set the correct format and label.
Confirm correct /etc/fstab entry via sudo cat /etc/fstab
.
Reboot and enter system recovery mode through GRUB.
If default home directories and files are not created, use /etc/skel
or xdg-user-dirs
.
This copies the default configuration files from the system-wide default user settings.
su - username
sudo cp /etc/skel/.* /home/user
This tool is used by Debian to automatically create default home directories.
su - username
sudo apt install xdg-user-dirs
xdg-user-dirs-update
sudo chown -R user:user /home/user
chmod -R 755 /home/user
Reboot, and everything should work!