How do I symlink certain directories in /home to an SSD?
You can do it from a Live CD, but if you logout from a graphical session and switch to a virtual console using Ctrl + Alt + F1, you'll be able to move the folders too.
Your steps are correct, some expansion below:
- Switch to a virtual console and login
-
Mount the SSD if needed, that can be as easy as:
sudo mkdir /media/ssd-store sudo mount /dev/disk/by-label/YOUR-SSD-NAME /media/ssd-store
You can use tab-completion after
/dev/disk/by-label/
. This only works if your partition has a label, otherwise you need to replace it by/dev/sdXY
-
create a folder that holds the files from home:
sudo mkdir -p /media/ssd-store/home/jorge
If you've a custom umask setting like
0027
, you need tosudo chmod 755 /media/ssd-store
. You can check your umask setting by runningumask
(defaults to0022
) -
Change the ownership if needed, so the user can always create more symlinks if needed:
sudo chown jorge: /media/ssd-store/home/jorge
-
Move the files (add
sudo
if you do not own/media/ssd-store/home/jorge
):mv /home/jorge/.config /media/ssd-store/home/jorge/
-
Create the symlink:
ln -s /media/ssd-store/home/jorge/.config /home/jorge/
Notes on the above: you should add an entry in /etc/fstab
for automounting the SSD. Use sudo blkid
to determine the UUID for your SSD partition and add the next line to /etc/fstab
:
UUID=[uuid] /media/ssd-store ext4 relatime,errors=remount-ro,discard 0 2