ntfs
Kategorie: Linux

Writing to Windows XP/2000 (NTFS partitions)
using the NTFS FUSE programs.


The NTFS FUSE programs allow (reading from and) writing to your NTFS partitions. Creating, deleting, moving and replacing small numbers of files works well enough, however, when copying a large number of files in nested directories it often chokes. When it does work, it is fast.

In this article we will install NTFS FUSE on Novell SuSE 10.0.

Remember, Novell SuSE 10.0 is a free download from one of the mirrors listed here (5 CDs or 1 DVD). Although labeled evaluation, this is a fully functional version (identical to that sold packaged with manuals and limited installation support) which does not expire. OpenSuSE 10.0 can be downloaded from here. For a review of OpenSuSE 10.0, see tuxmachines.org.

Download
fuse-2.5.2.tar.gz from http://fuse.sourceforge.net/
ntfsprogs-1.13.0.tar.gz from http://freshmeat.net/projects/linuxntfs/ and
install-ntfs-SuSE.txt (installs a script to un/mount your NTFS partitions at boot)
and save them in a directory of your choice. I chose to save them in /tmp

For general compilation, make sure that you have at least the following packages installed.

gcc (4.0.2_20050901-3)
libgcc (4.0.2_20050901-3)
glibc (2.3.5-40)
glibc-devel (2.3.5-40)
glib2 (2.8.1-3)
glib2-devel (2.8.1-3)
gcc-c++ (4.0.2_20050901-3)
libstdc++-devel (4.0.2_20050901-3)
kernel-source (2.6.13-15)

The above are sufficient to compile the FUSE programs.
The following are also needed to compile the NTFS programs.

pkgconfig (0.19-5)
gnome-vfs2 (2.12.0-9)
gnome-vfs2-devel (2.12.0-9)
gconf2-devel (2.12.0-2)
gtk2-devel (2.8.3-4)
readline-devel (5.0-9)
atk-devel (1.10.3-2)
ncurses-devel (5.4-71)
popt-devel (1.7-221)

I have attempted to keep track of the necessary development packages, but it is possible that some of these packages are not needed. Your setup may also require some extra packages that I already had installed and erroneously decided were not necessary for the compilation.

All the above are default SuSE 10.0 packages.
The easiest way to check that you have the necessary development packages, is to:

1) open the KDE Control Center
2) click on YAST2 Modules
3) click on Software
4) click on Software Management
5) click Administrator Mode
6) enter your root password
7) enter devel in the search box
8) click off the checkbox, summary (leave name checked)
9) hit enter or click the search button

If you are missing some packages, choose them (click the checkbox by the package name), and install them by clicking Accept.

Continuing,.. note that many of the following commands need to be executed as root.

cd /tmp
tar zxf fuse-2.5.2.tar.gz
cd fuse-2.5.2
./configure

The configuration script finds that a FUSE module is already present and that it is from the official kernel. Hence, it does not build (another) kernel module.

make
make install

Configure and make can be run as a user, but you need to be root to install the FUSE programs.

cd /tmp
tar zxf ntfsprogs-1.13.0.tar.gz
cd ntfsprogs-1.13.0

The code probably compiles OK if you compile it from Gnome, but if you compile it from KDE you have to make sure it can find fuse.pc. There are a couple of ways to do this, the easiest is to copy fuse.pc to where the configure program will find it, with the command,

cp /usr/local/lib/pkgconfig/fuse.pc /opt/gnome/lib/pkgconfig/

A more correct way is to tell the configure program where to look for it, by changing the PKG_CONFIG_PATH variable to include /usr/local/lib/pkgconfig. This can be done with the commands,

mv configure configure.old
awk '{print gensub(/(lib\/pkgconfig)/,"\\1:/usr/local/lib/pkgconfig",1)}' configure.old > configure

The .pc (package configuration) files can be found all over the place. Here are some locations:

/usr/local/lib/pkgconfig
/usr/local/share/pkgconfig
/usr/lib/pkgconfig
/usr/share/pkgconfig
/opt/kde3/lib/pkgconfig
/opt/gnome/lib/pkgconfig
/opt/gnome/lib/pkgconfig
/opt/gnome/share/pkgconfig

If the configure program does not find fuse.pc it will not compile ntfsmount, the program we are most interested in.

./configure
make
make install

You need to update your shared libraries, by running the command:

ldconfig

If your NTFS partitions are mounted at boot with the (essentially read only) ntfs kernel module, your /etc/fstab file will have entries something like:

/dev/hda1 /windows/C ntfs ro,users,gid=users,umask=0002,nls=utf8 0 0
/dev/hda2 /windows/D ntfs ro,users,gid=users,umask=0002,nls=utf8 0 0,

then comment them out (add a # at the beginning of the line), or delete them, so that they will not be mounted at boot. If they are already mounted, then unmount them with the command umount /windows/C /windows/D

Now, if you are in a hurry, your (first) NTFS partition can now be mounted/unmounted by:

modprobe fuse

ntfsmount /dev/hda1 /mnt (command to mount)
fusermount -u /mnt or just umount /mnt (commands to unmount)

Or, if you wish to see the hidden files:

ntfsmount /dev/hda1 /mnt -o show_sys_files

Of course, if your NTFS partition is not /dev/hda1, you will have to suitably adjust /dev/hda1.
To display your partitions use the command:

fdisk -l

If you wish to have your NTFS partitions automatically mounted at boot, you need to run the above mentioned script. You do this by entering the commands:

cd /tmp
chmod +x install-ntfs-SuSE.txt
./install-ntfs-SuSE.txt

Now, you can mount/unmount all your NTFS partitions with:

/etc/init.d/ntfs-fuse start
/etc/init.d/ntfs-fuse stop

Henceforth, this script will automatically mount your NTFS partitions at boot. If you do not want this, execute the following command:

rm /etc/init.d/ntfs-fuse /etc/init.d/rc*.d/*ntfs-fuse*

Not unmounting your NTFS partition before shutting down, is probably not good. So, having it unmounted automatically is probably good.

Now reboot and see if everything works as it should.

Please add any helpful comments/suggestions here.

AS ALWAYS, USE AT OWN RISK.

Some MD5's:

ntfsprogs-1.13.0.tar.gz 4679cf54fb37527503d7ad44ec5376a8
fuse-2.5.2.tar.gz ea565debe6c7486963bef05c45c50361
install-ntfs-SuSE.txt f6203d115691e409647da4c2303658f0


23.12.2006 2:37:59