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]

matanox
  • 2,293

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,259