Sec, blogmal! - patches - freebsd-ntfs-largefile



April '18



Sat, 21 Jan 2006

Large files on NTFS on FreeBSD.

Well, it seems its crappy software week all over again.

While trying to find out how to burn an .iso image on a DVD using only free(as in beer) software, I had interesting experiences with CD Burner XP on Windows, which simply ruined an empty disk in 37 seconds without even trying to write the actual data onto the disk, and some (patched) windows-cdrecord which spewed interesting error messages, and astonished me by interpreting the speed= command line in a creative way (so 1 means 4, 10 means 8 and 16 means 17? interesting ;) - but at least it didn't ruin another blank disk.

Then I tried using FreeBSD. cdrecord from the ports tells me that the Author has completely lost it which means I would have to jump some hoops before I could have the holy grail of DVD support.

Well. Some more digging led me to growisofs from the dvd+rw-tools package which, despite its name, is able to just burn an iso image with the following easy command line

 growisofs -dvd-compat -Z /dev/cd0=image.iso

It does however require device atapicam in your kernel config (see here in the FreeBSD Handbook for details).

This is where we finally touch the subject. Large Files on NTFS. The image was on my NTFS partition. And I was just assuming I could burn it directly. Well, I was wrong and so spent another blank disk on learning that the NTFS driver is not 64 bit clean. You just get the filesize modulo 4G. And yes, the problem is known but they didn't even bother to document it somewhere.

Well, some more searching led me to dimitry who tried to tackle that issue but got no help at all.

I updated the patch he wrote for FreeBSD-6_STABLE (had to fix one simple reject), but be warned, as he notes using mmap on such large files will lead to a panic (I didn't test that ;-). So just to be safe, I copied the file with

  dd if=/dos/.../image.img bs=4M of=/home/sec/image.img

Because dd is guaranteed not to use mmap ;)

If you want/need to use the patch, here is how to you do it:

cd /usr/src
patch ~/FreeBSD-6-ntfs-largfile.patch
cd sys/modules/ntfs

If you already used ntfs, be sure to unmount all ntfs volumes, and kldunload ntfs.ko before the final step:

 kldload ./ntfs.ko
 mount -t ntfs /dev/ad0s1 /dos

Happy large filing…

– Sec

P.S.: There relevant bug report kern/73514 indicates that a fix for this was committed to FreeBSD-current in November. Yay! I do hope it gets merged to -STABLE soon.

posted at: 05:02 | Category: /patches | permanent link to this entry | 1 comment (trackback)

Your Comment
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Save my Name and URL/Email for next time
(Note that comments will be rejected unless you enter 42 in the following box: )

powered by blosxom
in 0.00 s