[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More on 'mount' (Re: DS20 aid needed)
Tom Droege wrote:
>
> 2. I still have a problem with mount. I can only umount the cdrom from
> the directory where I mounted it. Is this the way it works?
>
> Tom Droege
Do you really mean 'directory', or do you mean user id - you can only umount when
you're logged in as the user who mounted it? I'm guessing the latter. If it's really
about directories, the only restriction I know is you won't be able to umount the
device if you have set your current working directory to a directory on the device
(.e.g. you typed 'cd /mnt/cdrom/ds201' or you're looking at one of the directories
on the CD with Nautilus/File Manager). In this case you'll get a "device busy" error.
If you're really asking the question I think you're asking, it sounds like you
put 'user' in the wrong field in /etc/fstab. Each line in /etc/fstab is
composed of six fields, each field separated from the others by one or more spaces
or tabs. My guess is you have some extra spaces somewhere. In the example I sent before,
/dev/hdb /mnt/cdrom auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0
it breaks down as
Field 1: /dev/hdb - the device to be mounted; /dev/hdb is the slave device on the
first IDE controller. The /dev directory contains "special files"
representing real and virtual hardware devices. The Linux installation
program can generally be trusted to set this field correctly for you.
Field 2: /mnt/cdrom - the "mount point" for the device. This is just a directory within the
directory tree; when you mount the device, its contents will be
accessible through this directory. /mnt is a conventional place for
creating mount points for removable media; you can mount devices on
any directory, though, so if you don't like "/mnt/cdrom" you can create
the directory you would rather use with 'mkdir' and use that as a mount point.
Field 3: auto - the device's filesystem type. The filesystem type for a CD-ROM is
"iso9660", and you could use that value in this field with no problems.
A value of "auto" in this field tells the 'mount' program to try to
determine the correct filesystem type by looking at the device's superblock.
This is a common setting for floppy disks, which may be formatted with either
an MS-DOS filesystem or a native Linux filesystem; less useful for CD-ROMs,
but no harm.
Field 4: user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto
- "user" is as previously described, any user can mount/unmount the device.
In particular, one user can mount and another user can umount.
At least, that's how it works in Mandrake 8.1. In recent versions of
Red Hat it's slightly different; "user" lets a non-root user mount and
umount the device, but only the user who mounted the device can umount it.
If you want the one-user-can-mount-and-another-can-umount behavior on
Red Hat, the keyword is "users".
"iocharset" and "codepage" only apply to Microsoft filesystems, and control
long-file-name translation. "umask" is a bitmap of file permissions that should
be disabled, and also applies to Microsoft filesystems (the MS idea of "file
permissions" doesn't map cleanly to the Unix model, which is why text files
created under Windows show up as "executable" in Linux). "exec" is applicable to
all filesystem types, and means "permit execution of binaries". You might
conceivably want to set "noexec" if the CD contains Windows binaries,
or non-Intel binaries. "ro" means read-only.
And finally, "noauto" in THIS field means don't try to mount the device
automatically. The command 'mount -a', usually issued in the system startup
sequence, instructs 'mount' to go through the fstab file and mount all the devices
except those that have "noauto" somewhere in field 4.
Field 5: 0 - dump frequency, used by the 'dump' filesystem backup utility. Can be omitted; 'dump'
doesn't operate on CD-ROM filesystems, anyway.
Field 6: 0 - "filesystem pass number", used by the 'fsck' filesystem check utility to determine the
order in which filesystems should be checked on a given device. The root filesystem
should have a value of "1" here, other fs's on the same device should have a "2".
Again can be omitted for a CD, since 'fsck' isn't going to be very useful on a
read-only device. 'fsck' checks the on-disk structures for consistency; it is usually
run at boot time after your system has been shut down incorrectly - around here,
usually after a power failure - to detect and correct fs corruption.
Field 4 should be a comma-separated list of options with no spaces between options. Any space between
the items will be interpreted as the end of the field. 'mount' only cares about the first 4 fields, so
if you write '/dev/hdb /mnt/cdrom auto exec,ro,noauto, user 0 0', the "user" will be interpreted as field 5
and ignored.
John