Moving Home directory back to Root partition

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
grxgghxrpxr
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 6:36 pm

Moving Home directory back to Root partition

Post by grxgghxrpxr »

Hello.

I'm trying to move my Home directory back to my Root partition.
I'm mostly having success.

What I've done is:
sudo mkdir /mnt/tmp
‘sudo mount /dev/sda1 /mnt/tmp’ (Root)
‘sudo mkdir /mnt/home’.
‘sudo mount /dev/sdb1 /mnt/home’
‘sudo cp -rp /mnt/home/* /mnt/tmp/’ OR ‘sudo cp -rp /mnt/home/* /mnt/tmp/home/’

When I copy to just /mnt/tmp, it moves all my files to the Root directory, but when I copy to /mnt/tmp/home, it creates another folder in Home called Home, meaning it doesn't work either way. How can I do this successfully?

Thanks
Gregg
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.
User avatar
AndyMH
Level 21
Level 21
Posts: 13716
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving Home directory back to Root partition

Post by AndyMH »

Boot a live session (your mint install media) and copy everything from your existing /home partition to the /home folder on your existing / partition. Then edit fstab to remove the entry pointing at your home partition.

Why are you doing this, seems a retrograde step to me?

Take a backup before you start.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
grxgghxrpxr
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 6:36 pm

Re: Moving Home directory back to Root partition

Post by grxgghxrpxr »

AndyMH wrote: Wed Jun 16, 2021 4:55 am Boot a live session (your mint install media) and copy everything from your existing /home partition to the /home folder on your existing / partition. Then edit fstab to remove the entry pointing at your home partition.

Why are you doing this, seems a retrograde step to me?

Take a backup before you start.
Thank you for this. What would be the best way of copying in terms of what command should I enter?

This might sound strange, but I'm just experimenting in a virtual machine to find out how to do this.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Moving Home directory back to Root partition

Post by Flemur »

grxgghxrpxr wrote: Thu Jun 17, 2021 6:24 pmThank you for this. What would be the best way of copying in terms of what command should I enter?
Running from the live USB:

Code: Select all

cp -ax /whatever/username /home/.
/whatever/username = where your $HOME (=/home/username) is located on the not-OS partition
/home/. = the location on the OS partition which will become /home when you boot.

-ax = copy and preserve ownership, etc, and copy links as links.

If you copy from /whatever/username/*, you'll miss the "." files; the easy way is to copy the entire username directory.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
grxgghxrpxr
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 6:36 pm

Re: Moving Home directory back to Root partition

Post by grxgghxrpxr »

Thank you so much! This worked, I was able to do this using a TTY prompt, rather than bootable media.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Moving Home directory back to Root partition

Post by Termy »

I guess the takeaway here is that if an alternative '/home' location is not provided, it defaults to '/home/your_username', if available; I actually didn't know that, as I've never done it that way around before. I've done the same as you, but the other way around, and on hardware. It's pretty smooth sailing, really. I love that Linux gives you the option to do all these cool things; it's so flexible!
I'm also Terminalforlife on GitHub.
Locked

Return to “Other topics”