Booting from EZ-Dock
I have a harddrive with a working and bootable version of Red Hat 5 but
I installed a new, bigger drive and put Red Hat 6 on it. I also have a harddrive with Ubuntu on it. Both these drives are internal, sda and sdb. But I also want to be able to boot into my old Red Hat 5, so I bought an EZ-Dock which attaches via usb. I can mount it from both RH-6 and Ubuntu as sdc. In order to boot it from grub-legacy on RH-6, I added the root command as (hd2,0), the kernel command and initrd as on the boot partition of the RH-5 disk. However I modified the initrd to use UUID's and created a UUID for the swap partition. I re-insert the RH-5 drive back in the computer and successfully boot from it. Trying to boot it in the EZ-Dock goes through the correct first steps (a message I inserted in the initrd shows) but then hangs with "unable to access the resume device" and shows the correct UUID, continuing, it then stops cold with the message "mount: could not find /dev/root". I then tried to create a grub-2 config file on the Ubuntu drive, with the EZ-Dock device and running, by the "update-grub" command. Things looked hopeful as it found the RH-6 drive and RH-5 onthe EZ-Dock drive (as /dev/sdc) and created a grub.cfg. But trying to boot from it met exactly the same fate. Note that I can create a bootable linux thumb drive on a usb port. Conjectures: (1) I initially thought there was no usb kernel module in the initrd under grub-legacy but clearly that is not the case with grub-2, (2) maybe the vmlinuz on the RH-5 drive cannot operate from the usb as /dev/sdc although it does not seem to get this far. Thanks for any ideas or help. |
I solved this myself as follows. The (last) problem was that the initrd did not have
a usb-storage module and thus the usb device could not be read. As a consequence the resume device could not be accessed nor could /dev/root be set up. I found some web sites that told how to extract an initrd image; it is a gzip file made of a cpio archive, for example: gzip -cd /1/initrd-2.6.18-164.el5.img | cpio -id The directory thus created has subdirectories such as bin, lib, sbin and others. It also has an executable script named init (bin and sbin have the program called nash that executes it (at least on a Red Hat system)). The subdirectory lib contains the modules as .ko files. I found the usb-storage module in /lib/modules/`uname -r`/kernel/drivers/usb/storage and copied it to the lib subdirectory as above. I then add lines to init to load the module, echo Loading usb-storage.ko insmod /lib/usb-storage.ko The web site www.opennet.ru/docs/HOWTO/kernel-HOWTO-22/html was very helpful on this point. As mentioned in the original post, I converted the disk references in init to UUID format, e.g mkrootdev -t ext3 -o defaults,ro UUID=cca1fec5-9841-41d7-820b-5e8924a095ec One then has to repack, still within the (new) initrd directory find . | cpio -H newc -o > ../initrd-newname.cpio then cd .. and cat initrd-newname.cpio | gzip > initrd-newname.img Of course move the new initrd to boot sector of the usb drive and make the corresponding change in the grub.conf file (the one pointed to by the MBR). Although there were no posts on this problem, I thank those who looked at it and gave it some thought. |
All times are GMT -5. The time now is 01:08 PM. |