#relocating home on active machine

51 messages · Page 1 of 1 (latest)

wind jackal
#

How best to migrate /home to a new place on a new drive from ACTIVE system? Will the following work well enough?

rsync /home /media/home
rm -fr /home
mount /dev/"media-home"

From outside system correct? I just want to ensure this is best. or if I can do it even ON active booted machine from ROOT account!

twin whaleBOT
#

rsync needs additional parameters

Deane-C64 ↩️

[Reply to:](#1236013348311531670 message) How best to migrate /home to a new place on a new drive from ACTIVE system? Will the following work …

#

-arxvh or something

#

And yes you can do it on running system

wind jackal
#

🙂

twin whaleBOT
#

to ensure the ownership is preserved

Valiant @ Namsis ↩️

[Reply to:](#1236013348311531670 message) -arxvh or something

wind jackal
#

OH

#

Gotcha.

twin whaleBOT
#

But to get rid of /home you'll need to be in emergency mode

wind jackal
#

How do you enter that and exit that?

twin whaleBOT
#

are you using systemd

Deane-C64 ↩️

[Reply to:](#1236013348311531670 message) How do you enter that and exit that?

#

if so, just run systemctl start emergency.target

#

you need to be on SysV run level 1

#

or its equivalent (emergency.target for systemd)

wind jackal
#

systemd not found

twin whaleBOT
#

init 1

wind jackal
#

So I can do this in GUI correct?

twin whaleBOT
#

You need to be in single-user mode to be more specific
to ensure that you don't mount /home

#

No

Deane-C64 ↩️

[Reply to:](#1236013348311531670 message) So I can do this in GUI correct?

#

You should first do the rsync

#

Then edit fstab

#

but to get rid of /home (so you can declare what it'll be populated with) you need it to be unused

#

You can do that on emergency mode or while only root is logged in

#

Since root's home is at /root

#

So basically you need to ensure no user whose home directory is in /home is logged in

#

so it's safe to wipe it

#

So log out everyone and on a tty log in as root

wind jackal
#

I got it. and here we go

twin whaleBOT
#

Then like I said you edit fstab

wind jackal
#

rsync

#

is doing its thing.

#

Gonna free up so much space now.

#

Gonna also create a Steam library in /usr/games

twin whaleBOT
#

Log out everyone

#

log in as root

#

then edit fstab to automatically mount the new home at /home

#

I actually like home in /var/home and tmp in /var/tmp

#

but for backwards compat I symlink them to their fhs equivalents

wind jackal
#

I'm used to /home

#

been that way forever

#

I messed up. putting / made it put home inside the drive instead of put users directory into the drive.

#

/run/media/deane/HOME/ was how I put it if I left out the / I'd have done the users directory me thinks.

twin whaleBOT
#

Mhm

#

So what's the layout of the drive

wind jackal
#

it goes /run/media/deane/HOME/home/users

#

and finished finally

twin whaleBOT
#

Hmm

wind jackal
#

rm -fr /run/media/deane/HOME/home? and remove trailing / this time in the rsync?

#

or mv users to root of drive?

#

mv is best

#

Ok Logout/exit GUI.
Login root from TTY.
init 1 if NOT on Systemd. if on Systemd systemctl start emergency.target
Edit Fstab to add the drive
rm -fr /home/*
mount drive to /home
Reboot