LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-12-2014, 07:36 PM   #1
AirLinux
LQ Newbie
 
Registered: Dec 2014
Location: Atlanta, GA
Distribution: Red Hat
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 01-11-2015, 03:38 PM   #2
AirLinux
LQ Newbie
 
Registered: Dec 2014
Location: Atlanta, GA
Distribution: Red Hat
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.

Last edited by AirLinux; 01-11-2015 at 03:43 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: GLX-Dock (Cairo Dock) 2.3 Beta Gets MintMenu, Cardapio Applets, Many Other Improvements LXer Syndicated Linux News 0 01-23-2011 12:41 PM
LXer: Cairo Dock 2.0.0 is Here (Linux Dock Menu)! LXer Syndicated Linux News 0 05-12-2009 01:20 AM
LXer: Cairo-Dock - Desktop dock for openSUSE Linux LXer Syndicated Linux News 0 08-07-2008 08:20 AM
cairo-dock, gnome-dock, kiba-dock?? LinuxNewbie999 *BSD 0 04-03-2008 09:16 AM
Is there a good Linux equivalent to Yz Dock/Stardock/The OSX dock? EOHooligan Linux - General 1 09-19-2005 06:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration