Cannot Move Home Directory

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Mike365
Level 2
Level 2
Posts: 72
Joined: Wed Jul 02, 2014 7:02 pm

Cannot Move Home Directory

Post by Mike365 »

Hi I have reinstalled Mint 19.1 on an SSD and my Home folder is on a 2 Tb HDD. During the install process I chose "something else " and mounted the HDD to /Home and did not format it but when I reboot the Home folder is empty as it would be in a completely clean install. I have read that to get the system to see the Home folder I first have to delete everything in the Home folder on the SSD using the RM command and then edit the fstab file by adding the UNID of the HDD.
When I do this and reboot, the system starts booting and starts checking the file system.It gets to about 30% before it stops and displays the following error
You are in emergency mode. After logging in type "journal ct 1-xb" to view system logs, "systemct 1 reboot, system ct 1 default" or "exit" to boot into default mode. Press enter for maintenance. (or press Control -D to continue):
I can mount the HDD and see it on the desktop and access the files but obviously I would prefer it to be the true Home folder.
Can anyone tell me where I am going wrong?
As always any help is very much appreciated
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.
jglen490

Re: Cannot Move Home Directory

Post by jglen490 »

Go back into your /etc/fstab file and make sure the changes took. You did make the changes in sudo, correct?
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Cannot Move Home Directory

Post by Flemur »

Mike365 wrote: Thu Jun 13, 2019 6:39 pmDuring the install process I chose "something else " and mounted the HDD to /Home and did not format it but when I reboot the Home folder is empty as it would be in a completely clean install.
You don't "mount the HDD to /Home", but you can tell the installer to use a separate partition for /home (not /Home). Did you do that? Namely in the installer, select the partition for /home, then select /home from the "use as" drop down ?

Also, Isn't a completely clean install what you have after the first boot? So what makes you think there's a problem?
It sounds like you can login, at this point anyway, and see /home/username - is that correct?
UNID of the HDD.
UUID of a partition.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
WharfRat

Re: Cannot Move Home Directory

Post by WharfRat »

Mike,

You should boot the installation media and take a look at the fstab file, the original home folder and see if there are any files now on the sdb partition

You can paste some information back here if you need to so it would be easier than trying to do things in rescue mode.
Mike365
Level 2
Level 2
Posts: 72
Joined: Wed Jul 02, 2014 7:02 pm

Re: Cannot Move Home Directory

Post by Mike365 »

Hi guys thank you for replying.

Jglen 490: Yes I did make the changes in sudo and I checked that they had taken.

Flemur: My apologies for the poor terminology, I am fairly new to Linux. During install I clicked on the drive containing my home directory and picked /home from the drop down menu as mount point and chose NOT to format but after reboot it still doesn't see that drive as home.

WharfRat: I have repeated removing /home/mike from the system using the rm command and edited fstab and then rebooted with the same result ie checking file systems until 35% and then hanging. Upon booting with the install media and checking the home folder, it now had /mint in it which includes the usual Desktop, Music, Downloads etc.
Checking fstab shows the line referring to the UUID of the root directory missing which is odd and of course also the line for the UUID of the home directory.
It seems that the reboot is somehow corrupting/changing? the fstab file.

Any clues as to what would be doing this?
Regards Mike
WharfRat

Re: Cannot Move Home Directory

Post by WharfRat »

To start boot the live media and mount the linux root partition to /mnt

Paste back grep -v ^# /mnt/etc/fstab and sudo blkid
jglen490

Re: Cannot Move Home Directory

Post by jglen490 »

O.K., I'm not telling you to do anything different from what WharfRat wants you to do.

I did something very similar to what you are trying to do a few weeks ago. I replaced my primary drive with an SSD. That primary drive had the / partition, the /home partition, and SWAP. I had a secondary drive that had some data stored on it.

When I re-installed Linux using the SSD for the / partition and SWAP, I made a /home/<username> directory on that secondary. I restored my backup /home/<username> to the secondary drive along with the original other data - all under what is now /home/<username>.

I checked the UUID for the new /home partition on the secondary drive, opened up /etc/fstab and made a line with the UUID and referenced /home in that line. Upon reboot, /home was successfully mounted using the correct UUID. When I look at the "Home" under Places in Dolphin, it shows all my data under /home/<username>.

This is what my /etc/fstab file looks like, now. I don't have the "before" view.

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=a11e2d42-980f-411f-9c73-dab5ff616804 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=E38A-9EC5  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdb1 during installation
UUID=09e6b59d-ce4c-4f26-a606-5351c3daf769 /home           ext4    defaults        0       2
# swap was on /dev/sda3 during installation
UUID=8827d90e-1afe-4832-b99b-ea74570c42e4 none            swap    sw              0       0
(END)
And here are my drives

Code: Select all

john@john-Desktop:/var/lib/dpkg$ lsblk -f
NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda                                                      
├─sda1 vfat         E38A-9EC5                            /boot/efi
├─sda2 ext4         a11e2d42-980f-411f-9c73-dab5ff616804 /
└─sda3 swap         8827d90e-1afe-4832-b99b-ea74570c42e4 [SWAP]
sdb                                                      
└─sdb1 ext4         09e6b59d-ce4c-4f26-a606-5351c3daf769 /home
sr0 
I hope it's useful for you!
Mike365
Level 2
Level 2
Posts: 72
Joined: Wed Jul 02, 2014 7:02 pm

Re: Cannot Move Home Directory

Post by Mike365 »

Hi Wharfrat

Sorry but how do I mount the linux root partition to /mnt ?
WharfRat

Re: Cannot Move Home Directory

Post by WharfRat »

Mike365 wrote: Sat Jun 15, 2019 12:11 am Hi Wharfrat

Sorry but how do I mount the linux root partition to /mnt ?
Run sudo blkid|grep ext4 and the device will be the first field, e.g., /dev/sda3

Then sudo mount -v /dev/sda3 /mnt
Mike365
Level 2
Level 2
Posts: 72
Joined: Wed Jul 02, 2014 7:02 pm

Re: Cannot Move Home Directory

Post by Mike365 »

Hi Wharfrat
Here is the output of fstab
UUID=d26a90af-e4b6-4b82-b7dd-ab630722e4c2 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
Blkid output is:
sudo blkid
/dev/sda1: UUID="b3696d64-ab78-4aa0-a200-51441f4cf061" TYPE="ext4" PARTUUID="d47aea69-01"
/dev/sdb1: UUID="d26a90af-e4b6-4b82-b7dd-ab630722e4c2" TYPE="ext4" PARTUUID="6adb0e0c-01"
On my system the OS is on sdb1 and home folder is on sda1.

As I said before I have added the line sda1 to the fstab, saved and rebooted but it still doesn't like it.
WharfRat

Re: Cannot Move Home Directory

Post by WharfRat »

It would be a great help if you ran grep -v ^# /mnt/etc/fstab and pasted back the results.
Mike365
Level 2
Level 2
Posts: 72
Joined: Wed Jul 02, 2014 7:02 pm

Re: Cannot Move Home Directory

Post by Mike365 »

Below is the result of grep -v ^# /mnt/etc/fstab
UUID=d26a90af-e4b6-4b82-b7dd-ab630722e4c2 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
WharfRat

Re: Cannot Move Home Directory

Post by WharfRat »

Well, there ya go - it's trying to mount your intended new /home as /root :?

In the terminal xed admin:///mnt/etc/fstab and change d26a90af-e4b6-4b82-b7dd-ab630722e4c2 to b3696d64-ab78-4aa0-a200-51441f4cf061

Then reboot to the installed system.
Locked

Return to “Installation & Boot”