Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have 3 partitions: one for win7 (ntfs), one for Ubuntu (ext4) and one just for data (ntfs so both operating systems can see them). My problem is that I had stored some files on the data partition using ubuntu and when i booted win7 all that data was gone! After that I couldn't find the files even when using Ubuntu. My files were simply GONE :( Is there something I can do in Ubuntu or is it just windows problem?

share|improve this question
    
I hate to say this, but it sounds more like a user problem. Did you ever actually see the files after you saved them to confirm that they were where you expected them to be? If you really saved them there, they don't usually disappear. Perhaps try searching the ext4 partition in Ubuntu and see if they were saved in a different location. –  Marty Fried Feb 20 '12 at 20:33
    
hah I thought that as well. Nope, the files are missing. Actually this is the second time I encounter the same exact situation. –  yehuda Feb 20 '12 at 21:26
    
How did you store the files? Did you confirm that they were there using a different method, such as nautilus, in case there was a write error that you didn't see. It's sometimes not straightforward getting the NTFS permissions correct, so maybe the write attempt failed. –  Marty Fried Feb 20 '12 at 22:05
    
The files were there for about a week. I accessed them many times using ubuntu. It was a few pdf and video files I downloaded from the net.Does it have to do anything with the filenames? Linux allows more characters. Could win7 erase the files from the filetable just because of a wrong filename? –  yehuda Feb 20 '12 at 22:23
1  
First of all, you installed Ubuntu with Windows 8 hibernated? Or, even worse, you left windows hibernated and started to save files in an NTFS partition? If any of those 2 is true, I must deliver you the bad news that your data is corrupted and possibly lost forever. You NEVER must save files into a hibernated system, since it will corrupt the data. –  Braiam Sep 13 '13 at 2:45
show 1 more comment

3 Answers

If you hibernate windows (or purpose or because of power-saving), then use ubuntu to store files on the NTFS partition, and then boot up windows, Windows thinks the disk was corrupted while it was in hibernate and "fixes" anything different. After that loging back into ubuntu just confirms that the files have in-fact been deleted.

Also I have seen that windows 7 may do a chkdsk after it installs updates on shudown when you bring it back up windows does extra tasks related to installing updates, so be careful not to boot into ubuntu after shutting down from updates. http://www.linuxquestions.org/questions/linux-newbie-8/windows-chkdsk-deletes-files-written-by-ubuntu-on-an-ntfs-partition-913606/

Yes even on a shared partition seprate from the windows partition and take care even with fat partitions (usb drives).

Sources, http://superuser.com/questions/211079/what-do-i-have-to-take-care-of-when-hibernating-both-ubuntu-and-windows-dual-bo/211175#211175 , http://superuser.com/questions/39532/hibernating-and-booting-into-another-os-will-my-filesystems-be-corrupted

Edit: I was looking through the widows site to try and find if they detailed the hibernate process, but this sounds interesting http://msdn.microsoft.com/en-us/library/dd143253(v=winembedded.5).aspx , It seems at best the write caching from the harddrive is being saved to memory, then being written after bringing the drive back up, this may mean that the files can't be recovered, because it's not "deleting" as in removing the first letter of the file so the system does not see it, but actually overwriting large areas of data that have been cached. Needs to be looked into more.

share|improve this answer
add comment

It happened to me as well. After reading a lot about this on internet I came to know that this happens when Windows is in Hibernate mode. There are already some related questions here on askubuntu and also on superuser.

Files disappear on NTFS partition

http://superuser.com/questions/144720/missing-files-when-windows-7-returns-from-hibernate-w-dual-boot

share|improve this answer
add comment

I have a similar setup to you. I hibernate Windows 7 with a NTFS 'shared' drive, edit the files in Ubuntu, then start Windows 7 to find the changes gone.

As a few workarounds, use an external hard drive or USB drive for your shared files, or

make a hibernate.bat file with the contents (change D:\ to your drive)

mountvol D:\ /D 
shutdown /H

and a startup.bat file with the contents (change D:\ to your drive)

mountvol D: 'VolumeName'

Run hibernate.bat to hibernate Windows (don't hibernate from start menu!)
Run startup.bat when starting Windows

Also, you may need to disable Windows 8's 'Fast Startup' function

(source)

share|improve this answer
1  
please don't do that. Windows is well known for corrupting data saved in a hibernated system. –  Braiam Sep 13 '13 at 2:46
    
@Braiam is there a way to make windows only hibernate one drive (C:)?. I'm unmounting the data partition from windows before hibernating –  minerz029 Sep 13 '13 at 2:53
1  
I think that question is for Super User. But, as far I have understanding for accessing any NTFS drive working under Windows you must properly shutdown the system or unmount the device. –  Braiam Sep 13 '13 at 2:55
    
Thanks minerz, that's helpful. I've disabled fast startup. In the hibernate.bat are you using mountvol D:\ /D to unmount the data drive before hibernating? –  Walex Sep 13 '13 at 15:39
    
@Walex Yes, do that Windows doesn't hibernate the state of D:\ drive –  minerz029 Sep 13 '13 at 20:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.