cloning drives + lilo questions
I realize reading a longer post of someone that is asking for help can be unpleasant. Those that take the time and try to understand my issues described below have my gratitude. I am fairly new to linux so please assume all of my attempts below maybe flawed. I would be happy to get feedback on a better way to accomplish my goal.
What I am trying to do.
I have a 160GB IDE hard drive attached to a PC-104 made by Diamond Systems (HELIOS). Slackware 13.7 is installed as the operating system. Partition setup:
1. 512MB SWAP
2. Everything else on remaining hd space.
Lilo is used as a boot loader and is installed to the MBR.
My goal is to transfer the whole system to a 32GB IDE flash drive.
Here is what I’ve done so far.
1. Shrunk the second partition on the 160GB hard drive down to 30GB
2. Used dd to copy the 160GB drive –> 32GB drive. dd fails somewhere in the empty space above the second partition. I am assuming this is ok as long as the partitions and the MBR are copied entirely. “dd if=/dev/sdh of=/dev/sdg bs=1M” When done dd reported the same in blocks as out blocks.
When viewed with fdisk & gparted, the partitions appear to be the same size as the partitions on the 160GB hard drive and can be mounted. The cloned system does not boot though. Right after turning on the PC-104 with the drive plugged in I get “L 80 80 ...” where the 80 repeats itself indefinitely. I am guessing I need to reinstall lilo so my next step was:
3. Try to re-install lilo
a. Attach the 32GB flash disk to another computer(actually a VMWare image with Ubuntu on it) running Ubuntu 11.04 via an IDE-USB adapter. The disk shows up as /dev/sdg
b. I mount it to a directory I created in /mnt called usbhd. “mount –t ext4 –o rw /dev/sdg /mnt/usbhd”
c. “chroot /mnt/usbhd”
d. Ok, this is where I am really lost. How do I run lilo to update the MBR? When I try running lilo (“/sbin/lilo”) without changing lilo.conf it overwrites my boot partition of the VMWare image (fortunately I created a copy of the linux vmware image just for this experiment). Perhaps this is because lilo.conf on the 32GB hard drive has boot & root set to /dev/sda & sda2, repectively, and this happens to be the hard drive designation of the vmware image. So, I tried changing lilo.conf boot & root to point to /dev/sdg & sdg2, respectively, and then ran /sbin/lilo again (on another vmware image copy of Ubuntu).
Am I on the right track? Anyone has any opinions on a better way to do this?
e. Now, when I attach the 32GB flash disk to the PC-104 and try to boot, lilo makes more progress but I get an error which stops the boot during the boot process.
VFS: Cannot open root device “342” or unknown-block(3,36)
Please append a correct “root=” boot option: here are the available partitions:
0000 31293440 sda driver: sd
0001 499952 sda1 0000(lots of zeros)...000sda1
0002 30793472 sda2 0000(lots of zeros)...000sda2
Kernel panic – not syncing: VFS: Unable to mount root fs on unknow-block(3,66)
Pid: 1, comm: swapper Not tainted 126.96.36.199 #2
... <more stuff here related to call trace>
I don’t know whether I am supposed to run lilo with lilo.conf configured to point to sdg & sdg2 or sda & sda2. It doesn’t seem to work when run on sda & sda2 but that is what the system will be when I unmount it and plug it into the PC-104. I am rather lost at this point. Any feedback/ideas/suggestions are greatly appreciated!