Re: [SLUG] Flushing cache

From: Paul Braman (aeon@tampabay.rr.com)
Date: Sat Oct 27 2001 - 08:24:37 EDT


On Fri, 26 Oct 2001, Bill wrote:

> After I check the directory on a floppy, for every floppy after that,
> I get the same directory. Since some of them are known to be blank or
> to contain other files, I can be certain the directory listing I am
> given is wrong.

The problem is that you are not unmounting the floppy before removing it.
This can lead to corruption of the filesystem on the floppy depending on
what type of filesystem you might have on there (and assuming you do any
writes).

Always think of "mounting and unmounting" as "where the device is
installed in the directory tree". Assuming you have a mount point named
/mnt/floppy that you have already listed in /etc/fstab you should:

        <insert floppy>
        mount /mnt/floppy
        <perform all reads/writes>
        umount /mnt/floppy
        <eject floppy>

Now, the beauty of autofs, the name for one of the better automounting
systems, is that you can have this taken care of automagically.

I won't go into a lot of specifics except to state that here's what my
setup looks like:

        ==== /etc/auto.master ====
        /mnt /etc/auto.mnt --timeout 5
        ==========================

        ==== /etc/auto.mnt ====
        cdrom -fstype=iso9660,ro :/dev/cdrom
        floppy -fstype=msdos,rw :/dev/fd0
        =======================

What this means is that I can stick a floppy in the drive and simply start
to perform queries on /mnt/floppy (like doing an "ls"). The system will
mount the disk for me. After 5 seconds of inactivity the system will
automatically unmount the floppy, so I can pull it out of the drive and
stick in a new one without having to worry about all that other garbage.

Paul Braman
aeon@tampabay.rr.com



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:53:46 EDT