You are not logged in.

#1 2023-04-12 22:39:22

deltatux
Member
Registered: 2023-04-12
Posts: 3

NTFS3 - New files blank?

Hi all,

Noticed something quite peculiar in the past few months (since February) where any new files that I create on an NTFS partition, the file gets created but whenever I try to put data into it, it doesn't write into the file. This issue doesn't seem to affect existing files for some reason.

So for example, if I do the following:

echo "test123" > test.txt

The file system will look like this:

total 64
drwxr-xr-x 1 root   root       0 Apr 12 18:18 .
drwxrwxrwx 1 root   root   65536 Apr 12 18:18 ..
-rw-r--r-- 1 root   root       0 Apr 12 18:18 test.txt

This happens no matter which directory it happens in.

I'm not sure what's causing this, I have tried different mount options in ntfs3 but it doesn't seem to fix the issue. Here are my mount options:

/dev/sda2 on /mnt/workspace type ntfs3 (rw,nosuid,nodev,noexec,relatime,uid=0,gid=0,iocharset=utf8,prealloc,user)
/dev/sda1 on /mnt/data type ntfs3 (rw,nosuid,nodev,noexec,relatime,uid=65534,gid=984,fmask=0113,dmask=0002,iocharset=utf8,prealloc,user)

The /mnt/data mount options were my original mount options, to try to troubleshoot the issue, I tried the /mnt/workspace mount options but that didn't seem to fix the issue.

Currently running Arch Linux on kernel 6.2.10. Has anyone come across this issue before?

Thanks!

Offline

#2 2023-04-13 00:09:06

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: NTFS3 - New files blank?

Does that happen immediately or after reboot?

Do you use hibernation (suspend to disk) in either Linux or Windows (fast boot or whatever they call it)?

Offline

#3 2023-04-13 03:36:46

deltatux
Member
Registered: 2023-04-12
Posts: 3

Re: NTFS3 - New files blank?

frostschutz wrote:

Does that happen immediately or after reboot?

Do you use hibernation (suspend to disk) in either Linux or Windows (fast boot or whatever they call it)?


Thanks for the response. It happens immediately, no data actually gets written to the file even though file was created.

No, I don't use suspend to disk in either OS.

What I have found is that by downgrading from 6.2 to 6.1 LTS, the problem seems to be fixed. I think there's either a bug in the Linux 6.2 branch or it might be specific to the Arch Linux 6.2 kernel, not sure which one. There doesn't seem to be any kernel logs generated from ntfs3 driver relating to this.

Offline

#4 2023-04-13 06:31:53

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: NTFS3 - New files blank?

This issue doesn't seem to affect existing files for some reason.

So

echo "test123" > test.txt
echo "test123" > test.txt

writes the contents into the file?

Or just

echo "test123" > test.txt
echo "test123" >> test.txt

No, I don't use suspend to disk in either OS.

You don't, but windows does.
3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Offline

#5 2023-04-16 04:08:56

Interpause
Member
Registered: 2023-04-16
Posts: 2

Re: NTFS3 - New files blank?

Hello, new to these forums. Actually a Gentoo user but nevermind since I am running into the same issue as OP. On my system, I have definitely disabled hibernation. I only started having this issue recently, before, ntfs3 worked as expected for months already. Likely, this issue isn't distro specific and something kernel level?

Offline

#6 2023-04-16 04:14:29

deltatux
Member
Registered: 2023-04-12
Posts: 3

Re: NTFS3 - New files blank?

seth wrote:
This issue doesn't seem to affect existing files for some reason.

So

echo "test123" > test.txt
echo "test123" > test.txt

writes the contents into the file?

Or just

echo "test123" > test.txt
echo "test123" >> test.txt

No, I don't use suspend to disk in either OS.

You don't, but windows does.
3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Any files created on an NTFS partition with kernel 6.2 is affected it seems. Files created on prior kernel series can be modified without issues.

Downgrading it to Linux 6.1 LTS seems to have solved the issue. There's likely a bug in the NTFS3 filesystem driver in Linux 6.2 that creates files that you cannot append data to it.

Interpause wrote:

Hello, new to these forums. Actually a Gentoo user but nevermind since I am running into the same issue as OP. On my system, I have definitely disabled hibernation. I only started having this issue recently, before, ntfs3 worked as expected for months already. Likely, this issue isn't distro specific and something kernel level?

Ah so it looks to be a general Linux 6.2 regression. Not sure how to report kernel bugs especially without logs but hopefully someone else more knowledgeable about kernel development can assist here.

Last edited by deltatux (2023-04-16 04:16:36)

Offline

#7 2023-04-16 10:57:16

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: NTFS3 - New files blank?

Did you check integrity with chkdsk?


sys2064

Offline

#8 2023-04-16 11:49:40

seth
Member
Registered: 2012-09-03
Posts: 50,970

Offline

#9 2023-04-17 02:40:56

YAOMTC
Member
Registered: 2010-02-23
Posts: 204

Re: NTFS3 - New files blank?

I had to force restart and now that drive is unreadable by ntfs3.

EDIT: Had to install ntfs-3g and use `ntfsfix` as root, which allowed me to access the filesystem, but ntfs3 still had issues with it being in fstab so I switched that to use ntfs-3g.

Last edited by YAOMTC (2023-04-17 03:34:18)

Offline

#10 2024-01-27 14:54:21

Interpause
Member
Registered: 2023-04-16
Posts: 2

Re: NTFS3 - New files blank?

Sorry for necroposting, but I figured it out. Currently on kernel version 6.7.1, ensure you don't have `sys_immutable` in your `/etc/fstab`. Separately, disable drive compression via Windows. You don't have to wait for it to decompress everything, just whatever flag ntfs uses to indicate files should be compressed on write needs to be off. Now file read writes work as expected...

EDIT: Bug report found, but not for sys_immutable, guess thats a separate bug. maybe not reported yet?
https://bugzilla.kernel.org/show_bug.cgi?id=218180#c27

Last edited by Interpause (2024-02-03 14:05:06)

Offline

Board footer

Powered by FluxBB