SUMMARY: recognizing a disk upon bootup

Date: Fri Sep 30 1994 - 02:36:19 CDT

Sun Managers:

Thanks to the 4 that responded to my inquiry they were
very helpful. Here is the original question:

> I have a RDI Sparc portable with 2 internal disk drives
> and a 3rd disk on a docking station. I'd like to
> take the portable on the road and leave the docking
> station. Is it possible to somehow have the portable
> determine if the 3rd disk is present and if it is, go
> ahead and mount it? Should I use automount to do this
> or some type of testing in /etc/rc* files? I'm
> running Sunos 4.1.3_U1.

From: (Peter Samuel)

mount will fail if it can't find the disk anyway.

If you're paranoid about it hanging, wrap the mount of that
particular disk in something like:

    if dkinfo sd2 > /dev/null 2&1
        mount /usr/local/stuff

If the dkinfo fails because the disk isn't there, it will never be

From: (Steve_Kilbane)

well, you could just mount all ufs disks (can't remember the
arguments on Solaris 1, sorry), having entered it in
/etc/fstab. Alternatively, in /etc/rc.local, have something like:

if [ df /dev/sd3c >/dev/null 2>&1 ]; then
        mount /dev/sd3c /mount_point
        echo "/mount_point mounted"

From: (Kathryn Fielding - Software)

There are probably a lot of ways to do this fairly quickly
and painlessly.

Just off the top of my head:

How about putting a script in /etc/rc.local which does a
dkinfo on the potentially missing disk, and based on the
results of that, tries to mount the disk (which of course
should already be listed in the /etc/fstab with the noauto


Automount works fine for us under 5.3 on SS10.
Just reports that it can't find the disk when it's not there.
I doubt there is any significant difference in automount on
4.x and 5.x



Since we're SunOS 4.1.3_U1, I decided to go ahead with the 3rd
solution and with a bit of tweaking this what I got to work. Note
too that if the disk isn't there (i.e., the portable is not plugged
into the docking station) then an error message occurs that still
says the disk was mounted even though it was not. my understanding
of Bourne shell error codes is not extensive enough though and so I
ignored it:

(from /etc/rc.local on the portable)

intr -a mount -vat nfs

# try to mount disk in docking station (if plugged into dock)
echo -n "Checking for docking station disk: "
if [ {`df /dev/sd3c >/dev/null 2>&1`} ]; then
        mount -t 4.2 -o rw /dev/sd3c /home/dock
        echo "/home/dock mounted."
        echo "/home/dock NOT mounted."

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:10 CDT