Hi,
I'm running Ubuntu on my laptop. To keep my data safe and easy disaster recovery as well I bought similar HDD to one installed in my laptop with higher capacity and using USB box I'm doing disk clone to it. So at any time I can replace disk and carry on with my work as before.
I'm trying to simplify this, automate it. My goal is:
- plug external USB disk and boot from it
- "one click" action to execute cloning, let it work.
- when done, unplug disk and reboot as normal.
I don't want to look for live CDs or use USB key linux installations to do this job everytime, I just want something that will reside on the same external disk, will boot up and do its job.
I tried something like this on virtual machine:
disk A: 300 MB disk, one primary partition, linux installation (DSL) (grub)
disk B: 1GB, actuall back up disk (USB)
I have created primary partition 4 on disk B of size 300MB at the end of the drive. Installed GRML linux on it and Grub as a boot manager. This is suppose to be backu up performing OS.
I've created shell script which does this:
- backup MBR of disk B
dd if=/dev/sdb of=bMBR bs=512 count=1
- backup MBR of disk A
dd if=/dev/sda of=aMBR bs=512 count=1
- clone disk A to disk B from possition 0
dd_rescue /dev/sda /dev/sdb
- restore disk B MBR so it can be used to backup next time again
dd of=/dev/sdb if=bMBR bs=512 count=1
when I wanted to use disk B as regular disk I copied back MBR of disk A.
dd of=/dev/sdb if=aMBR bs=512 count=1
and it shoudl boot up from disk B as it would from disk A, disk B should be regular clone of disk A.
I didn't get expected results.
In first case when disk B should have its original MBR, after cloning it does hang at boot time with black screen and GRUB written on top.
If I copy MBR of disk A to disk B and try to boot from disk B, boot manager seem to be ok but I get kernel panic message from DSL linux with no more info.
I'm not an expert in this field I just wanted to confirm with more experienced users whether I'm just missing something or going completely wrong route. So I won't spend ages of trying to fix something that can't work this way.
Is there anyone who can direct me or give me some clues?
Thanks