NSLU2-Linux
view · edit · print · history

HowTo.BuildNTFS3G History

Hide minor edits - Show changes to markup

October 23, 2008, at 06:45 AM by MoD --
Changed line 178 from:

Probably. Look at http://forum.openwrt.org/viewtopic.php?pid=75150#p75150

to:

Probably. Look at http://forum.openwrt.org/viewtopic.php?pid=75156

October 22, 2008, at 07:35 AM by MoD --
Added lines 177-178:

Probably. Look at http://forum.openwrt.org/viewtopic.php?pid=75150#p75150

October 03, 2008, at 11:38 PM by mkurtz -- Update and final thoughts...
Changed lines 134-135 from:

So far, I've had mixed results using the NTFS-3G driver. Occasionally the ntfs-3g user-space executable crashes and the drive goes away until remounted. I've tried to narrow down the issue and this is what I have observed:

to:

So far, I've had mixed results using the NTFS-3G driver. Occasionally the ntfs-3g user-space executable crashes or just locks up and the drive goes away (or locks any process that attempts to access it) until remounted. I've tried to narrow down the issue and this is what I have observed:

Changed line 176 from:

Once I determine if this really fixes the crashing, I'll integrate it into the above instructions...

to:

Update: This doesn't appear to do the trick for me... Anyone else have any luck?

October 03, 2008, at 11:36 PM by mkurtz -- Update...
Changed lines 134-135 from:

So far, I've had pretty good results using the NTFS-3G driver, and I am using it in favor of the Linksys provided driver. However, occasionally the ntfs-3g user-space executable crashes and the drive goes away until remounted. It may be due to sharing the drive over AFP (it didn't seem to crash when just using SMB). One thing that might fix this is to not use the "noatime" parameter when mounting the drive at startup. I will try to continue to troubleshoot this issue, and if anyone has any information, please share!

to:

So far, I've had mixed results using the NTFS-3G driver. Occasionally the ntfs-3g user-space executable crashes and the drive goes away until remounted. I've tried to narrow down the issue and this is what I have observed:

  1. It seems to happen more often when using AFP instead of SMB, but it happens with both
  2. Using the 2.6.0-PRE fuse driver doesn't seem to help, nor does the patch below
  3. Using the latest ntfs-3g code doesn't seem to help either
  4. If you are experiencing crashes, you may want to plug your NTFS drive into a regular windows installation and do a disk check/repair on it

For the most part, I am giving up on getting it to be stable. The Unslung kernel is too old (2.4) to run the fuse driver reliably, so I am going to switch to another distro with a 2.6 kernel. I would suggest other Unslung users try this out and see if they get better results.

