Meanie,
could you help me please because I tried so many things without success!
Where should I put in your code to bind it automatically?
Thanks
climber
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155822\"][{POST_SNAPBACK}][/a][/div]
Hi Climber,
because I also did a similar thing recently, I can tell you:
Put this into a script called /etc/rc.d/init.d/mountbind:
#!/bin/sh
. /etc/rc.d/init.d/functions
COUNTER=0
case "$1" in
start)
while [ ! -d /mnt/ide2/home ]; do
sleep 1
COUNTER=$[$COUNTER+1]
if [ $COUNTER -gt 45 ]; then
echo /mnt/ide2/home does not become available!
echo Cannot bind /home!
echo Please try removing any CF cards and reboot.
echo Or did /mnt/ide2/home get deleted or corrupted?
action "Binding home from HDD:" mount --bind /mnt/ide2/home /home
exit 1
fi
done
action "Binding home from HDD:" mount --bind /mnt/ide2/home /home
;;
stop)
;;
esac
exit 0
As you see, this uses the same looped detection mechanism as I suggested for your swap issue in z-portal.info. :-)
In fact, this is the problem what I used that for initially.
Once more for the OESF people:
Sometimes, the devices (SD or CD cards) don't get available quickly enough in order to let subsequent rc scripts use the devices.
For example, when there is a CF WLAN card inserted, the microdrive initialization is so slow, that a script liek the one above, albeit executed as the last script in the rc sequence, cannot access the microdrive.
Hence the need for that loop.
It checks each second if the directory (and hence the device) in question is available and only THEN runs the actual action.
Why two occurrecnces of the action? The purpose is that the user gets the red "FAILED" message in the timeout case.
Of course, one could leave away the "exit 1" instead and make te script even more elegant with an error state variable and conditional exit value at the end... :-)
Oh, and link this script to rcX.d (X=1..5) as "S60mountbind".
Otherwise it won't be executed ;-)
Also, be sure to make the script executable.
daniel