0

I do not have an IT background. I am working things out on my own, so I would really appreciate your help on this as I am in a panic at the moment.

I wanted to increase the size of my /home directory (as a normal user). I followed the steps provided below by Ari: How to shrink /home and add more space on CentOS7

However, after following the steps (except that I saved the backup in the /root (as superuser), I could no longer login back to my account.

When I used the GUI to login, my password was accepted by the system. But then the screen turns blank and then I am sent back to the login screen. When I checked /etc/passwd, I could see my account name and home directory as /home/myname.

Can I still recover my account? I have very important files and software. What should I do?

The following is the original post by Ari:

As others have pointed out, XFS filesystem cannot be shrunk.

So your best bet is to backup /home, remove and recreate its volume in a smaller size and give the rest to your /root volume just as Koen van der Rijt outlined in his post.

• backup the contents of /home

tar -czvf /root/home.tgz -C /home . • test the backup

tar -tvf /root/home.tgz • unmount home

umount /dev/mapper/centos-home • remove the home logical volume

lvremove /dev/mapper/centos-home • recreate a new 400GB logical volume for /home, format and mount it

lvcreate -L 400GB -n home centos mkfs.xfs /dev/centos/home mount /dev/mapper/centos-home • extend your /root volume with ALL of the remaining space and resize (-r) the file system while doing so

lvextend -r -l +100%FREE /dev/mapper/centos-root • restore your backup

tar -xzvf /root/home.tgz -C /home • check /etc/fstab for any mapping of /home volume. IF it is using UUID you should update the UUID portion. (Since we created a new volume, UUID has changed)


newaminal
  • 1
  • 1

1 Answers1

0

Your best option is to recover /home from a backup, I'm sure you'll have one since /home contains "very important files and software".