1

I have an NTFS partition that's shared between Windows and Linux. This partition holds my linux home folder, so it's important that I can mount it in read-write mode, and that it is mounted before I log in.

I have disabled Windows fast boot so that it doesn't leave the partition in an "unsafe state", which linux either mounts in read-only mode or doesn't mount at all (with an error message like this). However, Windows crashes somewhat regularly, which also leaves the partition in an unsafe state.

I've more or less successfully used ntfsfix to get around this, but that doesn't seem to be a real solution, because today it destroyed some of my files. (Causing an [errno 5] input/output error error when I try to access them.)

I'm currently mounting the partition with this line in /etc/fstab:

UUID=78C806C74DE61D21   /mnt/data   ntfs    defaults,uid=rawing,rw      0 0

The problem with this is that it silently mounts the partition in read-only mode if it was left in an unsafe state. It usually takes me a few minutes to notice, which is very annoying.


So, my question is:

  • Is it possible to leave the NTFS partition in a "safe" state, even if Windows crashes? (If there are alternatives to a NTFS-formatted partition, I'd be happy to hear them, but keep in mind that it has to hold my home folder)
  • If no, is it possible to configure linux to mount the "unsafe" partition in read-write mode anyway; without risking data loss?
  • If no, can I at least make linux display a warning like "Partition mounted in read-only mode!" so that I notice the problem right away?

2 Answers 2

2

The last I heard, NTFS was unsuitable for use as a Linux /home partition because Linux programs often rely on permissions and ownership features for some files in /home, and those features aren't provided by NTFS. For instance, some files in ~/.ssh/ need specific permissions in order to work correctly. Thus, you should not use NTFS, or any other non-Linux filesystem, for /home. (You might be able to get away with using HFS+ or something else that provides Linux/Unix-style filesystem features, but that's territory that few people have traversed.)

For file sharing between Windows and Linux, it's best to mount the shared-data partition somewhere other than /home, or even /home/{your-username}. You could mount it to a subdirectory of that location, though, such as /home/{your-username}/shared. You could even create symbolic links that point to locations within the shared directory, if that helps you make things work.

Alternatively, you could use a Linux native filesystem for /home and use a Windows driver for that filesystem. Several such drivers exist, such as Ext2fsd and Paragon's ExtFS for Windows. I have no recent experience with any of these tools, though, so I can't say how well any of them work, or recommend one over another.

To more directly address your question: The mount.ntfs utility includes some options that might do what you want. The most promising, to my eye, is recover, which is supposed to force the mounting of an NTFS volume even if it's flagged as being in an inconsistent state. Note, however, that this is not what I'd call "safe." I'd only try this in conjunction with a read-only mount as a way to recover files before doing something else with the volume, like boot into Windows to repair it. Note that I've never tried using this option, so I can't promise what it will do in practice. If you must try it, I recommend experimenting on a "scratch" volume first and/or searching the Web for reports of people using it.

You might think that the Linux ntfsfix program would repair an NTFS volume; but it does very minimal checks, even more minimal repairs, and flags it as needing attention in Windows. Thus, repairing an NTFS volume really is a Windows-only operation, AFAIK. As a practical matter, if your dual-boot computer crashes (when running either OS), it's best to boot it into Windows so that Windows can repair its shared NTFS filesystems before you boot into Linux. (Windows can also repair FAT filesystems at this time; but Linux at least provides a decent FAT repair tool, dosfsck, so FAT partitions can be repaired from Linux, if necessary.)

1
  • It's actually not my home folder itself that's on the NTFS partition, only the Desktop and some other subfolders. I haven't run into any permission-related problems. Anyway, about the ext drivers for Windows: I have made very bad experiences with these; I almost ended up with a corrupted partition. I don't like the idea of a FAT partition very much either, because of the 4GiB file size maximum. So it looks like the recover option is my last hope. Thank you for all the information and suggestions; if no other answers pop up soon, I'll accept yours.
    – Aran-Fey
    Commented Jul 13, 2017 at 19:01
2

Maybe it may be useless now, but I found this link for the same problem that worked for me.

It suggests as permanent solution the disabling the fast startup in windows 8 and 10, and as a temporary solution the command sudo ntfsfix /dev/sdXY. Read the full post for a better understanding...

3
  • Hi @biayo try to edit you post adding the main information from the link you provide and what specifically worked for you. Tomorrow that page may be moved or deleted and we will finish without the contribution you try to give...
    – Hastur
    Commented Oct 29, 2018 at 13:26
  • "It suggests as permanent solution to disable the fast startup in windows 10", that's the solution. Sorry my crappy english.
    – biayo
    Commented Nov 2, 2018 at 14:48
  • ntfsfix worked like charm for me. Nothing else worked.
    – xZero
    Commented Nov 23, 2019 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .