LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-15-2011, 02:47 AM   #1
chekhov_neo
LQ Newbie
 
Registered: May 2010
Location: Bangalore
Distribution: Ubuntu
Posts: 22

Rep: Reputation: 2
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?
 
Old 11-15-2011, 02:57 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 11-17-2011, 10:46 PM   #3
chekhov_neo
LQ Newbie
 
Registered: May 2010
Location: Bangalore
Distribution: Ubuntu
Posts: 22

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by jschiwal View Post
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 View Post
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 View Post
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 View Post
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 View Post
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:\).
 
Old 11-18-2011, 09:53 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,408

Rep: Reputation: 593Reputation: 593Reputation: 593Reputation: 593Reputation: 593Reputation: 593
Quote:
Originally Posted by chekhov_neo View Post
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).
 
Old 11-18-2011, 11:03 AM   #5
rng
Member
 
Registered: Aug 2011
Posts: 747

Rep: Reputation: 23
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.

Last edited by rng; 11-18-2011 at 11:05 AM.
 
Old 11-18-2011, 04:36 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,201

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by chekhov_neo View Post
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"
 
Old 11-23-2011, 09:38 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.

Last edited by jschiwal; 11-23-2011 at 09:52 PM.
 
  


Reply

Tags
filesystem, ntfs, ubuntu, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can i delete windows files from linux in ntfs partition sting1220 Linux - Newbie 1 12-23-2007 12:08 AM
linux chkdsk for ntfs partition? hedpe Linux - Software 7 01-10-2007 07:19 PM
better say, enter windows and copy some files, and the partition is NTFS juangabriel1786 Linux - General 3 01-20-2006 11:49 AM
Having read/write access to some files in windows NTFS partition rahilrai Linux - Newbie 7 12-17-2005 01:02 PM


All times are GMT -5. The time now is 08:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration