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

Re: premature cp exit?



On Thu, Nov 07, 2002 at 10:15:08PM -0500, Try KDE wrote:

[ nice real name, Señor KDE ... ]

> Hi,
> 
> I've just observed something interesting on my PC. My machine is a 
> AMD1800+ with 1GB RAM, kernel 2.4.18.  I have a floppy disk:
>    $ mkdosfs /dev/fd0 1440
>    $ mount /mnt/floppy
>    $ cp some-big-fie  /mnt/floppy
> 
> What I found is that cp returns immediately, and the floppy drive's LED 
> doesn't turn off until 5-10 seconds later. It seems to me that cp copied 
> the content to kernel and returned without it being committed to the 
> physical media. This could be a wrong behavior considering that a bad 
> media may later fail the operation. What do you guys think about it? Is 
> there an option or something to force cp to wait?

This is normal behavior in Unix ... writes go to the buffer.  Buffers
are synced to disc periodically.  It's more noticeable on "slow"
media like a floppy, but the same thing is happening every time you
write a file on your fixed discs.

Now you know why we have the admonition to never eject media that is
still mounted.

I don't see why bad media is an issue ... bad media will always cause
an error whether writes are synchronous or not.

-- 
Nathan Norman - Incanus Networking mailto:nnorman@incanus.net
  
              Ozymandias
  
  I met a traveler from an antique land
  Who said: "Two vast and trunkless legs of stone
  Stand in the desert.  Near them, on the sand,
  Half sunk, a shattered visage lies, whose frown,
  And wrinkled lip, and sneer of cold command,
  Tell that its sculptor well those passions read
  Which yet survive (stamped on these lifeless things),
  The hand that mocked them and the heart that fed;
  And on the pedestal these words appear:
  'My name is Ozymandias, king of kings;
  Look on my works, ye Mighty, and despair!'
  Nothing beside remains.  Round the decay
  Of that colossal wreck, boundless and bare
  The lone and level sands stretch far away."
  
          -- Percy Bysshe Shelley



Reply to: