Login loop after editing /etc/fstab [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Post Reply
johnnystuff
Young Hen
Posts: 23
Joined: Sun Jan 27, 2013 16:15

Login loop after editing /etc/fstab [Solved]

Post by johnnystuff » Sat Aug 19, 2017 16:24

I didn't create a mount point for my /home partition during the install, cause I thought it was just a matter of adding a line in /etc/fstab and it was all done. That's what I did:
sabayon ~ # cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Aug 19 11:52:33 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=4aced30d-4ce8-4078-bc05-061de67daaa6 / ext4 defaults,noatime,discard 1 1
UUID=3a3f8f7e-944b-4458-9f54-3a605ee46b6f /home ext4 defaults,noatime,discard 0 1
UUID=EC46-9DA1 /boot/efi vfat umask=0077,shortname=winnt 0 0
but unfortunately this causes a login loop that I cannot fix in any possible way. Basically after I enter my username and pwd it just launches lightdm again and I'm asked to login again.

I thought it was because in the new partition there were no config files associated to my user so I just copied them. I forgot to run a chown though, but I don't think that should be necessary since the copy command should preserve owner and permissions. Anyway, tried also modifying the fstab into '/home/my-username' instead of '/home' alone but no luck there either.

Any idea? Shell I remove the user, mount the partition as /home and add the user again?

By the way, why is not possible to open another tty shell with the CTRL+ALT+F2/3/4... shortcut?
Last edited by johnnystuff on Sat Aug 19, 2017 18:03, edited 1 time in total.

User avatar
sabayonino
Sagely Hen
Posts: 3232
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Login loop after editing /etc/fstab

Post by sabayonino » Sat Aug 19, 2017 17:01

I think you didn't copy any files to the new home partition

change user to root running "su"

umount your new home partition

Code: Select all

# umount -l /home
and mount it to a tmp folder

Code: Select all

# mkdir /mnt/tmp_home && mount UUID=3a3f8f7e-944b-4458-9f54-3a605ee46b6f /mnt/tmp_home
sync old contents to tmp home

Code: Select all

# rsync -av /mnt/tmp_home/ /home/
(keep your old datas, don't remove them now)

mount new home again

Code: Select all

# mount -o remount /home
restartthe login manager or the system

your old data is stored to the unmounted /home partition , if you want to remove old data to preserve / space , umount /home and then cleanup /home/* folder)
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

johnnystuff
Young Hen
Posts: 23
Joined: Sun Jan 27, 2013 16:15

Re: Login loop after editing /etc/fstab

Post by johnnystuff » Sat Aug 19, 2017 18:02

I don't know what I was doing wrong, I sware I mounted the new home partition as you suggested and copied the files with a trivial 'copy -R' then added the line in fstab and rebooted. Probably the fact I was mounting with the /dev/sda7 name instead that by UUID? Or because rsync works differently than copy? v0v

Anyway, what matters is that now IT WORKS!!! :lol:

Just one little note: the correct syntax is
rsync -av /home /mnt/mounted_home_partition


Image

User avatar
sabayonino
Sagely Hen
Posts: 3232
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Login loop after editing /etc/fstab [Solved]

Post by sabayonino » Sat Aug 19, 2017 18:52

get /home UUID

Code: Select all

# lsblk --output UUID,MOUNTPOINT
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

johnnystuff
Young Hen
Posts: 23
Joined: Sun Jan 27, 2013 16:15

Re: Login loop after editing /etc/fstab [Solved]

Post by johnnystuff » Sat Aug 19, 2017 19:02

#blkid is shorter to write and prettier to look at :P

By the way, since it happened recently, what's the way to avoid conflicts with other distro? Of course the username would be the same, so only one /home/my_username folder among all the distro I use. Any issue with user ID, group ID, permissions, metadata and whatnot?

User avatar
sabayonino
Sagely Hen
Posts: 3232
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Login loop after editing /etc/fstab [Solved]

Post by sabayonino » Sat Aug 19, 2017 19:14

make sure the user share the same ID (user and group) , if available

Code: Select all

# id <your_username>
or

Code: Select all

# id -u <your_username> && id -g <your_username>
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

Post Reply