2006-12-22

NTFS3g on OpenSuse 10.2

I have installed openSuSE 10.2 on my brand new computer (bought more than a month ago).

I'm happy with openSuSE 10.2, YaST has been improved, it gives more feedback to the user. Now there is an native KDE updater, so I don't have to install a GNOME Mono application, the source repository knows about YUM repositories, and so on and so forth.

After installing it I've noticed that my Windows XP wasn't booting anymore. The fact was that I had two NTFS partitions, the first had the boot loader and boot.ini and the second had Windows files. The second partition number had shifted after creating two linux partitions, so Windows boot loader got confused and refused to work.

Well I said, it's easy, all I have to do is to modify boot.ini and change multi(0)disk(0)rdisk(0)partition(2) to multi(0)disk(0)rdisk(0)partition(4). There was one problem, that the file resided on a NTFS file system. Linux has readonly access by default.

Eeeek, but then I remembered that there is something new out there ntfs-3g that can mount read/write a NTFS file system.

I've searched the net and found that I had to install fuse, fuse-ntfsprogs and ntfs-3g packages. The first two came with openSuSE 10.2, the latter from GURU 3rd party repository. GURU had a ntfs-3g version from 20061115, which was too old for fuse 2.6.0 that came with openSuSE 10.2. Eeeek.

The solution was to get the latest and greatest sources and the RPM spec files from fuse and ntfs-3g to create my own rpm packages.

I've got fuse 2.6.1 and ntfs-3g 20061218, after hacking the RPM spec files I've managed to create two nice rpm packages. The problem was that the command ntfs-3g /dev/hda1 /windows/C was still failing. Eeeek again.

The problem was with the fuse kernel module, it was too old. openSuSE 10.2 fuse spec file didn't create a kernel module because kernel included the fuse module. I've hacked fuse RPM spec file to --enable-kernel-module, all nice until the very last step when the packages were to be created. Because fuse.ko module was still in RPM's database, RPM could not create a new module that contained fuse.ko because of some incompatibilities later on. Tired of eeeking.

Solution was to copy the new fuse.ko module and store it somewhere, then put back --disable-kernel-module in fuse RPM spec and run a rpmbuild -ba fuse.spec. Then I've copied fuse.ko over the one from /lib/modules/linux-2.6.18.../kernel/fs/fuse/fuse.ko.
After installing fuse and fuse-devel packages I've build ntfs-3g package, installed it and the command: ntfs-3g /dev/hda1 /windows/C was working!

In order to always mount read/write I've modified /etc/fstab and instead of ntfs I've put ntfs-3g and removed the ro (read only) flag from the next option on the same line.

After modifying boot.ini and a reboot I got my Windows XP back!

In conclusion, I like openSuSE they didn't made all the things easy, most of them are easy but some issues are still to be fixed, like the one above. One can say that this is the price to pay for bleeding edge software, but every now and then it's fun to hack something, to remember the good old days of hacking Slackware to do the things you wanted.
Post a Comment