ntfs-3g Love
August 11th, 2006//-->
Yesterday I was back again at the Parish to continue working on arete, the newly-installed Ubuntu Dapper machine. I was back because I had to continue migrating my father’s files from Windows to the new setup, since he wanted to try out Scribus as a replacement for his MS Publisher system for writing the parish newsletter. Anyhow, this reason, coupled with my own urge to seriously try out Ubuntu Dapper (I was running Kubuntu Dapper, doh) made me spend the whole day trying out something new.
As I was looking at Dad’s documents folder, I realized that I had a problem: there are so many files here, some of them sizing up from tens to hundreds of megs (actually, stuff worked on thru the Gimp,) and knowing well that disk drive space was at a premium (arete had an 80G drive, yes, but nevertheless its already cramped,) I simply couldn’t accept copying the files from the XP’s NTFS C:\ to arete’s ext3 /home. Moving wasn’t an option either; although Dad would very much like to try out Ubuntu, he still had some projects (especially the newletter) that needed, uhm, proprietary software to work (sigh.) Thus, remembering that Linux already had some way of reading NTFS partitions, I promptly Googled about it.
I also knew that the Linux-NTFS guys (who made the ntfsprogs suite and kernel module) were already working on getting full read/write NTFS support on Linux, but it didn’t occur to me that they were able to get a working implementation done so soon…
Enter ntfs-3g: the third generation Linux-NTFS driver. Weighing in at around 550K, this seems to be the one thing that I need for my problem. From the looks of it, ntfs-3g can both read from and write to NTFS partitions, allowing one to create, delete, and update files and directories on the system; it can even allow access to certain metadata that even Windows XP hides from its users. Furthermore, its built from the ground up as a filesystem-in-userspace driver, using the Linux fuse subsystem. It certainly looks very attractive indeed.
So, being the sysadmin for arete that I was, I quickly decided to give ntfs-3g a try. After all, it was a simple matter of grabbing the tarball, then reading the README, then doing the three-step tango of ./configure; make; sudo make install, then calling ntfs-3g /dev/hda1 /media/hda1 -o umask=007 as root.
Right?
Wrong. I quickly ran into a trio of subproblems: first, I needed fuse (>= 2.5.0); the one Dapper had on its official archives was 2.4.2 . So, naturally, I had to make a quick backport of the fuse source from Edgy (2.5.3), but I at this point I ran into the second problem: for Eggy’s fuse to get busted, I needed the new makedev (2.3.1) as well. Forgetting to do apt-get -f install for the moment, I grabbed Edgy’s makedev and proceeded backporting it, which ran me against the last problem: I also needed the newest sysvinit (2.86.ds1). In short, I needed to do a trio of backports first before being able to build ntfs-3g. My own fuse was almost ready to explode.
Fortunately, everything went fine after the backports (thank goodness for my being a Debian package maintainer and MOTU,) so I didn’t break my own fuse after all. Soon after, I was reading and writing stuff to and from /media/hda1 without so much as batting an eyelash. Dad was definitely pleased, since that meant that he no longer had to dread the thought of having to maintain two separate document trees and cause him pain and gnashing of teeth. I was glad too, since I no longer had to dread the thought of having to hack on this today, causing me to disrupt my Summer of Code schedule.
But, being the packager that I was, I realized that I could make the world a better(?) place by turning ntfs-3g from a regular Joe source to a real Debian/Ubuntu package. While I was happily waiting for ntfs-3g’s build to complete, I happened to pass by a certain HOWTO on the Web using pre-built fuse and ntfs-3g Ubuntu packages. I grabbed those packages, and took a look at them, and while they were pretty much useful, the ntfs-3g package certainly did not look to pass the gold(?) standards of Debian and Ubuntu: the ntfs-3g package was a single binary package, shipping both a shared library and its headers, coupled with the working binaries. It had outdated FSF addresses too, which my bugging Lintian pointed out to me.
With some more extra time to spare on arete, I decided to go ahead and build proper a proper source package for ntfs-3g, producing the three binary packages ntfs-3g (containing ntfs-3g and mount.ntfs-3g,) libntfs-3g0 (depended on by the former package,) and libntfs-3g-dev (containing the include headers.) CDBS and debhelper definitely made this easy pickings, and made my life with ntfs-3g easier.
And, I’m going to make everyone else’s life with ntfs-3g easier, by making this package available for nit-picking.
I won’t pretend this to be getting into the official Debian and/or Ubuntu archives for the moment, since the upstream authors have explicitly stated that ntfs-3g will be eventually merged into the existing ntfsprogs suite, thereby making my packaging of ntfs-3g obsolete sometime soon; furthermore, the binary packages up there are built against Debian unstable and Ubuntu Edgy, so anyone looking for a Dapper solution can read this post first to avoid reinventing the wheel. But if anyone needs a good solution for NTFS read/write right now (or, if somebody else has time to kill in testing ntfs-3g,) then here’s a good one for you. Caveat emptor!
Ok, next up: finishing my SoC work…
August 12th, 2006 at 12:12 am
Hi,
My experience with NTFS access, Read or Write under Linux has always been bad. Heh, I am not really surprised, in the end this is the result of reverse engineering a closed proprietary thing, at least I think it is…
I even tried the Captive wrapper around the MS ntfs driver. Not really impressive.
So I decided to go the other way round: use a driver for Windows for a very well known and open FS: an ext2 driver for Windows.
http://www.fs-driver.org/author.html
The lack of source code availability is a bit bothering, but at least I have access from Windows to all my files, as they are hosted on the Linux side, th one used 99% of the time. It works extremely well.
November 20th, 2006 at 6:54 am
Hmm
Hi!
I wish I wasnt such a newbi but but… Everyone has to start sometime!
The thing is all this looks very nice but Im running Kubuntu Dapper and dont have a clue about fixing ntfs support for my machine!
I would love to have it but my skills and googling only led me to ubuntu versions.
Does there exist a for me easy-to-implement step-by-step howto to make this happen?
I would be happy for help!