DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2006-11-11 14:24:41

StevieP
Member
Registered: 2006-08-19
Posts: 21

Samba issues and debug tools

I've been experimenting with partitioning disks recently (nearly losing my music collection in the process) and I've noticed that when I mount other drives, I lose Samba access completely. This is a bit of a shame.

It turns out that /bin/smbcom crashes if it can't read a file called .smb.ses on any drive listed in /etc/mtab.

To help me discover what's gone wrong, I've built strace (see attachment) with the help of gentoo.

The solution to the problem seems to be to copy .smb.ses from /mnt/HD_a2 to your other drives and edit it.

So, for /mnt/HD_a3 mounted on /dev/sda3, my file contains the following:

Code:

#version = 1.04
[ HDD_b ]
comment =
path = /mnt/HD_a3
valid users =
read only = no
guest ok = yes

I can then see the partition as HDD_b in Windows.

Offline

 

#2 2006-11-11 14:39:32

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Samba issues and debug tools

You may also mount second partition as a /mnt/HD_a2/otherpartition, then you don't need to mess with samba smile


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#3 2006-11-11 14:49:07

StevieP
Member
Registered: 2006-08-19
Posts: 21

Re: Samba issues and debug tools

Agreed, but if you then plug in a USB card reader, for example, smbcom will run, it will fail to find .smb.ses in /mnt/HD_a2/otherpartition, crash and leave an empty smb.conf file (I forgot to mention that bit). You then lose Samba access to everything, not just your new partitions.

Offline

 

#4 2007-02-09 19:41:45

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Samba issues and debug tools

Sorry to bring back an old topic but this smbcom thing...

I'm using a DNS-323 so things might be slightly different but I'm guessing it works the same.

smbcom on my system is just a symlink to /sys/crfs/samba/smbcom

lrwxr-xr-x    1 root     root           22 Feb  8 19:22 smbcom -> /sys/crfs/samba/smbcom

What if you got rid of that symlink and created a script to parse the mount table and if the .smb.ses file doesn't exist, create it.  And then of course, call smbcom after the script finishes creating .smb.ses files.

I found the same issue with smbcom on my DNS-323 when I was doing some mount --bind operations.  It would segfault when it hit one it didn't like, but it wouldn't corrupt my samba configuration file.

Just a thought.

Last edited by tobyg (2007-02-09 19:44:28)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB