0

I would like to move some directories that contain binaries to an SSD drive. How should I safely go about it?

  1. /usr
  2. /opt

Please consider safely emphasized.

[14.04.1]

matanster
  • 2,294
  • 9
  • 36
  • 54

1 Answers1

1
  1. Make a full system backup. (Read What's a good back-up strategy for 1 desktop PC? first)
  2. Make a full file back-up (Déjà-dup, BackInTime, rsync, ...)
  3. Boot the LiveCD of the Ubuntu version you're currently running
  4. Go to gparted, choose the SSD, create a partition 25% larger then the total size of /usr and /opt, format as ext4
  5. Get the blkid of the new partition
  6. Make an additional back-up only of the fstab file
  7. Edit the fstab of the system and add the correct mount parameters for the new partitions, but do not save yet!
  8. cp --force --preserve --recursive --verbose /dev/HDD/opt /dev/SSD/opt 2>>/tmp/copy_error.txt (and usr too of course\
  9. Verify there are no errors copying. If there are errors, correct manually.
  10. Rename the old /opt and /usr to /opt_old and /usr_old
  11. verify the copy with diff -r /dev/SSD/opt /dev/HDD/opt_old (and usr)
  12. Save fstab
  13. mount --all

If

(And that's a big if!)
  1. for any of the steps above you go "Huh? What's that?"
  2. you have an encrypted FS
  3. you have any other kind of non-standard non-plain non-Vanilla Ubuntu install

don't do it!

Voilà: That's the safest way!

Fabby
  • 34,341
  • 38
  • 97
  • 191
  • 1
    I am going to try this on a brave day! – matanster Jan 19 '15 at 13:48
  • 1
    Am I to take it that Ubuntu does not need to know through some configuration file, on which device to look for those directories, and it just sees them when it bootstraps, just because they are located on any mounted volume? – matanster Jan 19 '15 at 13:50
  • Read the [system back-up article](http://askubuntu.com/questions/569679/whats-a-good-back-up-strategy-for-1-desktop-pc)! (you're user type 4) – Fabby Jan 19 '15 at 13:50
  • 1
    You've been using Windows for too long! ;-) **Linux has no drive letters!** If something is mounted in the root, it's in the root! Done! – Fabby Jan 19 '15 at 13:51
  • I hope that's a compliment :) I can fix everything with a live DVD if it screws up for any reason. Backing up would take hours.. Yes you are right about the W word. – matanster Jan 19 '15 at 13:52
  • Chat? Ubuntu general room???? – Fabby Jan 19 '15 at 13:52