moving /home partition (howtogeek instructions)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
222fbj
Level 1
Level 1
Posts: 20
Joined: Wed Sep 24, 2014 2:36 pm

moving /home partition (howtogeek instructions)

Post by 222fbj »

I want to move /home from sda4 to sda1.
I am following instructions from HowtoGeek How to Create a Separate Home Partition After Installing Ubun. I have created the partition (sda1) and copied my /home to it. I have the blockid and the next step is '4. Modify fstab' I will modify fstab to use the new partition blockid for /home.

I stopped and wrote this post because I don't understand what happens next in step 5 with

Code: Select all

cd / && sudo mv /home /home_old && sudo mkdir /home
The instructions I am following are for moving /home to a partition - and I began thinking that might be different than what I am trying to do - move the /home partition.

Should I continue with Steps 4 and 5 (cd / && sudo mv /home /home_old && sudo mkdir /home) then reboot? thank you
gparted2x.jpg
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.
Desktop: MATE 1.26.0 wm: marco dm: LightDM
Linux Mint 20.3 Una base: Ubuntu 20.04 focal
Desktop ASRock model: H370M-ITX/ac
UEFI: American Megatrends v: P4.30 date: 12/18/2019
User avatar
slipstick
Level 6
Level 6
Posts: 1071
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: moving /home partition (howtogeek instructions)

Post by slipstick »

Yes, you need to do that. You have copied your /home files to sda1, so now you need to make a mountpoint named home in the / directory. This command renames the old /home directory to /home_old so that you can make a new directory /home as the mountpoint for your sda1 partition. The old /home directory could have been deleted instead of just renamed here, but it is safer to keep the files in it until you are sure everything is working right, then delete the /home_old and its files in the "Clean Up" step. The syntax of the command is to first change the working directory to /, then if that is successful, rename the /home directory, then if that is successful make the new /home directory.

EDIT: Ignore the above, I misunderstood what you are doing. I just noticed :oops: that you already have a separate partition for home, so what you are doing is different from the instructions you are following. You really just want to change /home from one partition to another, so after moving the files to sda1, you could just modify fstab to mount sda1 to /home instead of sda4, in which case you don't need to do that last step, just modify fstab and reboot.
Last edited by slipstick on Fri Mar 23, 2018 3:21 am, edited 4 times in total.
In theory, theory and practice are the same. In practice, they ain't.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: moving /home partition (howtogeek instructions)

Post by catweazel »

222fbj wrote: Fri Mar 23, 2018 1:39 am Should I continue with Steps 4 and 5 (cd / && sudo mv /home /home_old && sudo mkdir /home) then reboot? thank you
If you don't complete step 4 then your home partition won't mount. As for step 5, it seems rather obvious about what's next. If you've been following the tutorial without variation then you continue to follow it.
Step 5: Move Home Directory & Restart
From a terminal, run the following command to leave your home directory, move your current home directory to a placeholder location, and create a new, empty home directory which your new partition will be mounted at:
You need to perform step 5 so that the existing home directory is renamed to home_old. This is a safety precaution. You need a new /home directory to use as a mount point for your /home partition. This is vital.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Beginner Questions”