Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lissie!treed From: treed@lissie.UUCP (Timothy Reed) Newsgroups: comp.sys.next Subject: Re: Mounting the optical disk from a terminal other than console Summary: eject an OD, plus an OD eject script Keywords: OD eject Message-ID: <104@lissie.UUCP> Date: 4 Aug 90 17:08:47 GMT References: <3943@newton.physics.purdue.edu> Distribution: usa Organization: Objective Technologies, Inc., New York, NY Lines: 81 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 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