[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mounting floppy. Newbie #61



On Thu, 27 Dec 2001, Ian Balchin wrote:

> I note that when you copy a file to /floppy it seems to be incredibly 
> quick.  Is it in fact written to the floppy at the same time as it 
> appears on /floppy ?
> 
Ian,

	All I can say is "Ouch!". Unlike the DOS world, Unix in general,
and Linux in particular, do not guarantee that data will be written to
disk immediately after the in-memory copy of the disk blocks have been
updated. Unixes, in general, cache such info, and typically write out to
media (floppy disks, hard drives, etc) only when its efficient to do so.
Thus, when you make drastic changes to the contents of a floppy disk, the
in-memory copy of those disk blocks gets updated, and this happens quite
fast. However, unless this copy is written out to the floppy itself, the
changes will not be permanent.

	There is a standard way that Unixes support to force the write to
media. This is called the 'sync' command. If you had done 'sync' after
changing the contents of your floppy, you would have seen that your system
was writing to the floppy - which does take a significant amount of time.
Given the symptoms you describe, I would guess that you didnt do a 'sync'
before you popped the floppy disk, and thus your backups were never
written to floppy before you popped out the drive.

Regards,
Jor-el



Reply to: