Author Topic: Lost Power While "moving" Files  (Read 1560 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2263
  • Country: us
Lost Power While "moving" Files
« on: November 28, 2024, 01:53:18 pm »
I have a question.

Last night I was "moving" (not copying) files off an XP computer onto a USB drive and the power went out.

My question is: what happens to the file(s) that are being moved when power is lost? Does the file become corrupt and a portion is on each drive or does it not delete the file from the main until it's fully copied to the other drive?
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5268
  • Country: nl
Re: Lost Power While "moving" Files
« Reply #1 on: November 28, 2024, 02:46:29 pm »
Moving files is copying them to the destination and then deleting them from the source, it's not like the file is moved to an intermediate location and deleted from the source. So the only corruption you could find is the file that was copied to the destination when the power failed, but the file should still be intact on the source location.
Keyboard error: Press F1 to continue.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2263
  • Country: us
Re: Lost Power While "moving" Files
« Reply #2 on: November 28, 2024, 02:57:38 pm »
Ahhh okay.

I thought maybe the contents of the file was moving during the transfer. As an example, if it "moved" 50MB out of 75MB and lost power, I'd have 25MB on the source and 50MB on the destination leaving me with two partial files that are now corrupt.

Usually I select 'copy' when doing something like this, however, it's so rare power is lost that I will "move" files instead. The power outage last night was probably the first time in a few years; and lasted about ten-seconds.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13231
Re: Lost Power While "moving" Files
« Reply #3 on: November 28, 2024, 03:17:14 pm »
If write caching for the removable drive was enabled, you may have lost data, as a file could have been written to cache but the cache not yet flushed to the actual drive.  See https://blog.seagate.com/support/kb/disabling-the-write-cache-feature-in-windows-2000-xp-vista-and-windows-7-187751en/
With large files its more likely you'd get partial corruption or a truncated file rather than missing files. 

It was usual for solid state dedicated USB drives to be 'optimized for quick removal' i.e. no write caching, but USB hard drives and removable rotating media drives often defaulted to write caching enabled, and unless you overrode that property setting,  had to be soft-ejected or soft-disconnected before physical removal to avoid the risk of recent writes being lost.
« Last Edit: November 28, 2024, 03:20:17 pm by Ian.M »
 
The following users thanked this post: SeanB, Geoff-AU

Online DiTBho

  • Super Contributor
  • ***
  • Posts: 4436
  • Country: gb
Re: Lost Power While "moving" Files
« Reply #4 on: November 28, 2024, 05:13:56 pm »
we all need to find a nice UPS-unit under the xmas tree, I guess  :D
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: SeanB

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1497
  • Country: pl
Re: Lost Power While "moving" Files
« Reply #5 on: November 28, 2024, 06:14:12 pm »
The data might be corrupted, including files being lost.

File moves across file systems don’t work by removing a fragment and then putting it elsewhere. The file is copied as a whole to the destination and then removed from the source. In that sense at least one of the places should hold a copy.

The catch is flushing to storage. Writes to the USB stick and deletion from the source disk are not synchronized. It’s possible, that the deletion of source file entry is flushed to the source disk before the data is actually flushed to the USB stick.
People imagine AI as T1000. What we got so far is glorified T9.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf