星期五, 5月 17, 2013

installing Paragon NTFS & HFS driver

Recently, I bought a portable HD, which came NTFS-formatted. At first I considered formatting it to XFS or ext4 but it occurred to me that I might have to mount it with windows from time to time (although I don't have many windows PCs and will not have more than one unless necessary.)

Rather than trying to fix/install anything on the stupid Windows to support xfs/ext4, I prefer messing up with my linux which, in some way, is more intuitive for me than dealing with those mysterious bugs in windows.

There's a ntfs driver called ntfs-3g. It is fine, but somehow too slow. I don't know why it has been staying on FUSE all these years, or if staying on FUSE is the reason that makes it so slow. There's a couple of commercial alternatives that come into play: Tuxera(which I suspect is the reason that ntfs-3g being so slow) and Paragon but only the later one offers a free driver for linux, so I gave it a try and it works pretty well so far.

Here's how I do it:

First, download the source from Paragon: http://www.paragon-software.com/home/ntfs-linux-per/
it's free, and contains only the driver for read/write without any utilities for the FS. For thos missing parts (formatting, wiping, fsck ..), they will not be use as often so I suppose ntfs-3g will do well here.

Since the driver only support up to kernel 2.6.28,  I figured that I had to patch it to compile for the latest kernel. Luckily, someone from the Arch community has already done the work:

to apply those patches, download and untar the tarball: 

then change to the root directory of the Paragon driver and run the following commands:
patch -p1 < path_to_ufsd-module/paragon-ufsd-3.6.patch
patch -p1 < path_to_ufsd-module/paragon-ufsd-arch.patch
patch -p1 < path_to_ufsd-module/paragon-ufsd-3.8.patch
./configure --prefix=/usr
make driver
sudo install -D ufsd.ko /lib/modules/$(uname -r)/extra/ufsd.ko
sudo depmod -a
sudo modprobe ufsd


and should be ready to go!
to mount a ntfs drive(assuming /dev/sdb1)
mount -tufsd /dev/sdb1 /media/disk


notes
1. that the module is probably not auto-loaded upon boot. To make it, add ufsd to /etc/modules.
2. when kernel is updated, you'll have to build/install this module again(or make a dkms configuration to automatically rebuild it like I do).

2 則留言:

Kevin c 提到...

Can you install the driver in Tomato in your RT-N16?

Freehaha Sun 提到...

Hi,
for that to work you probably need the paragon ntfs driver for embedded linux which i don't have currently...