Re: priority on /dev/sda4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 19, 2004 at 04:22:16PM +0100, Marc Dobler wrote:
> does it mean that the loading priority depends on the list in /etc/fstab ? 
> if so, when i already have a HD on /dev/sda, the zip will come on /dev/sdb4 ?
> or should i invert the order of loading in fstab ( first zip and then HD ) ? 

No, fstab is used by userland (mount, etc), not the kernel.

Try this: (there's probably a better way, but as long as it works...)

1. Add to the end of /etc/hotplug/scsi.agent the following two lines:
/sbin/findziphdd &
exit 0

2. create the file /sbin/findziphdd by c&p the following lines in a console,
as root:
cat <<"EOF" > /sbin/findziphdd
#! /bin/sh
exec 2> /dev/null
                                                                                
function readable {
        : < /dev/$1
}
                                                                                
PEN=
ZIP=
HDD=
for dev in sda sdb sdc sdd sde sdf
do
        readable ${dev} || break
        if readable ${dev}1 && readable ${dev}2
        then
                HDD=${dev}
        elif readable ${dev}1
        then
                PEN=${dev}1
        elif readable ${dev}4
        then
                ZIP=${dev}4
        fi
done
                                                                                
[ "$ZIP" ] && ln -fs $ZIP /dev/zip || rm -f /dev/zip
[ "$PEN" ] && ln -fs $PEN /dev/pen || rm -f /dev/pen
rm -f /dev/usbdisc*
if [ "$HDD" ]
then
        readable ${HDD}1 && ln -fs ${HDD}1 /dev/usbdisc1
        readable ${HDD}2 && ln -fs ${HDD}2 /dev/usbdisc2
        readable ${HDD}3 && ln -fs ${HDD}3 /dev/usbdisc3
        readable ${HDD}4 && ln -fs ${HDD}4 /dev/usbdisc4
        for ((i=5; ; i++))
        do
                readable ${HDD}${i} || break
                ln -fs ${HDD}${i} /dev/usbdisc$i
        done
fi
exit 0
EOF

3. turn it executable
chmod +x /sbin/findziphdd

4. change fstab entry for the usb disc, zip (and optionally a pen) to use
the following paths as device:
   - usb disc: /dev/usbdisc1 .. /dev/usbdisc10 (the last partition on disc)
   - zip: /dev/zip
   - pen: /dev/pen

5. Try it out :)

Regards,
Luciano Rocha



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux