LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Windows chkdsk deletes files written by Ubuntu on an NTFS partition (http://www.linuxquestions.org/questions/linux-newbie-8/windows-chkdsk-deletes-files-written-by-ubuntu-on-an-ntfs-partition-913606/)

chekhov_neo 11-15-2011 02:47 AM

Windows chkdsk deletes files written by Ubuntu on an NTFS partition
 
I'm getting a weird problem. I have dual boot Windows Vista and Ubuntu(11.04) on my computer. While using Ubuntu I mount the NTFS partition(read & write) as most of my data like songs are present in it. Whenever I save some new files in this partition through Ubuntu, and boot into windows, windows says the file system is corrupted and runs chkdsk. Then it deletes whatever new files that I had saved in the NTFS partition. Am I doing something wrong here?

jschiwal 11-15-2011 02:57 AM

Are you shutting down properly?

Which filesystem do you use for the ntfs filesystem? ntfs-3g? Check /etc/fstab.

How do you mount the ntfs filesystem? If you had been letting it automount under /media, try using an entry in /etc/fstab instead. Use the ntfs-3g filetype, and mount it elsewere such as under /mnt/. At least for a test.

Look in your kernel logs for any error messages after writing a file. Also check for messages when the filesystem was mounted.

As a last resort, you could create a fat32 partition that you use to save files you want available to both OSes. Writing to the windows System partition may not be the safest thing to do, given the complaints Windows is giving.

chekhov_neo 11-17-2011 10:46 PM

Quote:

Originally Posted by jschiwal (Post 4524376)
Are you shutting down properly?

Most of the times I hibernate both windows/Ubuntu. Only occasionally I shut them down. Is it a problem?

Quote:

Originally Posted by jschiwal (Post 4524376)
Which filesystem do you use for the ntfs filesystem? ntfs-3g? Check /etc/fstab.

I use ntfs as type for the entry in /etc/fstab

Quote:

Originally Posted by jschiwal (Post 4524376)
How do you mount the ntfs filesystem? If you had been letting it automount under /media, try using an entry in /etc/fstab instead. Use the ntfs-3g filetype, and mount it elsewere such as under /mnt/. At least for a test.

I believe having an entry in /etc/fstab would automatically mount the drive on boot. Isn't it? I have /home/<user>/windows as my mount point.

Quote:

Originally Posted by jschiwal (Post 4524376)
Look in your kernel logs for any error messages after writing a file. Also check for messages when the filesystem was mounted.

I looked into the /var/log/kern.log file. I don't see any logs when writing a file or mounting the filesytem

Quote:

Originally Posted by jschiwal (Post 4524376)
As a last resort, you could create a fat32 partition that you use to save files you want available to both OSes. Writing to the windows System partition may not be the safest thing to do, given the complaints Windows is giving.

The partition I'm trying to use is not a windows system partition(C:\) but just an NTFS partition(D:\).

rknichols 11-18-2011 09:53 AM

Quote:

Originally Posted by chekhov_neo (Post 4527152)
Most of the times I hibernate both windows/Ubuntu. Only occasionally I shut them down. Is it a problem?

When an OS wakes up from hibernation, it expects to find its mounted file systems in the same state in which it left them. Any change is likely to cause problems. And, that's going to happen in both directions. An awakened Windows won't like what Ubuntu did to its file system while Windows was in hibernation, and an awakened Ubuntu will have an inconsistent view of that NTFS file system if Windows made any changes while Ubuntu was in hibernation (assuming that Ubuntu had the NTFS file system mounted when it went into hibernation).

rng 11-18-2011 11:03 AM

I had also lost data while keeping windows in hibernating state with folders of my data partition open. However, I have not had a problem if I close down the folders before subjecting windows to hibernation. Then even if I go to ubuntu and work on files in those folders, I do not lose data on coming back to windows (I am shutting ubuntu down and not hibernating it). I suspect that windows unmount partitions which are not open in windows explorer. From ubuntu also, it may be safer to unmount data partitions before hibernating it and going to windows.

syg00 11-18-2011 04:36 PM

Quote:

Originally Posted by chekhov_neo (Post 4527152)
I use ntfs as type for the entry in /etc/fstab

That might imply the in-kernel NTFS driver. Which is not what you want for write access. Let's see the output of "df -hT"

jschiwal 11-23-2011 09:38 PM

If you shut down cleanly from both Linux & Windows, do you still have the problem? If it's possible to boot up to one after hibernating the other, that might cause a problem. Some of the updates to the filesystem may be cached, and not written to disk. If the problem persists after shutting down both, the problem isn't with hibernating.

I'd recommend mounting with the ntfs-3g filesytem. If you do both, cleanly shutdown, and use ntfs-3g, do you still have the problem?

Please post your /etc/fstab entry for the NTFS filesystem. Seeing what the mount options are may help as well.

---
Note, reading the README file for ntfs-3g, it emphasizes placing the /etc/fstab entry at the END of the file. I don't know why this is recommended, or if there is a difference in this recommendation for the ntfs filesystem. Ntfs-3g uses fuse. The fuse kernel module needs to be loaded.


All times are GMT -5. The time now is 12:31 PM.