[comp.sys.next] Mounting the optical disk from a terminal other than console

murphy@maxwell.physics.purdue.edu (William J. Murphy) (08/04/90)

Do any of you NeXT gurus know how to mount the optical disk from a
terminal other than the console?  I use the NeXT mostly from an
ethernet link to a PC running telnet. 8-(  I would like to tell
the NeXT to unmount the current opti disk and mount a second without
having to using the menu options in the Browser.

Thanks for any info,
Bill Murphy                                  | Turtle Schmurtle, I'm the
murphy@gibbs.physics.purdue.edu              | Rabbit.
Amiga, it's not a religion, it's a lifestyle | B. Bunny

dastrout@miavx1.acs.muohio.edu (root@next1) (08/04/90)

> Do any of you NeXT gurus know how to mount the optical disk from a
> terminal other than the console?  I use the NeXT mostly from an
> ethernet link to a PC running telnet. 8-(  I would like to tell
> the NeXT to unmount the current opti disk and mount a second without
> having to using the menu options in the Browser.
> Thanks for any info,

Provided you have two optical drives, it's simple.  From the command line, as
root, say umount /dev/od0a to unmount the first disk, and mount /dev/od1a to
mount the second.  If you are having someone there switch disks for you, the
device would be /dev/od0a for both.  If yuo do not have root access, get your
sysadmin to write a 3 line C prog to do it, and to set that SUID with you as
owner.
-- 
Dave Strout
dastrout@miavx1.acs.muohio.edu
dastrout%miavx1.bitnet@pucc.princeton.edu
root@next1.acs.muohio.edu
513-523-8245

treed@lissie.UUCP (Timothy Reed) (08/05/90)

In response to a query about mounting an OD from a terminal window.

To unmount an OD from a terminal window, do the following:

	/etc/umount <path to OD>

To mount an OD, enter:

	/etc/mount ~/OD

The monitor of the person using the cube will get the 'stick an
OD' message from autodiskmount.  That person should stick the disk
in - the message will go away.  You'll get a warning message that
mount could not write to /etc/mtab; mtab is the file that df looks
at to check for mounted partition names.  When you next do a 
'df', your OD will not appear.  If you run the mount command as root, you
won't get an error message.  When you're finished, be
sure to unmount and eject the disk.  You must be root to eject the
disk; use the following command to eject the disk:

	disk -e /dev/rod0a

Of course, if you're sitting in a directory on the OD, or are
running a program whose current directory is somewhere on the OD, the
umount will fail, and the 'disk -e...' will really screw things up.
I've gotten some interesting filesystem effects by ejecting a disk
that I had either not umounted locally or remotely (or both).

The best thing to do is run a program to do this junk for you.  Enclosed is
a short script called eject.  It should be set user ID to root, so it
can write to /etc/mtab and can eject the disk.  It can be called from
the directory browser.

Enjoy
Tim Reed
Objective Technologies, Inc.

---------------8< cut here for the eject script-----------------------
#!/bin/sh
#
# $Header: /home/treed/RCS/Next/RCS/eject,v 1.2 90/07/30 19:53:02 treed Exp $
# Program name: eject
# Author and Modification Date: $Author: treed $ $Date: 90/07/30 19:53:02 $
#
# Description and Use:
# Eject an optical disk.  Must be installed suid to root so as to 
# touch /etc/mtab and /dev/rod0a during the eject process.  
# Can be double clicked on from Browser.
#
# Copyright (C) 1990 Objective Technologies, Inc., Timothy Reed
# This program may be used freely, as long as this notice, the original
# copyright information and the disclaimer are left as is.  Use this program
# entirely at your own risk; the authors are in no way responsible for anything
# that happens to your system resulting from use of this program.
#

OD_INFO="`df 2>/dev/null | grep od0a`"
OD_INFO_LINES="`echo ${OD_INFO} | wc -l`"

if test "${OD_INFO_LINES}" -lt 1 ; then
  echo "No OD mounted" >&2
  exit 1
elif test "${OD_INFO_LINES}" -gt 1 ; then
  echo "Too many OD devices!" >&2
  exit 1
fi

OD_DEVICE="`echo ${OD_INFO} | cut -f1 -d' ' | sed 's/od/rod/'`"
OD_MOUNTPT="`echo ${OD_INFO} | cut -f6 -d' '`"

if test -z "${OD_DEVICE}" ; then
  echo "Could not locate OD device" >&2
  exit 1
elif test -z "${OD_MOUNTPT}" ; then
  echo "Could not locate OD mountpoint" >&2
  exit 1
else
  /etc/umount ${OD_MOUNTPT}
  /etc/disk -e ${OD_DEVICE} >/dev/null
fi

treed@lissie.UUCP (Timothy Reed) (08/05/90)

In article <2050.26ba98ee@miavx1.acs.muohio.edu> dastrout@miavx1.acs.muohio.edu (root@next1) writes:
>Provided you have two optical drives, it's simple.  From the command line, as

I was under the impression that a single cube will not support 2 ODs.

Tim Reed
Objective Tech.