NTFS+Linux+Samba=Gibberish

NTFS has come a long way on Linux in the last few years, there's even some read/write drivers that work, and generally, the dual-boot camp has seen so much development geared towards them that certain Linux install CD's even come with a bunch of .exe files on them, almost as if it's assumed you'll be running Windows® first. No comment.

So you can access you windows drives from Linux, great! .. if they are on the same box. But what about if you want to serve up those NTFS drives as shares, perhaps to.. GASP! a windows box? In this case, XP. Due to a series of circumstances outside the scope of this blog entry, I recently had to do exactly that.

Now, I pride myself on being able to do pretty much anything when it comes to Samba networking, after all, I've had a multi-platform LAN here for years, and every cross-platform network thing I've desired to do, has been done. But I have to admit, this one stuck me, which I guess is what I get for priding myself.

Mounting the NTFS drive is easy enough..

mount -t ntfs /dev/hdd1 /mnt/arc -o ro

plus whatever options rock your boat (I'm using the read-only driver for now). And then create a share in my smb.conf..

[arc]
	path = /mnt/arc
	comment = archive place
	admin users = cor
	deny hosts = 0.0.0.0/0
	allow hosts = 192.168.1.

Or something like that, and away we go. The share appears on the network, check, mount it on the XP box, check. So far so good.

Everything looked fine to begin with. Although I did notice a lack of cute folder icons and silly background images, as are my wont. All the files and folders were there, sure, but something was definitely wrong.

I opened a random text file. Complete gibberish. Some applications refused to read any of the files, others would show contents which were clearly from other files, and some would do no more that spew out incoherent file system error messages in strange variants of unicode. Very curious.

I could access the files just fine on the Linux box, see the contents, listen to MP3's, whatever, so I knew there was no problem with the NTFS mounting process. Somewhere, somehow, Samba was messing them.

I tweaked loads of things, to the point of trying stuff that I knew full well would have no impact whatsoever, like..

csc policy = disable
force unknown acl user = yes
oplocks = no
locking = no
map acl inherit = yes

Clearly getting desperate, I decided to RTFM and loaded up the man page for smb.conf, not a small page. Running a firefox type-to-find (yes, I view man pages in my browser, thanks to man2html, and a nice Firefox search plugin I cooked up to access the man2html script on a local Linux server) I searched for "(s)", that is, directives that apply to only shares.

Eventually, of course, I found the golden command, and instantly, all my files are themselves again.  *phew*  It's simply this..

use sendfile = no

Pesky, huh! Well, hopefully I've peppered this blog with enough keywords to save some poor soul the heartache of scrolling the full length of the smb.conf man page.

for now..

;o)


Choose your flavour..

I was about to install the latest Slackware; or rather, prepare for that; when it occurred to me that it's been a couple of years since I tried another distro, so I thought I might Google a bit, see what's kicking around.

I came across a rather cool tool, called the Linux Distribution Chooser. This nifty page asks you a series of simple questions about your knowledge, needs and desires, and after a couple of minutes, will present you with what it considers your "Perfect" Linux distribution.

I took the test. The questions are straightforward enough, and in no time it presented me with my Perfect Linux. The suspense is killing you, right? Well here it is.. My Perfect Linux is.. Slackware  smiley for :lol:

It also recommends I take a peek at Gentoo. Hmm. A distant memory tells me that Gentoo is a distro that you compile from scratch on the target machine, which sounds like it would have oodles of performance benefits, at the expense of the Installation from Hell. But memories can trick you, and the Gentoo installation, I'm told, is a fairly automatic process these days.

I have the Slackware CD's already, not to mention the bundle of Slackware-specific scripts I've been tinkering with for the last few years, so it's unlikely I'll be travelling down the Gentoo road in the immediate future, but perhaps one rainy afternoon I'll give my other "Perfect Linux" a try.

Maybe you should, too, whatever it is.
for now..

;o)


 ©  2024 « corz.org » 24.11.21  

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!