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 184.108.40.206. 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:
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
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
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
daemonize --ignore-missing /bin/plymouthd
echo Setting up hotplug.
echo Creating block device nodes.
echo Creating character device nodes.
echo "Loading sata_sil module"
modprobe -q sata_sil
#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 --ro -t ext3 /dev/sda3 /sysroot
cond -ne 0 plymouth --hide-splash
echo Setting up other filesystems.
echo Switching to new root and running init.
echo Booting has failed.
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.