I have a system running as a server that has a failing harddrive. While all important data is on a RAID and backed up and all that, I don't have an image of the system itself. There is no specific need as I can do the install of course, but I still want to try to do a hotcopy first before just going down the restore path. I know there are some downsides to this as a process, but there I don't think there are much downsides to trying it as a first resort.
- OS: Ubuntu 12.04.4 LTS
- Headless
- I'm not hoping to install too much new software as the disk is allready failing :)
- The system is running. I'm scared stopping it increases the chance of the disk not comming back up. This means dd might be out?
- The new disk is not the same size (it's twice as big) as the old one further complicating the dd issue.
My idea was to
- hotplug the new drive in the system
- make a filesystem
- mount it in /mnt/somedir
- rsync the files
- some fstab magic
- some booting magic
The questions I still have are:
What would be a good rsync command? I was planning on:
rsync -aAXx / /mnt/somedir/
--exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
(I'm skipping some more dir's, e.g. my mounted raid's etc)
Where the options are:
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-A, --acls preserve ACLs (implies -p)
-X, --xattrs preserve extended attributes
-x, --one-file-system don't cross filesystem boundaries
I'm specifically skipping -H, -v and --progress to speed up the process.
Would that work for Ubuntu? I'm not sure if Ubuntu uses any hardlinks, but I don't think I need the option, do I ?
After this run I could reboot (maybe with a live usb drive) and re-run the rsync if the old disk still starts. This would fix any non-readable/changed files because the system was running I suppose.
How to fix booting?
Then my plan would be to change the UUID for /
in my fstab (still have to google how to find the uuid), and do some magic so the system actually boots from the new disk
Have I forgotten something or have I planned something specifically stupid?