In Is a 40GB SSD practical to use for ' / ' Jorge describes how he symlinks things in his /home that would benefit from being on an SSD. How is this done?

I've figured that I need to do the following:

  1. Create a directory on the SSD to hold what I want to link from /home, e.g. mkdir /var/jorge.
  2. Move the things from /home that should be on the SSD, e.g. mv /home/jorge/.config /var/jorge.
  3. Create the symlinks, e.g. ln -s /var/jorge/.config /home/jorge/.config.

Is this the correct way to proceed? Do I need to do it from a live CD?

link|improve this question

feedback

1 Answer

up vote 4 down vote accepted

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:

  1. Switch to a virtual console and login
  2. 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

  3. 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 to sudo chmod 755 /media/ssd-store. You can check your umask setting by running umask (defaults to 0022)

  4. Change the ownership if needed, so the user can always create more symlinks if needed:

    sudo chown jorge: /media/ssd-store/home/jorge
    
  5. Move the files (add sudo if you do not own /media/ssd-store/home/jorge):

    mv /home/jorge/.config /media/ssd-store/home/jorge/
    
  6. 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
link|improve this answer
How do I know if I have a restrictive umask setting? – N.N. Jul 8 '11 at 9:46
Run umask, by default it's 0022 for which you do not need to run chmod – Lekensteyn Jul 8 '11 at 10:15
If I use sudo in step 5, should I also use it in step 6? – N.N. Jul 13 '11 at 21:31
1  
@NN: No, since you're creating a symlink in /home/jorge which is owned by you, you do not need root privileges. – Lekensteyn Jul 15 '11 at 10:38
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.