Solved Moved home folder to another partition. Not sure whether I broke /etc/fstab or the copy process

Solved issue

FAyrolo

New Member
Joined
Aug 18, 2024
Messages
2
Reaction score
1
Credits
28
Hi. I have a dual drive setup, where I put the home folder inside the HDD and the rest of the system in the SSD. I formatted my PC a few weeks ago and reinstalled Debian, and forgot to set up the home folder in the HDD before copying my files over from the backup. This resulted in an active home folder in the SSD, and an older home in the HDD, still formatted as an ext4 filesystem however.
I followed the steps here https://www.howtogeek.com/442101/how-to-move-your-linux-home-directory-to-another-hard-drive/
except for the part where they create and format the partitions and all that, since the folder, partition and filesystem were already in place.
I simply copied my SSD's home into the HDD, backing up the older home just in case, and then edited fstab with the last line as follows:
Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb3 during installation
UUID=6fee783a-1d86-431f-a994-30d72a2e190c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdb2 during installation
UUID=A744-AHD4  /boot/efi       vfat    umask=0077      0       1
# new home folder location
/dev/sda3    /home    ext4    defaults    0    0

Now, the last line is currently commented, because when I reboot the system I can't get past the login screen. I just enter my password, it looks like it's logging in and then puts me right back in the login screen again.
My current solution to this is commenting the last line of fstab and then switching to a terminal and mounting the folder manually, with
Code:
sudo mount /dev/sda3 /home
and then I can log in as normal.
It is also worth noting that I know it's a mount problem because when switching to the terminal in tty2 I get a message saying there was a mount error and $HOME=/ will be used
What I don't understand is what I could be doing wrong with the fstab entry in my file, or if it's a different problem altogether that I'm not catching.
 


Hey there! Sounds like you're having a bit of a rough time with your home folder setup. No worries, it happens to the best of us!

From what you described, it seems like your /etc/fstab entry for the home directory might be the culprit. Since you’re able to mount it manually and log in without issues, that’s a good sign!

First off, let’s double-check your fstab line. Make sure that the UUID for /dev/sda3 actually matches the partition where your home folder is located. You can find the UUID by running blkid in the terminal. If the UUID doesn't match, just update that line in fstab.

Also, you might want to try changing the entry to this format:

Code:
UUID=your-uuid-here /home ext4 defaults 0 2

Replacing your-uuid-here with the actual UUID you found earlier. The 0 2 at the end is generally a good practice for the home partition, which helps with boot order.

Lastly, if you’re still having issues, check the permissions on the home folder on the HDD. It should be owned by your user (like yourusername:yourusername). You can fix that with:

Bash:
sudo chown -R yourusername:yourusername /home

Give that a shot and see if it helps! If you still run into problems, let us know, and we can dig a bit deeper. Good luck!
 
^^^
Sounds like a bog-standard AI-generated reply. Jeez.....


Mike. o_O
 
^^^
Sounds like a bog-standard AI-generated reply. Jeez.....


Mike. o_O

It sure does. While that's not technically against the rules, the polite thing to do is acknowledge it in your post as having been AI generated.
 
It's generally a good idea to be running on a different root file system when you do something major like this. Boot to a flash drive or something. Then you can mount the normal file systems at mount points and work on them. Always use UUIDs in your /etc/fstab file instead of just referring to the drive by the /dev/ reference. Make sure that all of the UUIDs on your system are truly unique or the system will get confused. Having a separate device, like a flash drive, to boot to when you need to is extremely valuable.

Signed,

Matthew Campbell
 
Thanks for the replies! I thought listing the drive as /dev/... was enough but I'll stick to uuid in the future.
 


Members online


Top