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 2007-11-21 15:00:57

ldomaigne
Member
Registered: 2007-06-24
Posts: 28

where is the /etc/samba/smb.conf stored?

Hello everybody,

Obviously, the samba configuration file survive a reboot. So, this let me think that it must be stored somewhere in the flash, but the question is: where exactly?

I checked out /dev/mtdblock{0,1}, but the only file I could find that bears some similarities was smb.default...

Basically, I'd like to be able to restore my smb.conf after that a disk has failed. Indeed, plugging a new disk will cause the smb.conf to be reset.

TIA,
Loic.

Offline

 

#2 2007-11-22 23:26:30

ldomaigne
Member
Registered: 2007-06-24
Posts: 28

Re: where is the /etc/samba/smb.conf stored?

Good evening,

so after browsing the forum, it's seems that the standard solution to alter the smb.conf is:

1) to store the wanted smb.conf somewhere on the disk.

2) use fun-plug to copy the smb.conf from the disk to RAM disk at /etc/samba and   restart the samba server.

... Something along those lines. Did I got it right?

Thanks,
Loic.

Offline

 

#3 2007-11-23 00:16:06

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: where is the /etc/samba/smb.conf stored?

Yes, that is what I do and it is working nicely.  Here is the script I use,
I store my "improved" smb.conf in /mnt/HD_a2/conf directory (which I created)

Code:

#!/bin/sh

# stop samba
/usr/bin/smb stop

# backup default smb.conf
cp /etc/samba/smb.conf /mnt/HD_a2/conf/backup/smb.conf

# copy new config file
cp /mnt/HD_a2/conf/smb.conf  /etc/samba/smb.conf

# restart samba
/usr/bin/smb start

I call the script smbd-restart.sh and put it in the /mnt/HD_a2/fun_plug.d/start
directory with the execution permissions set.

# chmod 755 /mnt/HD_a2/fun_plug.d/start/smdb-restart.sh

I'm running Fonz's v0.3 fun_plug scripts http://www.inreto.de/dns323/

Last edited by mig (2007-11-24 10:06:48)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#4 2008-11-17 13:56:19

BigNoob
Member
Registered: 2008-11-17
Posts: 7

Re: where is the /etc/samba/smb.conf stored?

Hello,

I'm running fun-plug 0.5 and I would like use your script to copy smb file
I create a file smdb-restart.sh and complete it with your code
I copy smdb-restart.sh to the folder ffp\start

and after I think I forget to set one thing because script doesn't work after reboot.
Can you help me?

Offline

 

#5 2008-11-17 14:11:04

BigNoob
Member
Registered: 2008-11-17
Posts: 7

Re: where is the /etc/samba/smb.conf stored?

Auto answer! It work now because in first time I forget:
# chmod 755 /mnt/HD_a2/ffp/start/smdb-restart.sh

Offline

 

#6 2009-01-19 16:16:51

frogman
Member
Registered: 2009-01-19
Posts: 14

Re: where is the /etc/samba/smb.conf stored?

I have tried to copy manually smd.conf to /etc/samba but when I type LS the file is not there!

Offline

 

#7 2009-11-19 15:13:45

davidcie
Member
Registered: 2008-03-29
Posts: 9

Re: where is the /etc/samba/smb.conf stored?

"Obviously, the samba configuration file survive a reboot. So, this let me think that it must be stored somewhere in the flash, but the question is: where exactly?"
I've been googling around trying to find an answer to this exact question. I know we can do all sorts of config restoration, but curiosity is eating me...

What I figured was that the smb.default file gets copied to smb.conf and then shares are injected into it upon reboot... But where are they defined? It's got to be somewhere! Fingers crossed some of you DNS hackers know the answer ;-)

EDIT: Ah, one more thread and found The Answer - it's the /mnt/HD_a4/.systemfile/.smb.ses file that stores the shares, with 3 backups of it scattered on HD_a4 and HD_b4. Right, time to get on with life.

Last edited by davidcie (2009-11-19 15:40:30)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB