On Tue, Jul 01, 2003 at 01:25:17PM -0500, Robert Gallimore wrote:

> I am having a slight problem with FreeBSD 4.8. I cannot seem to mount a 
> floppy drive. I tried "mount /dev/fd0" but it comes back saying something 
> like an unrecognized file system or device. How do I mount my floppy drive 
> in FreeBSD 4.8? Thanks!

If this is a DOS format floppy, then here's a tip: don't bother trying
to mount and unmount the floppy all the time.  Instead, install the
emulators/mtools port.  This gives you a whole bunch of MS-DOS style
commands, except with an 'm' prepended to the name, which let you
access the floppy drive but without having to mount it first. Eg. you
can do:

    % mdir a:

If you are using a non-DOS floppy or you really need to mount the
floppy for some other reason, then you're going to have to tell
mount(8) all of the information it needs.  There's two ways to do
that: either on the mount(8) command line, or by making an entry in
/etc/fstab.  Eg. to mount a read-only floppy with a msdos filesystem
on it as /mnt:

    # mount -t msdos -o ro /dev/fd0 /mnt

Note that:

a) you usually have to have superuser privilege to run mount(8) or
umount(8).  You can either install the sudo(8) port and generate the
appropriate configuration there, or you can set the vfs.usermount
sysctl to a non-zero value.  See mount(2), sysctl(8) for details, but
note that setting vfs.usermount potentially opens up a nasty security
hole, so you should understand exactly what you are doing if you
decide to do that.

b) You have to remember to unmount the floppy before you eject it from
the drive.  Not doing that has undesirable effects.  Similarly, if the
floppy has the write protect tab set, you have to tell the system to
mount it read-only.  Unfortunately, the system can't actually detect
that the disk is write protected automatically.  Even worse, if you
mount a unix format RO floppy using RW flags, even if you do nothing
more than read files from the disk, the system will hang when you try
and unmount the disk because the system will try and update the 'last
mounted on' entry on the disk.  (Solution is to pop the floppy out,
toggle the write protect tab and put the disk back smartly so the
write can complete).  Oh -- editing files on such a disk will
apparently work because the system will hold the whole 1.44Mb disk
image in cache.  Changes will be flushed to disk eventually, or when
you try and unmount it.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to