Cannot Log in after new install using BTRFS subvolumes

Archived topics about LMDE 1 and LMDE 2
Locked
AvonGil

Cannot Log in after new install using BTRFS subvolumes

Post by AvonGil »

Hi everyone, I really want to have snapshots of my file system so I installed LMDE onto an SSD and then used the following quide to help me move over / and /home to subvolumes...

http://penzoditutto.blogspot.com/2013/02/how-to-install-linux-mint-debian.html

Here is what I did:
-------------------------------------------------------
Installed Linux Mint DE to the SSD and then did the following the live installer:

sudo su
mkdir /mnt/btrfs
mount /dev/sdc2 /mnt/btrfs/

Create two subvolumes (one for / and one for /home):

/sbin/btrfs subvolume create /mnt/btrfs/root-sub
/sbin/btrfs subvolume create /mnt/btrfs/home-sub

rsync -avz --exclude=root-sub --exclude=home-sub /mnt/btrfs/ /mnt/btrfs/root-sub/
rsync -avz /mnt/btrfs/home/ /mnt/btrfs/home-sub/

cd /mnt/btrfs/
rm -r !(root-sub|home-sub)

/sbin/btrfs subvolume list /mnt/btrfs/

output was :
ID 261 top level 5 path root-sub
ID 263 top level 5 path home-sub

now set the root-sub subvolume:
/sbin/btrfs subvolume set-default 261 /mnt/btrfs/

Then Set /etc/fstab to mount subvolumes:

gedit /mnt/btrfs/root-sub/etc/fstab
Made the following changes to fstab NOTE the xxx_whatever etc was my UUID, I cannot remmeber it....

# /dev/sda2
UUID=xxxx_whatever_xxxxxx / btrfs defaults 0 0

then add a line to mount the home-sub subvolume in /home folder:
# home subvolume
UUID=xxxx_whatever_xxxxxx /home btrfs defaults,subvol=home-sub 0 0
--------------------------------------


after a reboot I could not log in! I got an error message that the system could not find the /home/alvaro directory and should try to log in using /. When trying to log into the root directory it fails. I cannot log in as root user either to try to fix this....

Found this bug:
https://bugs.launchpad.net/linuxmint/+bug/1055046

Can anyone help please? Im running out of things to try!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
penzoiders

Re: Cannot Log in after new install using BTRFS subvolumes

Post by penzoiders »

Hi Alvaro,

As your system boots it means that / subvol is working.

Try to boot the livecd and fix permissions on the /home subvolume's folders.

They may be read only and so not working (try with a unsafe 777 recursive for all subvolume, then narrow it down)

I think this can be the issue to fix.
AvonGil

Re: Cannot Log in after new install using BTRFS subvolumes

Post by AvonGil »

I changed the permissions of /home to 777. I still cannot log in!
Same error:
"Your home directory is listed as '/home/*****' but it does not appear to exist. Do you want to log in with the /(root) as your home directory? It is unlikely anything will work unless you use a failsafe session."

When I try to log in as root that fails and tells me that a users home directory must be owned by that user and have permisions of 644...

How do I log in and set those permision and chown if I cannot log in as root?? I can only really boot of the USB and edit the file system there, but I cannot set the owner of /home/alvaro as alvaro since that user does not exist on the USB file system.

Any thoughts?
Makoto

Re: Cannot Log in after new install using BTRFS subvolumes

Post by Makoto »

Just a thought. I recently formatted an external storage HDD to Btrfs. The drive's directory was owned by root preventing me from doing anything with it with standard user permissions. I would recommend finding out who owns /home/[user].

Have you tried logging into the root account straight up?
Or you might be able to add the user alvaro on the live install, then change ownership of the folder.
AvonGil

Re: Cannot Log in after new install using BTRFS subvolumes

Post by AvonGil »

Ok, I booted off the USB live install again and made a new user with the same name as mine. I changed the ownership of the /home/alvaro from mint to alvaro with the -R option.
I still cannot log in as the alvaro user (or root) it stats that the home directory has been set to '/home/alvaro' but it does not exist. Something must have gone wrong specifying where the home directory is, but everything seems ok.

How can I log in as root to see if I can fix this issue?
Makoto

Re: Cannot Log in after new install using BTRFS subvolumes

Post by Makoto »

To log in as root, use CTRL+ALT+F1 to bring up a tty. Use the login name "root" together with the root password. Then chown the folder of the mount point of the BTRFS recursively. That worked for me :)
Locked

Return to “LMDE Archive”