Re: Mount behaving oddly under sarge
On Thu, May 05, 2005 at 12:23:57PM +0100, Matthew Roberts wrote:
[...]
> After a reboot, I can't mount a floppy as a normal user:
>
> $mount /media/floppy
> mount: I could not determine the filesystem type, and none was specified
>
> Even though I have this line in /etc/fstab:
>
> /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
>
> However, I can become root using
>
> $su
>
> and do
>
> #mount -t vfat /dev/fd0 /media/floppy
>
> which works fine.
>
> After that the original command (as a normal user) works fine:
>
> $mount /media/floppy
>
> But the next reboot sets it all off again.
You don't have the vfat module loaded, so as a normal user mount looks
for filesystems of the type specified in /proc/filesystems. Running
mount -t vfat as root loads the vfat module for you, it now shows up in
/proc/filesystems so it subsequently will work as a normal user.
Two solutions:
1) If you use vfat a lot, consider loading it at boot time in
/etc/modules or compiling into the kernel.
2) Probably the solution you want:
Add vfat to the file /etc/filesystems (create the file if necessary).
>From man mount:
The type iso9660 is the default. If no -t option is given, or
if the auto type is specified, the superblock is probed for the
filesystem type (adfs, bfs, cramfs, ext, ext2, ext3, hfs, hpfs,
iso9660, jfs, minix, ntfs, qnx4, reiserfs, romfs, udf, ufs,
vxfs, xfs, xiafs are supported). If this probe fails, mount
will try to read the file /etc/filesystems, or, if that does not
exist, /proc/filesystems. All of the filesystem types listed
there will be tried, except for those that are labeled "nodev"
(e.g., devpts, proc and nfs). If /etc/filesystems ends in a
line with a single * only, mount will read /proc/filesystems
afterwards.
The auto type may be useful for user-mounted floppies. Creating
a file /etc/filesystems can be useful to change the probe order
(e.g., to try vfat before msdos) or if you use a kernel module
autoloader. Warning: the probing uses a heuristic (the presence
of appropriate `magic'), and could recognize the wrong filesys-
tem type, possibly with catastrophic consequences. If your data
is valuable, don't ask mount to guess.
HTH
--
Chris Harris <charris@rtcmarketing.com>
-------------------------------------------
GNU/Linux --- The best things in life are free.
Reply to: