rejetto forum

VFS - File System gets Corrupted!!

0 Members and 1 Guest are viewing this topic.

Offline luckman212

  • Occasional poster
  • *
    • Posts: 28
    • View Profile
hi friends,
I love HFS it's amazing, but I find that if my computer get shut down improper-  for example if power plug would be pulled by mistake, then next time HFS will start with "empty" file system-  i.e. it lose all its settings, etc.

since HFS have a very complex and not- easy to use GUI (sorry but its true!!) this takes lot of time to re-set all the options etc to our taste.

is it possible to avoid the VFS becoming corrupted each time the computer would crash?  For me, I do not see the purpose of leaving the VFS in an "unstable" state while the program is open. 

To me, the VFS should only be read/written to when files are making changes.  Otherwise, file handle should be closed I guess to protect the integrity.

any ideas??  I use vista x64 sp1, hfs build #198


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i thought the file saving was already stable at this stage!
can you send me privately a corrupted vfs file? at rejetto@rejetto.com


Offline luckman212

  • Occasional poster
  • *
    • Posts: 28
    • View Profile
i have already trashed this file....... but yes next time I will do it!! :-\


Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile
rejetto, Vista treats file handling very differently, from what I've observed. It seems to use the USN journal extensively. If the PC shuts down improperly, Vista will partially rollback the changes. While I don't fully understand this behavior, let me give an example.

Compression of a file with 7-Zip into multiple parts (.001, .002 etc.)

If you watch the process in XP, you observe that the files get created and the filesize raises as XP writes them to disk.
file.7z.001  50000KB
file.7z.002  50000KB
file.7z.003  34560KB <== 7-Zip working on this one, currently.

If the XP PC shuts down improperly during the task, you are left with the partial files.


Now the same on Vista (SP1, dunno if it matters)
The files get created as on XP, BUT THEY ARE COMPLETELY EMPTY UNTIL THE WHOLE 7-ZIP PROCESS FINISHES!
file.7z.001       0KB
file.7z.002       0KB
file.7z.003       0KB <== 7-Zip working on this one, currently.

If the Vista PC shuts down improperly during the task, the files vanish.


It could explain the VFS corruption dilemma, you could try closing and re-opening the VFS (and the HFS.ini, for that matter) after saving them. Another possibility would be to allow "hybrid-saving" to file AND registry, to have a fallback method should something get wrong (doesn't work for portable, obviously).
http://worldipv6launch.org - The world is different now.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
almost every file saving (not only VFSs) in HFS is done this way:
1 save to temp file
2 delete previous file if exists
3 rename temp file to proper name

so if the file will appear, it should be the correct one, or the previous.
i thought this schema would be almost trustable.
we'll see if someone will provide a real corrupted file.


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
i never use home OS like XP or Vista .. so my experience is diffrent then you guyz

i had windows Server 2000 & now Windows Adv server 2003 and i also used for some months Server 2008

and got the same problem .. Illegal Shutdown .. 20% of time VFS corrupt

means if pc shutsdown during file saving it goes corrupt or maybe after 5-6 illegal shutdown its corrupted

its just my idea and am not sure about the actual reason but my VFS corrupt after 4-5 illegal shutdowns .. now dunno wats the reason illegal shutdown or it was saving something to VFS and a shutdown occur :/


emailing the corrupt file Rejetto :)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
is it possible to avoid the VFS becoming corrupted each time the computer would crash?  For me, I do not see the purpose of leaving the VFS in an "unstable" state while the program is open. 

To me, the VFS should only be read/written to when files are making changes.  Otherwise, file handle should be closed I guess to protect the integrity.

let me clear what's the expected behavior.
HFS never keeps VFS files open, indeed the file formatting itself is done in memory, and only when it is complete it gets saved on disk, usually taking 0.01 seconds since the file is small, during which the file is open. Nothing more.

Since i found no way to truly avoid corrupted files on some cases, i introduced 3 things

1. a timer option to save the vfs
2. any saved file is saved to a temp file, then when it's over, i use it to overwrite the previous one
3. when a vfs file is saved again, the old version is kept (renamed as .bak) and restored if anything goes wrong.

in case a vfs is found to be corrupted, it is renamed as .corrupted, and the last backup is restored.

Quote
since HFS have a very complex and not- easy to use GUI (sorry but its true!!) this takes lot of time to re-set all the options etc to our taste.

i know, i'm sorry, but you'd save your time if you'd just backup the file you are loosing.


Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile
Just happened again this morning. All settings and the VFS lost (said sth. about invalid data). I'll now try saving to the registry. We'll see if this works better for Vista.
http://worldipv6launch.org - The world is different now.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
the corrupted file sent me by ayehan was a *.vfs.corrupted file, that's not what i need. Such file is created by hfs when it detects and handles the problematic situation. Aside this file you will find your restored .vfs file, that's the previous one. So you may have lost your last changes.
He instead said that sometimes the .vfs file itself (not the .vfs.corrupted) is corrupted and doesn't work. I'd like to get a copy of this kind of file.

@markv
the vfs is not saved to the registry.
did you keep the invalid vfs file to send it to me? :P


Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile
Unfortunately not, HFS just overwrote with an empty one.

There was no *.vfs.corrupted, it wasn't created.
http://worldipv6launch.org - The world is different now.