You are not logged in.

#1 2019-09-07 22:47:03

BitterCelt
Member
Registered: 2017-02-08
Posts: 23

forgot to mount /home to second drive [Solved]

Ok so I've dun goofed. After doing a reinstall to try and deal with a problem with lspci - which turned out to be fixed with some kernel flags, I've been setting up the system with little to no problems, but I've just realised that I neglected to mount /home to my hard drive, so I'm sitting with 1TB of dead space doing nothing. My question: can I post install remount /home to the other drive or am I gonna have to do a fresh install? Thx

Last edited by BitterCelt (2019-09-07 23:07:00)

Offline

#2 2019-09-07 22:50:59

loqs
Member
Registered: 2014-03-06
Posts: 19,100

Re: forgot to mount /home to second drive [Solved]

You can certainly mount it without needing a reinstall.
If there is any contents under the current /home that would need to be moved to the new /home while it is mounted at a different mount point first.
I recommend doing this with all none root users logged out.

Offline

#3 2019-09-07 23:06:38

BitterCelt
Member
Registered: 2017-02-08
Posts: 23

Re: forgot to mount /home to second drive [Solved]

Cool, that makes sense. Thanks

Offline

#4 2019-09-07 23:12:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,529
Website

Re: forgot to mount /home to second drive [Solved]

You may want to be sure to clear out anything under /home on the root partition.  If you copy (rather than move) the contents it will still take up space on the root partition even though it'd be masked and inaccessible.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-09-08 00:22:50

Swiggles
Member
Registered: 2014-08-02
Posts: 266

Re: forgot to mount /home to second drive [Solved]

It's easy to migrate your home to another place, so reinstalling would be a huge waste of time. Make sure to logout all users and use root for the following steps:

# Let's assume you have set up your new home drive with a partition and a file system
# if not please refer to the installation guide
# Let's assume it is /dev/sdb1 for this exercise, replace it with your partition

mkdir /mnt/home
mount /dev/sdb1 /mnt/home

cp -a /home/* /mnt/home
# Check if everything looks fine in /mnt/home permissions, ownership etc should be retained
ls -al /mnt/home/*

# if everything is looking good
umount /mnt/home
rm -r /home/* /mnt/home

# edit fstab in some way to reference this new home, example:
echo "/dev/sdb1    /home    ext4    rw,relatime    0    2" >> /etc/fstab

# Or use the UUID instead
eval `blkid -o export /dev/sdb1`
echo "UUID=${UUID}    /home    ${TYPE}    rw,relatime    0    2" >> /etc/fstab
unset UUID TYPE DEVNAME

# Apply the new config
mount -a

That's it, login with a regular user. You should be able to use your new home right away and persist between reboots.

Last edited by Swiggles (2019-09-08 00:23:39)

Offline

Board footer

Powered by FluxBB