NTFS3 Kernel Module

Technical issues/questions of an intermediate or advanced nature.
tome
Contributor
Contributor
Posts: 676
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Russia is causing the immense damage to humanity
Contact:

NTFS3 Kernel Module

Post#46 by tome » 15 Apr 2024, 08:31

I decided to use ntfs3 at start of porteus, here --> https://www.dropbox.com/sh/gdzuwmrramlv ... kfYbZMrUra are:
1. initrd-tm3.xz that use ntfs3 at boot
2. udev-fstab-update for ntfs3 - with this new ntfs mounts after boot would be also done by ntfs3 driver instead of ntfs-3g (without it ntfs3 at boot only if auto/automount cheatcode)
3. UFSD-utils-from-Root-Mounter-for-Android-by-Paragon-....xzm - some utils like fsck for ntfs, mount_ufsd_fuse - for example to test its speed

Changes to booting of Porteus:
4. If fsck cheatcode is used then ntfs partitions are check with paragon chkntfs -a -f
5. and be pressing any letter(key) while blue background is displayed you can stop booting to read easy output of fsck commands
6. this initrd includes also cheatcodes from this topic:
New initrd.xz and cheatcodes (boot parameters) for Porteus

7. ntfs-3g provide also mount.lowntfs-3g - it uses a lower-level FUSE API, and it seems it's faster than mount.ntfs-3g (amazing?, as fast as the ext4!?)
8. Microsoft NTFS by Tuxera (not ntfs-3g) is a commercial-grade file system implementation that is 6X faster than open-source alternatives.

ad. 1) probably uid=1000,gid=100 would be useful option at boot, now is's omitted
You have mind and feelings. Be wise and clever.

fulalas
DEV Team
DEV Team
Posts: 2056
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

NTFS3 Kernel Module

Post#47 by fulalas » 15 May 2024, 12:29

@tome, have you managed to mount a NTFS folder (using ntfs3 driver) into the union without making the whole folder in union read-only?

I know we can do that using folders from traditional POSIX partitions, like ext4, but I'm failing to so using NTFS. The result is either read-only in union (which is useless) or writable but then it has whiteouts, changes, chaos.

rych
Warlord
Warlord
Posts: 631
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

NTFS3 Kernel Module

Post#48 by rych » 16 May 2024, 13:03

I'm on ntfs3 and unfortunately the following occasionally happens to this day. When I occasionally have a system freeze (I think due to running out of RAM having no swap partition/file set up) and can only restart by long-pressing the power-button, there are NTFS partition problems. Often it's a matter of checking it under Windows and the chkdsk /f finds no errors. But sometimes there are recovered chunks of files that were open(?) at the moment of powering off.

This may be because: "the NTFS3 driver still does not fully support NTFS journaling, i.e. if you lose power to a mounted disk, there's a good chance you'll have corruption" and "a power outage/unclean mount was likely to corrupt something, leaving inconsistencies".

Indeed I remember ntfs-3g was more forgiving and gracious in such situations. I'll keep using ntfs3 for now as it gives me the speed of ext4 but perhaps lowntfs-3g is a better alterative, I'll try to find out.
Last edited by rych on 16 May 2024, 14:44, edited 1 time in total.

fulalas
DEV Team
DEV Team
Posts: 2056
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

NTFS3 Kernel Module

Post#49 by fulalas » 16 May 2024, 13:13

@rych, which kernel are you using?

Have you managed to recover the corrupted files? Have you tried using chkufsd posted by tome (inside initrd)?

rych
Warlord
Warlord
Posts: 631
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

NTFS3 Kernel Module

Post#50 by rych » 16 May 2024, 14:24

fulalas wrote:
16 May 2024, 13:13
which kernel are you using?

Code: Select all

root@porteus:~# uname -r
6.6.20-porteus
fulalas wrote:
16 May 2024, 13:13
Have you managed to recover the corrupted files?
I didn't need them, they are synched from USB in my scenario anyway. Still it's disturbing. Windows (?) when repairing (?) the drive created some folders C:\found.001 or something filled with lost of useless chunks. Anyway, all is now fixable with

Code: Select all

chkntfs /dev/disk/by-label/Windows -f
Although I took it from his UFSD-utils-from-Root-Mounter-for-Android-by-Paragon-2017-2024-04-15_tm.xzm and not the initrd...

Thank you tome, and thanks jjr for communicating the chkntfs (chkufsd) to us. Not sure if it should go inside initrd, but I'll keep it as the above module at all times when using ntfs3. Ntfs3 will occasionally corrupt things, but chkntfs fixes them beautifully. Good partnership :)

fulalas
DEV Team
DEV Team
Posts: 2056
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

NTFS3 Kernel Module

Post#51 by fulalas » 16 May 2024, 19:56

@rych, maybe you should try a newer kernel because I heard many fixes related to ntfs3 have been merged over the last months.

I have been using ntfs3 on kernel 6.9 for 2 days and so far so good. Unfortunately I can't mount NTFS folders into union without having the issues I mentioned here.

EDIT: one thing that is simply amazing regarding ntfs3 is that it allows compatibility with POSIX, meaning we can finally have permission settings. :)

rych
Warlord
Warlord
Posts: 631
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

NTFS3 Kernel Module

Post#52 by rych » 17 May 2024, 09:18

Thanks fulalas, will do for sure, but maybe after it matures a bit further? You've reported this:
fulalas wrote:
13 May 2024, 16:31
Kernel 6.9 is out. However, I noticed a 10% performance drop

fulalas
DEV Team
DEV Team
Posts: 2056
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

NTFS3 Kernel Module

Post#53 by fulalas » 24 May 2024, 21:58

After a week testing ntfs3, my opinion is that it's great only when the machine behaves 100% stable all the time:
1. it's considerably faster than ntfs-3g
2. it provides some POSIX compatibility
3. it's reliable (again, when the machine is 100% stable)
4. it's native to the kernel, not requiring any additional package

However, at the minimum disturbance in the stability of the machine things might get messy:
1. forced reboots, including hitting ctrl+alt+del in a tty, might corrupt files or even the whole partition to the point that sometimes it can't be recognized by the system
2. annoyingly, it doesn't provide an official tool to fix any of that. Using ntfs-3g fix utility doesn't solve these problems, requiring either Windows tools or chkufsd (which is not native and it's not even open source)
3. POSIX compatibility doesn't look 100% at the moment (kernel 6.9.1), and AUFS requires the parameter 'icex' to ignore invalid permissions when a NTFS folder/partition is mounted into union during boot time, otherwise the mounted folders will become read-only (more here)
4. the migration from ntfs-3g to ntfs3 (and vice-versa) will break absolutely all symlinks

TL;DR: it's not ready for production, only for enthusiasts.

Post Reply