NTFS3 file system kernel mode driver
 help / color / mirror / Atom feed
From: Linus Kardell <linus.kardell@gmail.com>
To: ntfs3@lists.linux.dev
Subject: Unable to properly read some files with ntfs3
Date: Fri, 22 Apr 2022 21:42:37 +0200	[thread overview]
Message-ID: <780a74c2-5b01-8b99-6c91-1b64397ce6d3@gmail.com> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 2314 bytes --]

I'm trying out the ntfs3 kernel driver on OpenSUSE Tumbleweed, but I'm 
unable to read some files. I also posted about this here: 
https://reddit.com/r/openSUSE/comments/u693vm/no_such_file_or_directory_when_reading_some_files/, 
https://bugzilla.kernel.org/show_bug.cgi?id=215864 and 
https://bugzilla.kernel.org/show_bug.cgi?id=215864

The files that it happens to are a few GiB in size. It doesn't fail 
immediately, rather when I read it with dd status=progress the first 
time it reads a bit into the file (a few MiB or over a hundred MiB, 
depending on the files, but it seems to always be the same distance for 
the same file), and then throws "No such file or directory". Based on 
strace it gets ENOENT from a read call, after it's already read 
megabytes of data from the same fd.

On subsequent reads, it gets through the whole file. Only, it doesn't 
really, because the resulting content is wrong. So it never truly reads 
the whole file, but only sometimes throws an error (when it's not in 
disk cache?). The same file is always read correctly with ntfs-3g.

Also, not sure if related, but after I've mounted and unmounted a few 
times with ntf3 and ntfs-3g, ntfs3 starts throwing errors saying:

"mount: /windows/d: wrong fs type, bad option, bad superblock on 
/dev/sda1, missing codepage or helper program, or other error."

and refuses to mount it unless I add -o ro. It still works properly in 
ntfs-3g.

The filesystem has compression enabled, in case that matters ("Compress 
this drive to save disk space" is checked in the file system settings in 
Windows), though the files should be incompressible, as they're gzipped 
or random.

I tried running chkdsk from Windows, but that did not fix it (except I 
think it temporarily got rid of the "wrong fs type..." mount error).

I can reproduce it by dd:ing 4 GiB of /dev/urandom to a file and copying 
it onto the NTFS partition while mounted with ntfs-3g, and then trying 
to read the file while mounted with ntfs3.

My full mount options are:
ntfs-3g: fmask=113,dmask=002,gid=100,noatime,windows_names,compression
ntfs3: iocharset=utf8,fmask=113,dmask=002,gid=100,noatime

uname -r: 5.17.2-1-default
rpm -q ntfsprogs: ntfsprogs-2021.8.22-2.2.x86_64
rpm -q ntfs-3g: ntfs-3g-2021.8.22-2.2.x86_64

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 1229 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

             reply	other threads:[~2022-04-22 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 19:42 Linus Kardell [this message]
2022-04-22 19:59 ` Unable to properly read some files with ntfs3 Linus Kardell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=780a74c2-5b01-8b99-6c91-1b64397ce6d3@gmail.com \
    --to=linus.kardell@gmail.com \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox