Installing NTFS3 driver from 5.15 kernel

Hi,

I have a raspberry pi 4 and want to install the latest ntfs3 driver as it can lower cpu usage. I face some troubles since the commend make does not work, and it seems to require additional drivers for raspberry pi.

While I am checking other example of hardware drivers such as network/wifi, they have to install “kernel header files” for the pi model to make it work. Where can I find the “kernel header files” if it is needed.
Is there any timeline for osmc updating to 5.15 kernel?

Driver here:

To get C program essentials kits
sudo apt-get install build-essential

Installing program
git clone GitHub - rmnscnce/ntfs3: ntfs3 Linux kernel module by Paragon Software

I tried and it poped up error
make -j$(cat nproc) KVER=
make -j$(cat nproc) KVER=5.10

cat: nproc: No such file or directory
make -C /lib/modules/5.10.78-2-osmc/build M=/home/osmc/ntfs3 modules
make[1]: *** /lib/modules/5.10.78-2-osmc/build: No such file or directory. Stop.
make: *** [Makefile:46: all] Error 2

OS: OSMC_TGT_rbp4_20211129, Linux osmc 5.10.78-2-osmc

Thank you so much :slight_smile:

sudo apt-get install kernel-package rbp464-source-$(uname -r) rbp464-headers-$(uname -r) linux-source -y

Commend below did not work, its shows Package kernel-package is not available

sudo apt-get install kernel-package rbp464-source-$(uname -r) rbp464-headers-$(uname -r) linux-source -y

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package kernel-package is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source.

So I try
sudo apt install rbp464-source-$(uname -r) rbp464-headers-$(uname -r)
It installed successfully

After that I try to compile the NTFS3 C-based driver, it poped up more error, not just misidentifying cat commend as file or directory. I will research more on the debian/C issue.

make -j$(cat nproc) KVER=
cat: nproc: No such file or directory
make -C /lib/modules/5.10.78-2-osmc/build M=/home/osmc/ntfs3 modules
make[1]: Entering directory ‘/usr/src/rbp464-headers-5.10.78-2-osmc’
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
CC [M] /home/osmc/ntfs3/attrib.o
CC [M] /home/osmc/ntfs3/attrlist.o
CC [M] /home/osmc/ntfs3/bitfunc.o
CC [M] /home/osmc/ntfs3/bitmap.o
CC [M] /home/osmc/ntfs3/dir.o
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
CC [M] /home/osmc/ntfs3/fsntfs.o
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-msign-return-address=all’
CC [M] /home/osmc/ntfs3/frecord.o
gcc: error: unrecognized command line option ‘-msign-return-address=all’
gcc: error: unrecognized command line option ‘-msign-return-address=all’
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/attrlist.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/bitfunc.o] Error 1
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/dir.o] Error 1
gcc: error: unrecognized command line option ‘-msign-return-address=all’
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/attrib.o] Error 1
CC [M] /home/osmc/ntfs3/file.o
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-msign-return-address=all’
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/bitmap.o] Error 1
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
gcc: error: unrecognized command line option ‘-msign-return-address=all’
gcc: error: unrecognized command line option ‘-msign-return-address=all’
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/frecord.o] Error 1
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/fsntfs.o] Error 1
gcc: error: unrecognized command line option ‘-msign-return-address=all’
make[2]: *** [scripts/Makefile.build:280: /home/osmc/ntfs3/file.o] Error 1
make[1]: *** [Makefile:1825: /home/osmc/ntfs3] Error 2
make[1]: Leaving directory ‘/usr/src/rbp464-headers-5.10.78-2-osmc’
make: *** [Makefile:46: all] Error 2

Anyone knows dkms? Is the structure of osmc kernel same as the one in 2015

According to post in 2015,
OSMC includes a variety of external kernel modules which are not in the Linux kernel tree. Most of these are improved WiFi drivers. OSMC takes a slightly unconventional approach to distributing these modules. The most common approach is to use DKMS (Dynamic Kernel Module Support). When a new kernel is installed, DKMS will automatically compile

Yep that’s right command had my reminders in the post

I wouldn’t recommend using DKMS if you can avoid doing so.

Even if you install the NTFS kernel module, you’ll need to adjust UDisks to use it instead of the FUSE driver.

it looks like there are some cross compiling issue for the os & arm architecture. Finding solution on how to compile C make commend. From distrowatch, it is a 32bit armhf os.
Using commend uname -m, it shows aarch64.
So I guess kernel is 64, while the OS is 32bit. Is my understanding correct.

The problem seems to related to cross compiling with C language. As I am not an engineer, I guess this may be out of my depth. Still researching C compiling and your build system articles.

Will you include 5.15 kernel in your next update, it may be easier for people to increase ntfs performance.

Thank you very much for your kind reply.

We will stay on 5.10 for a long time on Raspberry Pi.

Conclusion: Stick to Ext4 or ExFat, the new NTFS driver does not provide much advantage according to Reddit
DO NOT USE NTFS3 within 5.15 kernel

  • ntfs-3g’s runtime was 6387 seconds, versus kernel 5.15 ntfs3’s 8105 seconds,
  • i.e. the user space ntfs-3g was about 21% faster overall than the 5.15 kernel space ntfs3
  • The new kernel driver has several problems with data corruption confirmed by multiple people (destroying whole partitions, NTFS junctions, and individual folders), lack of TRIM support, and the kernel NTFS driver developers expect to find many more bugs now that the release has gone public:

I plan to maintain the option to use the pi hard drive to replace my increasingly old computer drive (Windows, ~35k hours) in the future. So I should choose a format which does not have much performance impacts on pi and at the same time I can swap out drives in future. I believe exfat+ext4 should be best for my use case. If I need to migrate to windows, shall use exfat as a intermediary format.

I was deceived by the marketing material by Paragon Software. As the driver is endorsed by Linux founder Linus Torvalds. I thought it must be good. But the review shows it perform badly on Fedora platform.