środa, 2 listopada 2011

OpenIndiana and ntfs-3g

Update:
I have patch ready to change unhelpful on OpenIndiana, SmartOS and other illumos distributions mention of modprobe to suggest:
/usr/sbin/add_drv -m 'fuse 0666 root sys' fuse
Still have to find out, why the heck link was not created in the first place. :/


----------------------------------
I recently had to use ntfs formatted USB drive under OpenIndiana and run into a small problem.
I shamelessly used gparted to find which device maps to my usb disk. Then had following session with ntfs-3g binary:

ntfs-3g /dev/dsk/c2t0d0p1 /mnt/
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
fuse: device not found, try 'modprobe fuse' first

Both fuse and ntfs-3g are installed from repositories:
sfe                                   origin   online   http://pkg.openindiana.org/sfe/
sfe-encumbered                        origin   online   http://pkg.openindiana.org/sfe-encumbered/


After some digging around and asking on IRC I decided that either no one had this problem or no one bothered to post solution. modinfo showed me that fuse module is loaded, after all:

258 fffffffff7edd000   e680 290   1  fuse (fuse driver)
258 fffffffff7edd000   e680  28   1  fuse (filesystem for fuse)


However ntfs-3g itself didn't say anything useful. It also suggested to use modproble, which is just ridiculous on OpenIndiana. I decided to truss it.


open64("/dev/fuse", O_RDWR)       Err#2 ENOENT


One clue closed I downloaded spec file for fuse from http://pkgbuild.sourceforge.net/spec-files-extra/ and checked for %post step:

%post
( retval=0;
  /usr/sbin/add_drv -m 'fuse 0666 root sys' fuse || retval=1;
  [ "$retval" = 0 ] && ln -s /devices/pseudo/fuse@0:fuse /dev/fuse || retval=1;
  exit $retval
)


I did check if /devices/pseudo/fuse exists (it did) and then created /dev/fuse link to it. Then ntfs-3g worked like a charm.

Cheers!

2 komentarze:

Anonimowy pisze...

This saved me a couple of hours of work. Thanks!

Ganapathy Subramanian pisze...

Spent 5 hrs in an attempt to mount ntfs partition which included 1 hr of finding solution to this issue and finally found yours! Thank you so much!! It worked just like that!!!