From: jes@grendel.demon.co.uk (Jim Segrave) Subject: Re: Help needed to savage files on linux floppy Date: 21 Sep 1992 22:07:06 GMT
In article <BuvurK.Grw@ucunix.san.uc.edu> zuazaga@ucunix.san.uc.edu (Humberto Ortiz-Zuazaga) writes:
> >doing umount. This floppy is empty. I put in another floppy full of
> >useful executables and found by "df" there is a mount entry there.
> >I then did a "umount" and ! all files disappeared on the last floppy.
>
> > 2. Isn't this some kind of bug?
>
> Not really, it did exactly what you asked it to, but maybe we can make
> the kernel a little smarter about these things. (We certainly can't do
> much about the users!) Perhaps the kernel, or umount could require
> confirmation before umounting a changed disk? Or the disk change
> could invalidate the disk buffers? Would these changes stop this from
> happening?
> --
> Humberto Ortiz-Zuazaga zuazaga@ucunix.san.uc.edu
> Dept. of Physiology & Biophysics University of Cincinnati
Confirmation before umounting (or for that matter reading/writing) to a
changed disc would be a help, though it might be a mess to implement.
Merely invalidating buffers is not enough to preserve the previous disc.
It might allow fsck to recover a bit of the data.
The biggest problem is ensuring that the original disc has been returned
- we certainly don't want the DOS mess of reading disc serial numbers or
checksumming the super-block or whatever.
I don't really have a good suggestion for preventing this short of not
letting it happen in the first place.
Then again - maybe if we had a field in the superblock of any removable
media - say a long - and a similar field in the root system's superblock.
Every time a removable device is mounted, increment the root's counter
and copy the field to the removable's superblock. When a disc change is
detected, suspend all disc I/O and initiate a daemon which keeps trying
to read the superblock of the removable disc until it sees the same id
again. Ugly, but it would work.