Hi all,
I've got an issue plaguing me at the moment that I'd appreciate some help with.
I have a system which was previously running Fedora 10, but now uses a Vanilla kernel 2.6.28.6. Everything works absolutely fine, and I've got no problems running the Vanilla kernel.
However, I have intermittent issues on boot, whereby the hard drive partitions are not correctly detected before /root is mounted. The system runs only SATA drives (1 HDD and 3 DVD+-RWs). The hard drive is partitioned into sda1(boot) sda2(swap) and sda3(data). LVMs are NOT in use. The SATA controller is a SiI3114.
Sequence of Events:
1) Boot the system normally n times, grub is run and the kernel is booted absolutely perfectly.
2) Reboot the system on the n+1th time, grub is run on the boot partition, and begins to do it's thing with the initrd image.
3) The init script fails on the line which mounts /dev/sda3 on /sysroot with the error:
mount: error mounting /dev/sda3 as ext3 on /sysroot: no such file or directory.
In the above, 'n' is a totally random number.
I've extracted my initrd image and hacked the init nash script. Using the "access" command, I can see that, on a failure, /dev/sda1, /dev/sda2 and /dev/sda3 are NOT present. A bit weird since /dev/sda1 is the boot partition that started the whole ball rolling.
I'd like to be able to reboot the system if my call to "access -f /dev/sda3" fails. Is this possible? I've tried copying the shutdown executable from /sbin to the initrd image sbin directory and rebuilding the image, but I get "Shutdown: unable to send message: Connection Refused" when that part of the init script is run.
I guess in a nutshell, what I'm asking is: How do I add an executable to my initrd image so that it's available from Nash on boot?
init script follows:
Code:
#!/bin/nash
mount -t proc /proc /proc
#setquiet
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/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/fb c 29 0
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
/lib/udev/console_init tty0
daemonize --ignore-missing /bin/plymouthd
plymouth --show-splash
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo Creating character device nodes.
mkchardevs
echo "Loading sata_sil module"
modprobe -q sata_sil
#modprobe scsi_wait_scan
#rmmod scsi_wait_scan
mkblkdevs
resume /dev/sda2
#echo Creating root device.
#mkrootdev -t ext3 -o defaults,ro /dev/sda3
#cond -ne 0 echo mkrootdev returned non-zero!
access -f /dev/sda1
cond -ne 0 echo Cannot find /dev/sda1
access -f /dev/sda2
cond -ne 0 echo Cannot find /dev/sda2
access -f /dev/sda3
cond -ne 0 echo Cannot find /dev/sda3
shutdown -r now
echo Mounting root filesystem.
#mount /sysroot
mount --ro -t ext3 /dev/sda3 /sysroot
cond -ne 0 plymouth --hide-splash
echo Setting up other filesystems.
setuproot
loadpolicy
plymouth --newroot=/sysroot
echo Switching to new root and running init.
switchroot
echo Booting has failed.
sleep -1
I know this is only a workaround, and the real issue is why the drives aren't detected, but this is an embedded app and the workaround will do until I can figure out what the heck is going on with my SATA drives.
TIA,
Beef