LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making cloned disk bootable (https://www.linuxquestions.org/questions/linux-newbie-8/making-cloned-disk-bootable-642267/)

ogoy 05-14-2008 10:49 PM

Making cloned disk bootable
 
Hi, I recently cloned a hard disk (using dd) and mounted it on my host server. This is what it looks like:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 18662 149902483+ 83 Linux
/dev/sda2 18663 19457 6385837+ 5 Extended
/dev/sda5 18663 19457 6385806 82 Linux swap / Solaris

Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 9726 78124063+ 83 Linux

The device it is running on is /dev/sdb1, this is the cloned disk I want to make bootable, I'm planning to make it the primary hard disk and use the other hard disk as a slave instead.

Thanks for looking!

ogoy 05-14-2008 11:00 PM

Oh, this information might help, the disk is a direct clone of a working environment I wish to duplicate (It is a full disk image from the root down). It will serve as a remote running online backup of the original. I use LILO and here is the config:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
timeout=50
prompt
default=linux
image=/boot/vmlinuz-2.4.21-esoft.10
label=linux
read-only
root=/dev/hda7
initrd=/boot/initrd-2.4.21-esoft.10.img
append="panic=1"
image=/boot/vmlinuz-2.4.21-esoft.4
label=backup
read-only
root=/dev/hda7
initrd=/boot/initrd-2.4.21-esoft.4.img

mostlyharmless 05-16-2008 02:31 PM

Hi, I hope I can help.

Clarify something for me: You have 3 disks /dev/sda, /dev/sdb and /dev/hda? Or is /dev/sda the same as /dev/hda because you changed over to libata? /dev/sdb is a clone of /dev/sda using dd but is 1/2 the size? ...

Making a lot of assumptions, if both disks are still installed, I'd say, do something like this:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
timeout=50
prompt
default=linux
image=/boot/vmlinuz-2.4.21-esoft.10
label=linux
read-only
root=/dev/sdb1
initrd=/boot/initrd-2.4.21-esoft.10.img
with the MBR on /dev/hda booting the root partition on sdb. If you're going to switch the master and slave so that disk "b" is now "a", and the new disk is an exact clone, there should be no problem after you make the switch, without changing LILO or anything.

ogoy 05-18-2008 06:55 PM

hi! i switched device priorities and set the clone as the first device:

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 9726 78124063+ 83 Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 18662 149902483+ 83 Linux
/dev/sdb2 18663 19457 6385837+ 5 Extended
/dev/sdb5 18663 19457 6385806 82 Linux swap / Solaris

I have 2 hard disks, the clone being sda and the other disk sdb. Notice /dev/sda1 is not bootable, I've been trying for days to make that disk boot, to no avail :(

How would you approach this problem? I created a bootable usb pen drive using DSL (damn small linux) and wish to use that as a rescue disk if necessary. I've been googling for a howto on DSL as a rescue disk but come up with nothing, also the boot options dont give me anything about rescuing a disk. ugh!

mostlyharmless 05-19-2008 11:07 AM

Can't help you with the pen drive rescue disk and DSL.
I presume your system currently boots off of /dev/sdb1.
If your system doesn't boot anymore, I'd switch it back to the way it was when it did.

If you follow the directions here:
http://www.sanitarium.net/golug/rsync_backups.html,
you should be able to make a bootable copy in /dev/sda1 (or whatever the clone is called).

But I'm still not sure how you made your half size clone with dd or which disk /dev/hda is supposed to be in your lilo.conf. Where is LILO, by the way? In the MBR of the 80G disk or the 160G disk?

mostlyharmless 05-19-2008 05:37 PM

Found something, maybe you've seen before re DSL/pendrive:
http://www.pendrivelinux.com/index.php

ogoy 05-19-2008 07:14 PM

Hi! Yes I boot off /dev/sdb1 as /dev/sda1 is not bootable. To answer your question, /dev/sda1 is not a clone of /dev/sdb1, they are two totally different hard disks. What I did was stick in the clone in my old ubuntu environment (/dev/sdb1) and mounted it as /dev/sda1.

The rsync link is awesome thanks man :) The pendrive site yeah, thats where I got my DSL.

I might have to go the easy way and just chroot into the disk and run the stuff from there...


All times are GMT -5. The time now is 10:25 AM.