Search This Blog

Monday, May 27, 2013

NTFS -> USB -> Debian -> ?

Over the weekend I got spoiled with some time to myself and felt really good because I caught up on some chores and got to sleep in. Yesterday I decided it was about time I spent some time trying out the kids PS3 and see what it could do other than play games and DVD's. I'm at that "middle age" part of my life where I don't have the time or the interest to really get into games or consoles so I really don't know a lot about PS3's. Most of the gaming I do is with Sam who's really more into Nintendo, Flash games, and Android when he gets on my phone.

So with a bit of help from Google and some tinkering I got Windows XP MCE whoring it's media to the PS3 and was really impressed with having the ability to slump on the couch and browse through mindless amounts of local media and have it just play on a big TV (Hint for Windows users: you need to configure Windows Media Player (not Windows Media Center) to make it work as a Media Center).

So the next natural step for me was to make my Linux boxen work as a DLNA server. My first choice was a good one, minidlna, because it's available in aptitude, has no pointless GUI and "just works". Of course with most things you're trying for the first time in Linux, it doesn't "just work" until you've figured out how to configure it properly. I could tell that minidlna was working fine but couldn't find anything on my NTFS USB drive. After a bit of Googling and not getting anywhere I remembered I had the same issues with Samba. When I was less experienced I used to solve these issues by customizing fstab but nowadays I'm pretty sure there's better solutions for (un)pluggable USB disks than putting permanent entries in fstab.

The solution I use for Samba and minidlna now is to force it to run as me. It's probably not the best solution but it's easy to do and really works. The reason for this is auto-mounted NTFS drives are owned by the current user and have no access for groups or other users. From what I can tell hacking the udev configuration is a better solution but that seemed way too much like brain surgery for a Sunday afternoon.

With the amount of my life I've wasted on issues with NTFS USB drives on Debian I've decided to share this solution with you all. I'm 90% sure it's not the best solution and probably has some security issues buts it's simple, fast, and doesn't interfere when the drives are disconnected when you're booting.

Here's what I did to /etc/samba/smb.conf:


# Hack to make USB devices sharable
force user = chris

And this is what I did to /etc/init.d/minidlna:

# Run as `minidlna' if USER is not specified or is `root'
if [ -z $USER ]; then

Please let me know if you know a better way to deal with auto-mounted NTFS 600/700 permission crap.