Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use Linux for most of the things but I still need Windows sometimes. So, I have Linux Mint 14 and Windows 8 installed (dual-booting) on my computer with the following disk setup:

  • sda1: The 350 MB partition Windows 8 allocates (I still don't know why.)
  • sda2: Windows installation
  • sda3: My shared NTFS drive
  • sda5: Linux Mint 14 installation
  • sda6: Swap area for Linux Mint

Most of my files are in sda3 which I share between the two OSs (kind of like my backup partition). I can access it from both operating systems. However, sometimes my files get corrupted.

Example: I recently downloaded Eclipse and extracted it to a folder in sda3 drive in Linux Mint. It was working fine. Then when I switched to Windows, it asked me to repair my drives because there were some errors. I accepted, Windows did some scanning and restarted. When I switched back to Linux Mint, I noticed that Eclipse wasn't working. When I checked, most of the files in Eclipse folder were corrupted. Similar things happen other way around as well. Sometimes I'm not able to see and/or open files in Windows that I created/downloaded in Linux Mint. I'm tired of losing files like this.

Is it a hardware issue? (My computer is kind of old)

If not related to hardware, is there a better way to share data between OSes than what I currently have? (a separate NTFS partition for both)

share|improve this question
    
How are you switching between the different OS's? Are you using suspend-to-disk (hibernate) or are you rebooting? –  derobert Jan 4 '13 at 18:13
    
Just rebooting. My battery is almost dead, so I use it plugged in. That's why I don't make my computer sleep or hibernate. –  mAt Jan 4 '13 at 18:16
    
That setup should work and I would recommend it. There's something pathological about your NTFS partition. If possible, you could try and reformat that partition (after having moved/copied all the data elsewhere): mkfs.ntfs /dev/sda3 and see if it still does it. –  Stéphane Chazelas Jan 4 '13 at 23:07

3 Answers 3

up vote 3 down vote accepted

What is likely happening is not that files are being corrupted but that Linux is doing its best to ensure that files are not corrupted.

When a filesystem is opened, written to, and is being closed, the operating system (both Windows and Linux) will mark the filesystem as being "dirty", e. g. not properly closed.

Under normal circumstances, when you unmount a filesystem, it will mark it as clean, presuming that all remaining I/O requests have been fulfilled, the filesystem's journal (if available) is empty, and all disk cache has been synced to the physical disk.

In some cases, the NTFS-3G utilities will simply not mark the filesystem as "clean" to ensure that it is checked by Windows at startup and avoid possible corruption.

In short, your hardware is probably fine, although it can't hurt to check the hard drive's health at any point. As far as actually sharing data back and forth, I would recommend a network-based storage method. Whether a locally-housed server or a push of the data into the cloud, using a network filesystem (probably SMB/CIFS for Windows compatibility) will ease the migration problems.

share|improve this answer

Sometimes this is because Linux uses the characters in filenames which are invalid in Windows. For example you can save a file with a question mark (?) in its name in Linux (even in an NTFS partition). However, you cannot open it in Windows, and if you run a chkdsk, Windows will delete the file, and puts it in a folder named Found.nnn in the root of the drive with a different name which may become really tricky to find.

share|improve this answer

By using the FAT (vFAT most likely) file system, you get good performance and compatibility between both operating systems. This makes it a useful and a convenient to share data between them without using NTFS.

Another method is to deploy a NAS device, like the excellent NSLU2. You can replace the firmware with unslung, which provides a way to install SSH on the device. Afterward, in Windows, use win-sshfs to "map a drive" to a Widows drive letter; and, in Linux, use fuse/sshfs to mount the NAS in a folder on your Linux system. In this way, both Windows and Linux can access the same data in the same way (SSH), each with it's own native "look-and-feel," so to speak. Plus, you get real filesystem-specific benefits like permissions that work for both systems; also the NSLU2 provides a disk replication service if you use two external hard drives with the NSLU2 (or set it up yourself with rsync perhaps). The NSLU2 with unslung firmware is basically a mini Linux server: web, ssh, or whatever you like. Thus, you could use this on the LAN or the WAN. One drawback I have found with the NSLU2 is that it does not power on after power failure, so I keep mine on a UPS.

share|improve this answer
    
Why do you suggest using FAT instead of NTFS? What advantage do you think FAT brings in? –  Marco Jan 4 '13 at 17:42
    
@Marco Oh, just a couple of ideas... NTFS (ntfs-3g) works, and it is a first choice, of course; but, FAT also works well for sharing files between the two operating systems. Security features of NTFS only work while using Windows. FAT does not index files and does not mandate file transaction recording, so it's a bit faster. If there's a file too big for FAT, it could be written to the Windows C drive. I have some older systems that behave like this, too; yet, they work well with FAT for a reasons I do not understand. –  Christopher Jan 4 '13 at 18:30

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.