Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a working server running CentOS 5.5 (similar to RedHat EL) with the 2.6.18-194.el5 kernel. The hardware is a few years old, but we were able to accomplish this following goal using CentOS 4.4. What I'm trying to do is to back the system up to an external USB hard drive such that it can be booted from for recovery or to then take that drive and restore its contents to a second server with identical hardware. We have been successful implementing this on other server pairs, but I'm having a great deal of trouble getting this to work on this hardware and OS. I'm not using LVM or dual-booting with another OS.
The USB drive is set up with identical partitions to the RAID set, and all the files have been successfully copied over, but I can't get the system to boot from it. Below is what I get when trying to boot from the USB drive:
Code:
Booting 'CentOS (2.6.18-194.el5)'
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/
Error 13: Invalid or unsupported executable format
Press any key to continue...
I saw that the 'root=LABEL=/' is wrong for the USB drive, so I entered the menu and edited that entry to read 'root=LABEL=/root-backup' and tried again, but got the same results.
Here are the config files and details:
The RAID set is on /dev/i2o/hda.
The USB drive is /dev/sda.
I used the Boot Info Script (http://sourceforge.net/projects/bootinfoscript/) to provide some helpful info for troubleshooting. Everything looks right to me, but I don't have a lot of experience with grub. Here are the script's results:
I'm still having no luck with booting from the USB drive, however, something that has been done in the past was to create a boot floppy with grub installed on it that would then boot from the USB drive. I've made an attempt or two at this, but I'm not getting anywhere. It seems to still be trying to boot from the RAID set, yet fails even that.
Can anyone give me some pointers on properly configuring grub for the floppy to load the OS on the USB drive?
I've gotten to a point booting from the USB drive, and it fails. Here is the last bit of activity from the screen:
Code:
Scanning and configuring dmraid supported devices
Trying to resume from LABEL=SWAP-i2o/hda5
No suspend signature on swap, not resuming.
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: moving /proc failed: No such file or directory
setuproot: moving /sys failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
First off, it looks like "LABEL=SWAP-i2o/hda5" is incorrect - I'm not wanting to involve the RAID set when booting from USB, so somehow this is wrong, yet it's not the main problem.
For whatever reason, it can't find the root partition on the USB drive, so it freaks out. After many attempts to configure grub, fstab and other files, I can't train it to boot properly.
I'm trying to use this as a method to build a boot floppy to then start the boot process on the USB drive.
I've gotten a little (?) further, I think, but it still fails. This opens up a few more avenues to explore. I never knew that the initrd file could be de-constructed and reconfigured, so that helped a bit, but the only thing that changed from the previous result is choosing the correct swap label (however, it couldn't find it). Below is my current init file so far:
Code:
#!/bin/nash
setquiet
echo Preparing to boot from USB drive...
mount -t proc /proc /proc
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/urandom c 1 9
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "*** Loading usb-storage ***"
insmod /lib/usb-storage.ko
echo "Loading ehci-hcd.ko module"
insmod /lib/ehci-hcd.ko
echo "Loading ohci-hcd.ko module"
insmod /lib/ohci-hcd.ko
echo "Loading uhci-hcd.ko module"
insmod /lib/uhci-hcd.ko
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "*** Sleeping 5 seconds ***"
/bin/sleep 5
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading i2o_core.ko module"
insmod /lib/i2o_core.ko
echo "Loading i2o_block.ko module"
insmod /lib/i2o_block.ko
echo "Loading dm-mem-cache.ko module"
insmod /lib/dm-mem-cache.ko
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-log.ko module"
insmod /lib/dm-log.ko
echo "Loading dm-region_hash.ko module"
insmod /lib/dm-region_hash.ko
echo "Loading dm-message.ko module"
insmod /lib/dm-message.ko
echo "Loading dm-raid45.ko module"
insmod /lib/dm-raid45.ko
mkblkdevs
echo Scanning and configuring dmraid supported devices
resume LABEL=SWAP-backup
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro sda6
echo "*** Reread partition table ***"
/sbin/sfdisk -R /dev/sda
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot
Any ideas on why it still can't find my root partition in the USB drive?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.