Edit: doing this has slowed down the computer. I don’t recommend it. I’m going to revert the changes.

I would like to move all the content of my home folder to an external drive to preserve the SSD from too many reads and writes when downloading stuff. Would it be safe to just move everything to /mnt/T/home and symlink with ln -s /mnt/T/home /home/user? The hard drive is configured to mount on system startup. I don’t know if this would generate issues with any program that may refuse to follow symlinks.

Maybe it’s safer to create a home partition and move it?

You could move your home directory and then change the path of your user’s home directory:

usermod --home /mnt/T/home user

Alternatively you could move your home directory to a partition of your external drive and mount it at /home/user. This can be achieved automatically by adding an entry to the /etc/fstab file (assuming /dev/sdb1 is the partition of your external drive with an ext4 file system, adjust to your needs):

/dev/sdb1  /home/user  ext4  defaults  0  1

After saving the file, either reboot or mount the file system using mount /home/user.

See fstab(5) for more mount options.

@OptimusPrime@lemmy.ml
creator
link
fedilink
1
edit-2
2M

How would I run the usermod command while I keep getting the error user is currently used by process?

Something like?

nohup ps -ef | grep user | awk '{ print $2 }' | sudo xargs kill -9; sleep 2; usermod --home /mnt/T/home user

I used pkill -KILL -u user and then I could use the usermod command.

Edit: the first solution above ended up giving me some trouble. I ended up following this solution.

Easiest way is probably to log in as a different user to perform the changes.

Linux Admin
!linux

    Ask specific questions about how to do something with linux

    General linux discussion on lemmy.ml

    Create Post From:
    lemmy.ml

    Community icon by Alpár-Etele Méder,
    licensed under CC BY 3.0

    • 0 users online
    • 2 users / day
    • 3 users / week
    • 3 users / month
    • 8 users / 6 months
    • 37 subscribers
    • 8 Posts
    • 13 Comments
    • Modlog