August 24, 2008, at 12:41 PM by mkurtz -- added fix for occasional crashing!
Changed lines 154-155 from:
        err = get_user_pages(current, current->mm, cs->addr, 1, cs->write,

0,

to:
        err = get_user_pages(current, current->mm, cs->addr, 1, cs->write, 0,
August 24, 2008, at 12:40 PM by mkurtz -- Added fix for occasional crashing!
Added lines 136-170:

Update to fix crashing?

I think I have a patch that fixes the remaining instability issues. Apply the following patch to dev.c in the fuse source code before compiling:

--- dev.c.org   2006-05-03 17:12:39.000000000 +0200
+++ dev.c       2006-05-03 17:24:53.000000000 +0200
@@ -489,6 +489,7 @@
 static int fuse_copy_fill(struct fuse_copy_state *cs)
 {
        unsigned long offset;
+       struct vm_area_struct *vma;
        int err;

        unlock_request(cs->fc, cs->req);
@@ -502,13 +503,14 @@
        }
        down_read(&current->mm->mmap_sem);
        err = get_user_pages(current, current->mm, cs->addr, 1, cs->write,
0,
-                            &cs->pg, NULL);
+                            &cs->pg, &vma);
        up_read(&current->mm->mmap_sem);
        if (err < 0)
                return err;
        BUG_ON(err != 1);
        offset = cs->addr % PAGE_SIZE;
        cs->mapaddr = kmap_atomic(cs->pg, KM_USER0);
+       flush_cache_page(vma, cs->addr); //, page_to_pfn(cs->pg));
        cs->buf = cs->mapaddr + offset;
        cs->len = min(PAGE_SIZE - offset, cs->seglen);
        cs->seglen -= cs->len;

Once I determine if this really fixes the crashing, I'll integrate it into the above instructions...

August 17, 2008, at 06:41 PM by mkurtz -- Added Troubleshooting section, updated NTFS-3G version number
Changed lines 9-10 from:

Since Unslung runs a 2.4 kernel, we have to use FUSE v2.5.3 and NTFS-3G v1.2531.

to:

Since Unslung runs a 2.4 kernel, we have to use FUSE v2.5.3 - Try to use the latest version of NTFS-3G which is v1.2812 as of this writing.

Changed line 97 from:
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
to:
  • Download ntfs-3g-1.2812.tgz and untar it to /usr/local/src
Changed lines 132-135 from:
to:

Troubleshooting

So far, I've had pretty good results using the NTFS-3G driver, and I am using it in favor of the Linksys provided driver. However, occasionally the ntfs-3g user-space executable crashes and the drive goes away until remounted. It may be due to sharing the drive over AFP (it didn't seem to crash when just using SMB). One thing that might fix this is to not use the "noatime" parameter when mounting the drive at startup. I will try to continue to troubleshoot this issue, and if anyone has any information, please share!

August 17, 2008, at 06:31 PM by mkurtz -- Added proper Usage section
Changed lines 108-111 from:

Okay this is not a good solution for usage yet, as it doesn't work through reboots, but once I have the time to set up a permanent solution, I will update this section

  • insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
to:

I like to do my custom startup stuff in /unslung/rc.local so open your favorite editor and add the following, changing /dev/sdb1 to whatever drive you want to use

Changed lines 111-115 from:

/sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o

to:
  1. !/bin/sh

/bin/umount /dev/sdb1 /sbin/insmod fuse /bin/ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1 -o rw,noatime

Changed lines 118-120 from:
  • make sure you unmount any NTFS drives that are already mounted
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuration
to:

If you are creating your script from scratch, don't forget to make the script executable:

Changed line 121 from:

ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1

to:

chmod a+x /unslung/rc.local

Changed lines 124-127 from:

This should mount your NTFS drive using the new NTFS-3G driver.

To verify run "mount" and it should say something similar to:

to:

Reboot and this should mount your NTFS drive using the new NTFS-3G driver.

To verify, run "mount" and it should say something similar to:

July 28, 2008, at 01:55 AM by mkurtz -- Forget about the width problem...
Changed lines 55-56 from:

./configure --with-kernel= /usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt

to:

./configure --with-kernel= /usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt

July 28, 2008, at 01:54 AM by mkurtz -- Fix for width problem?
Changed lines 55-56 from:
 ./configure --with-kernel= /usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
to:

./configure --with-kernel= /usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt

