From owner-freebsd-questions Sat Aug 14 21:18:29 1999 Delivered-To: freebsd-questions@freebsd.org Received: from juno.dsj.net (sylvester.dsj.net [208.148.155.228]) by hub.freebsd.org (Postfix) with ESMTP id 73908152A9 for ; Sat, 14 Aug 1999 21:18:24 -0700 (PDT) (envelope-from dsj@juno.dsj.net) Received: (from dsj@localhost) by juno.dsj.net (8.9.2/8.9.2) id AAA44805; Sun, 15 Aug 1999 00:18:59 -0400 (EDT) (envelope-from dsj) Date: Sun, 15 Aug 1999 00:18:59 -0400 From: "David S. Jackson" To: Ed Vander Bush Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Mount CDROM from User Account Message-ID: <19990815001859.G20961@juno.dsj.net> Reply-To: "David S. Jackson" References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: ; from Ed Vander Bush on Sat, Aug 14, 1999 at 10:23:10PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG So then Ed Vander Bush (ed@metafy.com) said . . . > I am trying to mount my cd from a user acount and I am getting the error > "Operation Not Permitted". It works as root. This account is in the > wheel group and mounting to a directory with proper permissions. What am I > doing wrong? Thanks. Looks like the BSD implementation of 'mount' doesn't include 'user' among its mount options. Is this true, gurus? [ hmmm...he thought...scratching his head as he read page 236 of _The Complete FreeBSD_. "If you come from a System V environment, you'll notice a significant difference in format--see the man page _fstab(5)_ for the full story." ] Anyway, you could always join sudoers and mount/umount the CD that way, right? I wrote this little script below for use first with Linux. And I just now tried to adapt it to FBSD. Gurus, please let me know if what I'm doing is in error or is ill-advised! --------------SNIP---------------(Warning: Linux centric) #! /bin/sh # Syntax: cdm [-flum] # This utility allows you to unmount or mount the cdrom device # to/from the ftp public location (/home/ftp/pub/cdrom) or the # normal mount location (/cdrom). # HISTORY: created Aug 26, 1998. last modified Aug 27, 1998. # adapted (hopefully) to FreeBSD by dsj@dsj.net Aug 14, 1999. device="/dev/wcd0c" mountpt="/cdrom" ftpmountpt="/home/ftp/pub/cdrom" mntcmd="mount -t cd9660" case $1 in -f) sudo "$mntcmd $device $ftpmountpt" ;; -l) mount ;; -u) check=$(mount | grep /cdrom) check1=$(mount | grep /home/ftp/pub/cdrom) check2=$(mount | grep /dev/scd0) if [ -n "$check" ]; then echo "umounting $check" sudo "umount $device /cdrom" elif [ -n "$check1" ]; then echo "unmounting $check1" sudo "umount $device /home/ftp/pub/cdrom" elif [ -n "$check2" ]; then echo "unmounting $check2" where=$(echo $check2 | cut -f 3 -d " ") sudo "umount $device $where" else echo "$device is not mounted" fi ;; -m) sudo "mount $args $device $mountpt" ;; *) echo "usage: cdm -f (for ftp users: requires root access) \n or -l (to show mounted directories) \n or -u (to umount /dev/wcd0c: requires root access) \n or * (to show this help resource) \n or -m (to mount to normal mount position: /cdrom -- Requires root access)" esac -----------------SNIP------------------ Hope this helps more than it hinders. I haven't tested this yet; its predecessor worked under Linux, but, well...that was Linux. Perhaps using login classes would be more fruitful? -- David S. Jackson http://www.dsj.net =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= To give your sheep or cow a large, spacious meadow is the way to control him. --Shunryu Suzuki To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message