2004.12_Window Writing-Ntfs for Linux.pdf

(1334 KB) Pobierz
Layout 1
REVIEWS
Mounting NTFS
Window Writing
Writing to NTFS partitions with the
can check out the
results of all this effort
in the “Benefits for
Linux Magazine Read-
ers” box.
The install script also
moves the new kernel
module and a few other
bits and bobs into the
right places on your sys-
tem (more or less
smoothly, depending on
the distribution you
use). Finished! The
Linux kernel should
now load the module on
demand, typically when
you issue a command
like the following:
NTFS driver is actually quite danger-
ous. But help is at hand. Paragon has
an improved kernel module, and
there is always Captive, a GPL-
licensed program that uses a variety
of Windows drivers.
BY JAN KLEINERT
U p to now, the Linux kernel has
mount -t ufsd -o U
iocharset=utf8 U
device mountpoint
only supported read-only mount-
ing of NTFS partitions. Support
for write access is experimental, and
errors associated with the write process
could completely wipe out an NTFS par-
tition. Both Captive, a GPL licensed
program, and its commercial competitor
“NTFS for Linux 3” by Paragon [1] aim
to change that. Linux Magazine tested
the latter as one component in a larger
suite of tools in [2].
Captive, a GPL-licensed program, is
fairly new on the scene. Looking under
the hood of Captive reveals a fairly com-
plex structure comprised of a small
kernel module and a larger userspace
module. The userspace module’s claim
to fame is that it actually managed to
convince the native NTFS driver from
Windows XP to cooperate with Linux
(see Figure 1).
The iocharset parameter helps out with
character conversions in file and path
names, as shown in Figure 2. Of course,
you can’t expect the driver to decrypt
files that you have encrypted on NTFS,
but it will unpack compressed files.
Our first impression was that the mod-
ule is fairly quick; the long waits with
the previous version are definitely a
thing of the past. The last time we tested
the Paragon module, ls -l took about 44
seconds to complete for an NTFS direc-
tory with around 50 files; the current
version took about four seconds. Just to
compare: the read-only driver from the
Paragon Module for the
Linux Kernel
Some parts of the Paragon Linux driver
are open source, although the driver is
released under a proprietary license. In
addition to these components there are
two binary libraries, one for kernel 2.4,
and the other for 2.6. Users need not
worry about the complex infrastructure;
Admins just need to ensure that the right
distribution kernel header files are avail-
able and either run the install script or
build the tool using make .
If you have not already done so,
install.sh will create symlinks for the
kernel headers in /usr/include before
going on to compile and will link an
object file (the UFSD kernel module). We
originally had some trouble getting this
to work on our lab system, which runs
Suse 9.1. A quick check showed that the
kernel header had not been included
properly, and that a few linker errors
were occurring. Paragon had this sorted
out within a few days. By the way, you
NTFS for Linux 3
Manufacturer: Paragon Software Group
Internet:
http://www.ntfs-linux.com
Captive 1.1.5
License:
Proprietary, US$ / EUR
69.95. Discount available
for Linux Magazine readers,
see box “Benefits for Linux
Magazine Readers”, Educa-
tional licenses on request.
Author: Jan Kratochvil
Internet: http://www.jankratochvil.net/
project/captive
License: GPL, but requires a few Windows
files
40
December 2004
www.linux-magazine.com
Paragon NTFS for Linux 3 versus Captive 1.1.5
593761675.002.png
Mounting NTFS
REVIEWS
Linux kernel displayed the
shell prompt after about
three seconds.
should come as no sur-
prise.
Measuring Write
Performance
Both of these tools were
designed with writing to
NTFS partitions in mind.
And that makes measuring
the data throughput for
read operations really
interesting. The “Test Pro-
cedure” box goes into the
gory details of the read
tests. The Paragon soft-
ware demonstrated better
performance in this disci-
pline, bundling the test file
off to the Windows parti-
tion in a time of one
minute and 10.5 seconds –
this is equivalent to a
throughput of 3.75 MB/s.
In contrast to this, Cap-
tive kept us waiting for 48
minutes and 19 seconds.
Our pocket calculator gave
us a speed of 93 KByte/s
for Captive – that’s around
about DSL speed. It hardly
seems practical to work
with files of this size
in real life scenarios,
although the tool might be
fine for the occasional text
document or image file.
Captive but Cheeky
The GPL licensed con-
tender, Captive, is
available as a binary RPM
or tar.gz archive from the
developer’s project page,
or you can build Captive
from the source code. After
completing the install, you
need to have access to a
few Windows XP files. The
neat captive-install-acquire
tool will help you to find
the right files. It not only
searches the directories
where you suspect the files
might reside, but can even
download a Windows XP
service pack from the
Microsoft download server
if asked to do so.
The fairly sparse docu-
mentation correctly
informs users that they do
need to own a valid XP
license to use Captive. The
remaining procedure is
automated: when you
mount an NTFS partition,
the drivers automagically
compile and mount the
partition in next to no
time. The mount entry is
awesome:
Figure 1: Captive is a free software tool, a complex structure comprised of a kernel
module and a main userspace module. The latter tricks the Windows NTFS driver
into running on Linux.
Read Performance
If you use one of our two
test candidates to mount your NTFS par-
tition, you will not be able to use the
kernel NTFS drivers. Because of this
restriction, we required both drivers
to prove that they would not be affec-
ting our machine’s read performance.
Paragon’s kernel driver achieved speeds
of around 2.1 MByte/s, reading 265
MBytes in two minutes and six seconds.
As a comparison, the original NTFS ker-
nel module copied the same file in just
35.7. The original kernel module is thus
far quicker than the Paragon module.
We had already enjoyed a fairly
/dev/hda4 on /mnt/captive- U
windows2000 type captive-ntfs U
(user=root,fs=captivefs, U
mntent.mnt_fsname= U
/dev/hda4,mntent.mnt_type U
=captive-ntfs,dir_cache_entries U
=0,image=/dev/hda4,noauto, U
captive_options=--disk; U
--rw;--load-module= U
/var/lib/captive/ntoskrnl.exe; U
--filesystem=/var/lib/captive U
/ntfs.sys;--sandbox-server= U
/usr/sbin/captive-sandbox U
-server;--bug-pathname=/var U
/lib/captive/bug-%FT%T. U
captivebug.xml.gz; U
--syslog;--rw,server_socket U
=/tmp/lufsd2057093082, U
server_pid=6209)
If you look closely, you will see that the
list includes the Windows files. From a
functionality point of view, the software
was really convincing: it automagically
detects the right character set – UTF-8 in
our test – and unpacks NTFS-com-
pressed files. Again, the tool can not
decrypted NTFS-encrypted files, but that
593761675.003.png 593761675.004.png 593761675.005.png
REVIEWS
Mounting NTFS
Figure 2: Paragon’s NTFS module converts special characters in file names – in this case German umlauts
– correctly, assuming you specify the character set in the mount command.
amounts of data.
Captive users can also expect heavy
loads. The fact that the driver lives in
userspace rather than kernel space will
make very little difference in a produc-
tion environment. But we very much
doubt that users will be happy with the
abysmal read and write performance that
this NTFS emulator provides.
Captive is acceptable for occasionally
exchanging small files. Moving an MPEG
movie would probably exceed your hard
disk’s life expectancy. In contrast to this,
the commercial NTFS for Linux handles
the required tasks at acceptable speeds.
This said, NTFS for Linux is not suitable
for partitions on hard-working produc-
tion machines, as the disaster that struck
when we tried to run a synthetic bench-
mark (Boniee++) just goes to show.
lengthy coffee break thanks to the Cap-
tive program, but we could have taken a
trip downtown while the read test was
running. After about three hours of
hectic flashing, the hard disk LED finally
stopped. The computer was more or less
unusable the whole time. To make things
worse, the test actually failed: it appears
that a critical Captive component had
collapsed under the load, taking the
kernel driver, the mount point, the cp
process, the shell, and finally the
window manager down with it. X11 was
still running. The computer freed up its
resources after the act, but that was only
a small consolation to us.
performance with large files.
NTFS for Linux 3.0 read from and
wrote to NTFS fairly quickly. The system
load kernel side was quite heavy, but in
some situations you may be able to live
with that if you are handling small
Test Procedure
Both solutions are designed to support
dual boot desktops. In this light, we decided
to test both products on a normal desktop
PC rather than on a high-performance
server machine. In our case this was a
Pentium 4 Celeron with a 2GHz CPU, 256MB
RAM and an 80GB ATAPI hard disk. The
machine’s main operating system was Suse
Linux 9.1 Professional with the original Suse
kernel 2.6.3. We formatted the Linux parti-
tion with Ext 3. The NTFS partition came
courtesy of Windows 2000 Professional with
current service packs.
We originally wanted to use Bonnie++ for
the performance tests. Bonnie++ feels per-
fectly at home on Ext 3 partitions. But our
first attempt to run Bonnie++ with Paragon’s
fast software ended in a disaster. We told
Bonnie++ to work with 512 Mbytes and
50x1024 files – just for comparison’s sake,
this takes just a few minutes on the Ext 3
partition. Alas, the Paragon driver, and the
whole system froze for about the next six
hours. The mouse and keyboard showed no
response at all, there was no discernible hard
disk activity, and of course there were no
results.
We quit Bonnie++ by pressing [Ctrl]+[C],
but this was not the end of the story as
Bonnie++ wanted to delete all 50000 files.
To put our lab machine out of its misery, we
decided to kill the process after about a
quarter of an hour, and we manually cleaned
up the wreckage on the Windows 2000
partition. This left us with a 265MByte file
copy as a “benchmark.”We measured the
read performance by writing to device null
and the write performance by copying
between the partitions. The procedure took
up to an hour in some cases.
Conclusion
Both contenders provide stable writing
facilities and support critical NTFS
attributes. We did not experience any
NTFS filesystem corruption during our
lab sessions. And this puts them miles
ahead of the kernel-based NTFS driver.
Both drivers deserve our recommenda-
tion in this respect, but we had to take
Captive’s medal away because of its read
Benefits for Linux Magazine Readers
INFO
Linux Magazine readers who install the
Suse Linux 9.1 Pro distribution from the
DVD with this issue can download the
current NTFS for Linux 3.0 file system driver
from the website at [3] free of charge.
The driver is fully functional and not time
bombed. If you have purchased Suse Linux
9.1 – no matter whether you have the
Personal or Professional version – you
should get along fine with the software
download. The installation script is not
supplied, however, all you need to do is bind
the right object file into your kernel using the
insmod filename command. The mount com-
mand should now work as described in this
article.
Note that for compatibility reasons insmod
may refuse to work with the UFSD driver
after this update. This is hardly surprising as
the kernel module is linked against a specific
kernel version, and this is a feature that you
normally only get with the US$ / EUR 69.95
commercial version of the program. On the
brighter side, Paragon is offering Linux Mag-
azine readers a fairly substantial discount. If
you order via [4], and enter the right coupon
code the license will cost you US$ / EUR
34.97.
[1] Paragon Software Group:
http://www.paragon.ag/
[2] Jan Kleinert; Paragon Mount Everything
3.0 Professional test. Linux Magazine,
Issue 38 / January 2004, p33
[3] NTFS for Linux 3 driver for Suse Linux 9.1
free of charge for readers of Linux
Magazine: http://www.ntfs-linux.com/
linux-magazine.htm
[4] Reader discount on NTFS for Linux 3:
https://secure.element5.com/esales/cart.h
tml?PRODUCT[516868]=1&COUPON1=NTF
SCT&currencies=USD ,
Coupon Code: NTFSCT
42
December 2004
www.linux-magazine.com
593761675.001.png
Zgłoś jeśli naruszono regulamin