July 28, 2008, at 01:53 AM by mkurtz -- Fix for width problem?
Changed lines 54-56 from:
[@
 ./configure --with-kernel=

/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt

to:
[@
 ./configure --with-kernel= /usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
July 28, 2008, at 01:52 AM by mkurtz -- Fix for width problem?
Changed lines 55-56 from:
 ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
to:
 ./configure --with-kernel=

/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt

July 28, 2008, at 01:51 AM by mkurtz -- Formatting updates
Changed lines 20-21 from:
  • Make a /usr/local/src directory
to:
  • Make a /usr/local/src directory
Added line 27:
Added line 34:
Added line 40:
Added line 47:
Added line 53:
Added line 59:
Added line 71:
Added line 80:
Changed lines 85-86 from:
  • If all goes well, you will have fuse.o in the directory. Copy this file from the development machine to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
to:
  • If all goes well, you will have fuse.o in the directory. Copy this file from the development machine to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
Changed lines 92-93 from:
 --> [@
to:
[@
Changed line 97 from:
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
to:
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
Added line 99:
Added line 111:
Added line 118:
Added line 126:
July 28, 2008, at 01:46 AM by mkurtz -- Formatting updates
Deleted line 17:
Deleted line 18:
Deleted line 19:
Deleted line 41:
Changed line 57 from:
to
to:
to
Changed lines 83-84 from:
          ipkg install optware-devel
to:
 --> 
ipkg install optware-devel
Deleted line 87:
Deleted lines 88-96:
          ./configure
          make
          make install

Usage

Okay this is not a good solution for usage yet, as it doesn't work through reboots, but once I have the time to set up a permanent solution, I will update this section

  • insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
Changed lines 90-92 from:

/sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o

to:

./configure make make install

Changed lines 95-97 from:
  • make sure you unmount any NTFS drives that are already mounted
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuration
to:

Usage

Okay this is not a good solution for usage yet, as it doesn't work through reboots, but once I have the time to set up a permanent solution, I will update this section

  • insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
Changed line 101 from:

ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1

to:

/sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o

Changed lines 104-106 from:

This should mount your NTFS drive using the new NTFS-3G driver.

To verify run "mount" and it should say something similar to:

to:
  • make sure you unmount any NTFS drives that are already mounted
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuration
Changed line 107 from:

/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)

to:

ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1

Changed lines 110-117 from:
to:

This should mount your NTFS drive using the new NTFS-3G driver.

To verify run "mount" and it should say something similar to:

/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
July 28, 2008, at 01:44 AM by mkurtz -- Formatting updates
Changed line 24 from:
 --> [@
to:
[@
Changed line 61 from:

to

to:
to
July 28, 2008, at 01:43 AM by mkurtz -- Formatting updates
Changed lines 23-25 from:
  • Make a /usr/local/src directory
          mkdir /usr/local/src
to:
  • Make a /usr/local/src directory
 --> 
mkdir /usr/local/src
Changed lines 29-31 from:
          mkdir /usr/local/src/unslung
          cd /usr/local/src/unslung
to:
 mkdir /usr/local/src/unslung
 cd /usr/local/src/unslung
Changed lines 35-36 from:
          wget --cache=off http://www.nslu2-linux.org/Makefile
to:
wget --cache=off http://www.nslu2-linux.org/Makefile
Changed lines 40-46 from:
          make setup-host-ubuntu
  • Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
  • cd to fuse-2.5.3/kernel
          cd /usr/local/src/fuse-2.5.3/kernel
to:
make setup-host-ubuntu
  • Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
  • cd to fuse-2.5.3/kernel
    cd /usr/local/src/fuse-2.5.3/kernel
    
Changed lines 52-53 from:
          ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
to:
 ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
Changed lines 57-58 from:
          CC = gcc
          LD = ld
to:
CC = gcc
LD = ld
Changed lines 62-64 from:
          CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
          LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
to:
CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
Added line 68:
[@
Changed lines 73-74 from:
to:

@]

Changed lines 76-79 from:
          make
  • If all goes well, you will have fuse.o in the directory. Copy this file from the development machine to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
to:
make
  • If all goes well, you will have fuse.o in the directory. Copy this file from the development machine to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
Changed lines 89-90 from:
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
to:
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
Changed lines 101-102 from:
          /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
to:
/sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
Changed lines 108-109 from:
          ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
to:
ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
Changed lines 115-117 from:
          /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
to:
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
July 28, 2008, at 01:38 AM by mkurtz -- Formatting updates
Changed lines 24-25 from:
     mkdir /usr/local/src
to:
          mkdir /usr/local/src
Changed lines 27-29 from:
     mkdir /usr/local/src/unslung
     cd /usr/local/src/unslung
to:
          mkdir /usr/local/src/unslung
          cd /usr/local/src/unslung
Changed lines 31-32 from:
     wget --cache=off http://www.nslu2-linux.org/Makefile
to:
          wget --cache=off http://www.nslu2-linux.org/Makefile
Changed lines 34-37 from:
     make setup-host-ubuntu
  • Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
to:
          make setup-host-ubuntu
  • Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
Changed lines 39-40 from:
     cd /usr/local/src/fuse-2.5.3/kernel
to:
          cd /usr/local/src/fuse-2.5.3/kernel
Changed lines 42-43 from:
     ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
to:
          ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
Changed lines 45-46 from:
     CC = gcc
     LD = ld
to:
          CC = gcc
          LD = ld
Changed lines 48-50 from:
     CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
     LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
to:
          CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
          LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
Changed lines 52-56 from:
        unsigned ncpy = min(*size, cs->len);
        if (val) {
                flush_cache_all();
                if (cs->write)
to:
             unsigned ncpy = min(*size, cs->len);
             if (val) {
                     flush_cache_all();
                     if (cs->write)
Changed lines 58-61 from:
     make
  • If all goes well, you will have fuse.o in the directory. Copy this file to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
to:
          make
  • If all goes well, you will have fuse.o in the directory. Copy this file from the development machine to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.
Changed lines 67-70 from:
     ipkg install optware-devel
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
to:
          ipkg install optware-devel
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
Changed lines 72-75 from:
     ./configure
     make
     make install
to:
          ./configure
          make
          make install
Changed lines 81-82 from:
     /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
to:
          /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
Changed lines 86-87 from:
     ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
to:
          ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
Changed lines 91-93 from:
     /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
to:
          /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
July 28, 2008, at 12:08 AM by mkurtz -- Formatting updates
Added line 18:
Added line 20:
Added line 22:
Changed lines 24-25 from:
 mkdir /usr/local/src
to:
     mkdir /usr/local/src
Added line 29:
Added line 32:
Added line 35:
Added line 37:
Added line 40:
Added line 43:
Added line 50:
Added line 56:
Added line 59:
Added line 68:
Added line 70:
Added line 82:
Changed lines 84-85 from:
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuraiton
to:
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuration
July 28, 2008, at 12:05 AM by mkurtz -- Formatting updates
Changed lines 1-2 from:

Foreword

to:

Foreword

Changed lines 13-20 from:

Setting up a kernel build environment to build the FUSE kernel module

We must first build a kernel module for FUSE. FUSE is a driver that allows filesystems in user space, and is used by the NTFS-3G software. I didn't have much luck getting the module to build properly by compiling natively on the NSLU2 - I would get two unresolved symbols when I tried to insmod it. So what you must do is set up a cross-compiler build environment on an external Linux workstation. I found Sun's VirtualBox? a perfect solution for creating a quick and easy VirtualPC? on my Windows workstation to install Linux on. I used Ubuntu v8.04 as my Linux distro.

  1. Set up a VirtualPC? with VirtualBox? (http://www.virtualbox.org/) or get an unused workstation to install Linux on.
  2. Install Ubuntu v8.04 or whatever Linux distro you like (remember some steps may be different if you use a different distro)
  3. Log into Ubuntu. Since this is just a build machine, I tend to log in as root.
  4. Make a /usr/local/src directory
to:

Setting up a kernel build environment to build the FUSE kernel module

We must first build a kernel module for FUSE. FUSE is a driver that allows filesystems in user space, and is used by the NTFS-3G software. I didn't have much luck getting the module to build properly by compiling natively on the NSLU2 - I would get two unresolved symbols when I tried to insmod it. So what you must do is set up a cross-compiler build environment on an external Linux workstation. I found Sun's VirtualBox a perfect solution for creating a quick and easy VirtualPC on my Windows workstation to install Linux on. I used Ubuntu v8.04 as my Linux distro.

  • Set up a VirtualPC with VirtualBox (http://www.virtualbox.org/) or get an unused workstation to install Linux on.
  • Install Ubuntu v8.04 or whatever Linux distro you like (remember some steps may be different if you use a different distro)
  • Log into Ubuntu. Since this is just a build machine, I tend to log in as root.
  • Make a /usr/local/src directory
Changed lines 22-36 from:
  1. Make a directory to hold the unslung code and then cd to it
 mkdir /usr/local/src/unslung
 cd /usr/local/src/unslung
  1. Get the master Makefile
 wget --cache=off http://www.nslu2-linux.org/Makefile
  1. Install the necessary support packages. Note that this step will try to install a long list of software. Some of the packages may not necessarily have the same names anymore so you may run into errors. Do your best to install as much of the software as you can. Try to find alternatives for the missing packages.
 make setup-host-ubuntu
  1. Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
  2. cd to fuse-2.5.3/kernel
 cd /usr/local/src/fuse-2.5.3/kernel
  1. run configure
 ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
  1. edit the Makefile. Use you favorite text editor and change the lines that read:
 CC = gcc
 LD = ld
to:
  • Make a directory to hold the unslung code and then cd to it
     mkdir /usr/local/src/unslung
     cd /usr/local/src/unslung
  • Get the master Makefile
     wget --cache=off http://www.nslu2-linux.org/Makefile
  • Install the necessary support packages. Note that this step will try to install a long list of software. Some of the packages may not necessarily have the same names anymore so you may run into errors. Do your best to install as much of the software as you can. Try to find alternatives for the missing packages.
     make setup-host-ubuntu
  • Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
  • cd to fuse-2.5.3/kernel
     cd /usr/local/src/fuse-2.5.3/kernel
  • run configure
     ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
  • edit the Makefile. Use you favorite text editor and change the lines that read:
     CC = gcc
     LD = ld
Changed lines 38-40 from:
 CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
 LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
  1. There is a bug in the dev.c file that must be addressed. Open the file in your favorite text editor, and at around line 546 make it read the following:
to:
     CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
     LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
  • There is a bug in the dev.c file that must be addressed. Open the file in your favorite text editor, and at around line 546 make it read the following:
Changed lines 45-50 from:
  1. make the kernel driver
 make
  1. If all goes well, you will have fuse.o in the directory. Copy this file to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.

Setting up a native build environment for NTFS-3G

to:
  • make the kernel driver
     make
  • If all goes well, you will have fuse.o in the directory. Copy this file to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.

Setting up a native build environment for NTFS-3G

Changed lines 53-62 from:
  1. First set up a native build environment
 ipkg install optware-devel
  1. Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
  2. configure, make, and install
 ./configure
 make
 make install

Usage

to:
  • First set up a native build environment
     ipkg install optware-devel
  • Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
  • configure, make, and install
     ./configure
     make
     make install

Usage

Changed lines 65-70 from:
  1. insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
 /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
  1. make sure you unmount any NTFS drives that are already mounted
  2. mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuraiton
 ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
to:
  • insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
     /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
  • make sure you unmount any NTFS drives that are already mounted
  • mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuraiton
     ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1
Changed lines 74-76 from:
 /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
to:
     /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
July 27, 2008, at 11:57 PM by mkurtz -- Initial page creation...
Added lines 1-76:

Foreword

I recently had success in building NTFS-3G and the accompanying FUSE kernel module for Unslung 6.10. The NTFS-3G driver so far appears to provide better performance, and is well tested in the Linux community. It also doesn't suffer from the Linksys proprietary driver bug where the driver locks up under heavy load.

As of right now, I haven't had the time to learn how to create an optware package, but I thought I would provide some guidance on how to compile the software yourself. If someone has a place for me to upload the software - particularly the FUSE driver which is tough to build - then I'd be happy to share! Hopefully one day I will have time to create an optware package for easy installation, as I think a lot of people would love to use NTFS-3G.

What follows is my best recollection of what I did to set up the proper build environment, and what I did to build the software. There may be some missing details, so if you run into any issues, please speak up. I may also not be doing this in the most efficient way, so if there are extra steps or an easier way to do a step, please share.

Since Unslung runs a 2.4 kernel, we have to use FUSE v2.5.3 and NTFS-3G v1.2531.

Okay - to the good stuff!

Setting up a kernel build environment to build the FUSE kernel module

We must first build a kernel module for FUSE. FUSE is a driver that allows filesystems in user space, and is used by the NTFS-3G software. I didn't have much luck getting the module to build properly by compiling natively on the NSLU2 - I would get two unresolved symbols when I tried to insmod it. So what you must do is set up a cross-compiler build environment on an external Linux workstation. I found Sun's VirtualBox? a perfect solution for creating a quick and easy VirtualPC? on my Windows workstation to install Linux on. I used Ubuntu v8.04 as my Linux distro.

  1. Set up a VirtualPC? with VirtualBox? (http://www.virtualbox.org/) or get an unused workstation to install Linux on.
  2. Install Ubuntu v8.04 or whatever Linux distro you like (remember some steps may be different if you use a different distro)
  3. Log into Ubuntu. Since this is just a build machine, I tend to log in as root.
  4. Make a /usr/local/src directory
 mkdir /usr/local/src
  1. Make a directory to hold the unslung code and then cd to it
 mkdir /usr/local/src/unslung
 cd /usr/local/src/unslung
  1. Get the master Makefile
 wget --cache=off http://www.nslu2-linux.org/Makefile
  1. Install the necessary support packages. Note that this step will try to install a long list of software. Some of the packages may not necessarily have the same names anymore so you may run into errors. Do your best to install as much of the software as you can. Try to find alternatives for the missing packages.
 make setup-host-ubuntu
  1. Download fuse-2.5.3.tar.gz and untar it to /usr/local/src
  2. cd to fuse-2.5.3/kernel
 cd /usr/local/src/fuse-2.5.3/kernel
  1. run configure
 ./configure --with-kernel=/usr/local/src/unslung/unslung/tmp/work/unslung-kernel-2.4.22.l2.3r63-r22/linux-2.4.22/ --prefix=/opt
  1. edit the Makefile. Use you favorite text editor and change the lines that read:
 CC = gcc
 LD = ld

to

 CC = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-gcc
 LD = /usr/local/src/unslung/unslung/tmp/cross/bin/armeb-linux-ld
  1. There is a bug in the dev.c file that must be addressed. Open the file in your favorite text editor, and at around line 546 make it read the following:
        unsigned ncpy = min(*size, cs->len);
        if (val) {
                flush_cache_all();
                if (cs->write)
  1. make the kernel driver
 make
  1. If all goes well, you will have fuse.o in the directory. Copy this file to the /lib/modules/2.4.22-xfs/kernel/fs/fuse directory on your NSLU2.

Setting up a native build environment for NTFS-3G

I don't know if you can build the NTFS-3G user-tools on the Ubuntu machine (I assume you can, but I didn't try it), but you can build it right on your NSLU2 and use it in conjunction with the fuse.o kernel module to mount your NTFS drive.

  1. First set up a native build environment
 ipkg install optware-devel
  1. Download ntfs-3g-1.2531.tgz and untar it to /usr/local/src
  2. configure, make, and install
 ./configure
 make
 make install

Usage

Okay this is not a good solution for usage yet, as it doesn't work through reboots, but once I have the time to set up a permanent solution, I will update this section

  1. insmod the FUSE kernel. Note that the busybox version of insmod doesn't work, so make sure you use the version in /sbin
 /sbin/insmod /lib/modules/2.4.22-xfs/kernel/fs/fuse/fuse.o
  1. make sure you unmount any NTFS drives that are already mounted
  2. mount your NTFS drive. You may need to adjust the parameters of the command to match your system configuraiton
 ntfs-3g /dev/sdb1 /share/hdd/data/HDD_1_1_1

This should mount your NTFS drive using the new NTFS-3G driver.

To verify run "mount" and it should say something similar to:

 /dev/sdb1 on /share/hdd/data/HDD_1_1_1 type fuse (rw,allow_other)
view · edit · print · history · Last edited by MoD.
Based on work by MoD and mkurtz.
Originally by mkurtz.
Page last modified on October 23, 2008, at 06:45 AM