This site functions as an archive of Conner's Blog, which was a blog from 2006-2014 located at http://connermccall.com. Images and links are likely to be broken.

Samba and Case Sensitivity

Here is an oddity in Samba that I ran across tonight. I was working on updating my mp3 player for my trip home. I wanted to transfer over some AFI, but when I went to view all the albums I had available, only one of my albums was visible. I logged into my music server and browsed to the appropriate directory. I had three directories, AFI, Afi, and A.F.I. Looking in them, A.F.I had the album that was visible in Amarok, Afi was empty, and AFI contained the missing albums.

Thinking that was odd, I opened up the drives under nautilus and browsed to AFI, this showed all the albums, then I browsed to Afi. Surprisingly it contained all the albums to, but when I tried to play a song in the directories I received an error.

A quick google search brought up this. I appears that Samba by default is case insensitive to work with Windows. So when it translated Afi and AFI, it listed the files in both folders, which had the side effect of causing some odd problems with my music collection.

It was a simple fix, originally I had this configuration:
[media]
comment = Media Drive
path = /media/storage
read only = yes
write list = conner

I added the appropriate configuration directive:
[media]
comment = Media Drive
path = /media/storage
read only = yes
write list = conner
case sensitive = yes

Then I restarted samba and my problem was fixed. One caveat is that if you were accessing the drive using Windows, there is a possibility that this could break some things, so be careful and test.

Note: I know I could have deleted the empty directory, but I wasn't 100% sure that the problem didn't exist in other parts of my collection.


Comments