in the thread<br>"boot from backup copy of fc5 on usb external disk?"<br>i described my initial problems and final success<br> <br>Here I comment on the differences between kubuntu,fedora initrd <br><br>I had success using two different kernel,initrd<br>
1) obtained from a kubuntu install<br>stanza in grub.conf:<br>title FC5copy (2.6.15-26-386) usbfc5 /media/disk-1 (hd1,2)sdb3 rootusb<br> root (hd1,2) ## sdb3<br> kernel /boot/vmlinuz-2.6.15-26-386 ro root=LABEL=rootusb rhgb quiet<br>
initrd /boot/initrd.img-2.6.15-26-386<br><br>This worked without any modifications on my part of the initrd init script<br>Moreover the disks were _not_ reordered<br><br>2)using my mainfc5 <br>stanza in grub.conf:<br>
title FC5copy (2.6.17-1.2174_FC5_usbrs4.sdb2sw.img) /media/disk-1 (hd1,2) <br> root (hd1,2) ## sdb3<br> kernel /boot/vmlinuz-2.6.17-1.2174_FC5 ro root=LABEL=rootusb rhgb quiet<br> initrd /boot/initrd_usbrs4.sdb2sw.img<br>
<br>This also worked, but here I had to make modification of initrd init script<br> both on "resume /dev/sdxx" <br>and on "mkrootdev -t reiserfs -o defaults,ro /dev/sdc1"<br><br>And here the disks _were_ reordered. <br>
usb originally sdc -> now sda<br> first scsi originally sda now sdb<br> second scsi originally sdb, now sdc<br>This reordering caused me much confusion almost to the point where <br>I was going to give up.<br><br>So, the kubuntu kernel,initrd worked with minimum of fuss<br>
the fedora kernel,initrd rqrd days of effort, confusion<br> (in part bc of my perpetual noobie status)<br><br>Aside from the different results just noted<br>my additional point here is that the <br>initrd init files are almost completely different in the two cases.<br>
<br>case 2) fedora initrd-2.6.17-1.2174_FC5 (modified toinitrd_usbrs4.sdb2sw.img)<br>[root@bootp cleanrs3]# tail init<br>mkblkdevs<br>resume /dev/sdb2<br>echo Creating root device.<br>mkrootdev -t reiserfs -o defaults,ro /dev/sdc1<br>
echo Mounting root filesystem.<br>mount /sysroot<br>echo Setting up other filesystems.<br>setuproot<br>echo Switching to new root and running init.<br>switchroot<br><br>case 1) kubuntu: initrd.img-2.6.15-26-386<br>here the script is quite long; I will list the whole thing at the end.<br>
I am not competent enough to try and edit this init; <br>as noted above, I didnt have to, it just worked.<br>This init has none of the fedora init structure<br>no use at all of <br>mkrootdev, sysroot, switchroot<br><br>googling "could not find /dev/root" gives a lot of msgs over<br>
the past few years, all failing sysroot, switchroot, <br>and ending in kernel panic,<br> mostly from redhat,fedora users. <br>I dont think I saw even one from ubuntu users--<br>that now is no surprise bc the ubuntu init file does its thing<br>
in a different way.<br><br>Here is the init file from initrd.img-2.6.15-26-386<br>I would be interested in comments as to what it is doing;<br>and especially if anyone knows how it avoids reordering the disks.<br><br>[root@bootp clean386]# cat init<br>
#!/bin/sh<br><br>mkdir /sys<br>mkdir /proc<br>mkdir /tmp<br>mkdir -p /var/lock<br>mount -t sysfs none /sys<br>mount -t proc none /proc<br><br># Note that this only becomes /dev on the real filesystem if udev's scripts<br>
# are used; which they will be, but it's worth pointing out<br>mount -t tmpfs -o mode=0755 udev /dev<br>touch /dev/.initramfs-tools<br>mkdir /dev/.initramfs<br>mknod /dev/console c 5 1 <br>mknod /dev/null c 1 3<br><br>
# Export the dpkg architecture<br>export DPKG_ARCH=<br>. /conf/arch.conf<br><br># Bring in the main config<br>. /conf/initramfs.conf<br>for i in conf/conf.d/*; do<br> [ -f ${i} ] && . ${i}<br>done<br>. /scripts/functions<br>
<br># Parse command line options<br>export break=<br>export init=/sbin/init<br>export quiet=n<br>export readonly=y<br>export ROOT=<br>export resume=${RESUME}<br>export rootmnt=/root<br>export debug=<br>for x in $(cat /proc/cmdline); do<br>
case $x in<br> init=*)<br> init=${x#init=}<br> ;;<br> root=*)<br> ROOT=${x#root=}<br> case $ROOT in<br> LABEL=*)<br> ROOT="/dev/disk/by-label/${ROOT#LABEL=}"<br>
;;<br> UUID=*)<br> ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"<br> ;;<br> esac<br> ;;<br> nfsroot=*)<br>
NFSROOT=${x#nfsroot=}<br> ;;<br> boot=*)<br><br> BOOT=${x#boot=}<br> ;;<br> resume=*)<br> resume=${x#resume=}<br> ;;<br>
quiet)<br> quiet=y<br> ;;<br> ro)<br> readonly=y<br> ;;<br> rw)<br> readonly=n<br> ;;<br> debug)<br> debug=y<br>
exec >/tmp/initramfs.debug 2>&1<br> set -x<br> ;;<br> break=*)<br> break=${x#break=}<br> ;;<br> break)<br> break=premount<br>
;;<br> esac<br>done<br><br>depmod -a<br>maybe_break top<br><br># Don't do log messages here to avoid confusing usplash<br>run_scripts /scripts/init-top<br><br>. /scripts/${BOOT}<br>parse_numeric ${ROOT}<br>
<br>maybe_break modules<br>log_begin_msg "Loading essential drivers..."<br>load_modules<br>log_end_msg<br><br>maybe_break premount<br>[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"<br>
run_scripts /scripts/init-premount<br>[ "$quiet" != "y" ] && log_end_msg<br><br>maybe_break mount<br>log_begin_msg "Mounting root file system..."<br>mountroot<br>log_end_msg<br><br>maybe_break bottom<br>
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"<br>run_scripts /scripts/init-bottom<br>[ "$quiet" != "y" ] && log_end_msg<br><br># Move virtual filesystems over to the real filesystem<br>
mount -n -o move /sys ${rootmnt}/sys<br>mount -n -o move /proc ${rootmnt}/proc<br><br>while [ ! -x ${rootmnt}${init} ]; do<br> panic "Target filesystem doesn't have ${init}"<br>done<br><br>maybe_break init<br>
<br># Unset the problematic debug variable and chain to real filesystem<br>unset debug<br>exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console<br>[root@bootp clean386]# <br>
<br><br>regards,<br>Jack<br>