Another Samba.conf Problem


RockOut

Member
Joined
Jan 4, 2004
Messages
314
Location
The USA
Website
www.godsofallmedia.com
I apologize for bugging everyone about Samba constantly, but now that I got it working, I seem to have endless issues with the samba.conf getting deleted every time I reboot my GP2X. I've tried two different usb cables and two different ftp apps, but the contents of my samba.conf get erased whenever I reboot my GP2X. I have samba set to the "always on" setting. I have set it just to "on" before to no avail though.

Please help, I promise I will not post any more stupid questions. :D

edit: here is my smb.conf:

# Global parameters
[global]
workgroup = WORKGROUP
server string = GP2X
log file = /tmp/samba/%m.log
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
security = share
guest account = lan
coding system = utf8
client code page = 949
preserve case = yes
short preserve case = yes

[gp2x]
path = /mnt/
public = Yes
writeable = No
browseable = Yes
create mask = 0777
directory mask = 0777
read only = No
valid users = lan, root
guest ok = Yes
 
...the contents of my samba.conf get erased whenever I reboot my GP2X.

Hi again,

No idea why it's not sticking, but as a last resort you could have a copy of the smb.conf you want on your SD or NAND and use the autorun feature to copy it over to /etc/samba/ each time you turn the GP2X on.

Probably the SD would be best so that if it all goes wrong you can just boot without the SD to get the default GP2X Samba setup.
 
Last edited by a moderator:
Thanks for the reply. Unfortunately, when I tried deleting the entire samba folder and copying it back over from my computer, EVERYTHING except for one file was deleted! :(
 
Is it really being erased or overwritten? Mine is still the same after many reboot's. The file is in /etc/samba

Linux 2.4.25 (gp2x) (ttyp0)


gp2x login: root
Password:
[root@gp2x root]$cd /etc
[root@gp2x etc]$ls
HOSTNAME hosts inittab network samba
config hosts.allow inputrc nsswitch.conf securetty
devfsd.conf hosts.deny ioctl.save passwd services
fstab hosts.equiv ld.so.cache passwd.OLD shadow
ftpusers hotplug ld.so.conf profile sysconfig
ftpwelcome inetd.conf localtime protocols termcap
group init.d modules rc.d timezone
host.conf initlog.conf motd resolv.conf
[root@gp2x etc]$cd samba
[root@gp2x samba]$ls -al
drwxr-xr-x 1 root root 512 Jan 1 1970 .
drwxr-xr-x 1 root root 512 Aug 10 2006 ..
-rw-r--r-- 1 root root 20 Jan 1 00:03 lmhosts
-rw-r--r-- 1 root root 8192 Jan 1 00:03 secrets.tdb
-rwxr--r-- 1 root root 481 Jan 1 00:04 smb.conf
-rw-r--r-- 1 root root 105 Jan 1 00:14 smbusers
[root@gp2x samba]$cat smb.conf
# Global parameters
[global]
workgroup = GP2X
server string = GP2X-F100
log file = /tmp/samba/%m.log
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
security = user
guest account = root
coding system = utf8
client code page = 949
preserve case = yes
short preserve case = yes

[gp2x]
path = /
public = Yes
writeable = Yes
browseable = Yes
create mask = 0777
directory mask = 0777
read only = No
valid users = gmiller, root
guest ok = Yes
[root@gp2x samba]$
 
Linux 2.4.25 (gp2x) (ttyp0)


gp2x login: root

[root@gp2x root]$
[root@gp2x root]$cd /etc
[root@gp2x etc]$
[root@gp2x etc]$ls
HOSTNAME hosts inittab network securetty
config hosts.allow inputrc nsswitch.conf services
devfsd.conf hosts.deny ioctl.save passwd shadow
fstab hosts.equiv ld.so.cache profile shadow-
ftpusers hotplug ld.so.conf protocols sysconfig
ftpwelcome inetd.conf localtime rc.d termcap
group init.d modules resolv.conf timezone
host.conf initlog.conf motd samba
[root@gp2x etc]$
[root@gp2x etc]$cd samba
[root@gp2x samba]$
[root@gp2x samba]$ls -al
drwxr-xr-x 1 root root 512 Jan 1 00:05 .
drwxr-xr-x 1 root root 512 Aug 10 2006 ..
-rw-r--r-- 1 root root 0 Jan 1 00:05 lmhosts
-rw-r--r-- 1 root root 8192 Jan 1 00:05 secrets.tdb
-rw-r--r-- 1 root root 0 Jan 1 00:05 smb.conf
-rw-r--r-- 1 root root 0 Jan 1 00:05 smbusers
[root@gp2x samba]$
[root@gp2x samba]$cat smb.conf
[root@gp2x samba]$
[root@gp2x samba]$

This is what my GP2X prints out following a reboot. :(
 
Ok here is what I did:
#Telnet to GP2X and edited smb.conf:
[root@gp2x samba]$vi smb.conf
[root@gp2x samba]$ls -al
drwxr-xr-x 1 root root 512 Jan 1 1970 .
drwxr-xr-x 1 root root 512 Aug 10 2006 ..
-rw-r--r-- 1 root root 20 Jan 1 00:03 lmhosts
-rw-r--r-- 1 root root 8192 Jan 1 00:03 secrets.tdb
-rwxr--r-- 1 root root 524 Jan 1 00:01 smb.conf (new size)
-rw-r--r-- 1 root root 105 Jan 1 00:14 smbusers
[root@gp2x samba]$exit
#Turned system off and then back on.
# all files same as the last time
[root@gp2x root]$cd /etc/samba/
[root@gp2x samba]$ls -al
drwxr-xr-x 1 root root 512 Jan 1 1970 .
drwxr-xr-x 1 root root 512 Aug 10 2006 ..
-rw-r--r-- 1 root root 20 Jan 1 00:03 lmhosts
-rw-r--r-- 1 root root 8192 Jan 1 00:03 secrets.tdb
-rwxr--r-- 1 root root 524 Jan 1 00:01 smb.conf
-rw-r--r-- 1 root root 105 Jan 1 00:14 smbusers
[root@gp2x samba]$exit
# Went into system and changed samba to always on
# turned power off and then back on
[root@gp2x samba]$ls -al
drwxr-xr-x 1 root root 512 Jan 1 1970 .
drwxr-xr-x 1 root root 512 Aug 10 2006 ..
-rw-r--r-- 1 root root 20 Jan 1 00:03 lmhosts
-rw-r--r-- 1 root root 8192 Jan 1 00:03 secrets.tdb
-rwxr--r-- 1 root root 524 Jan 1 00:01 smb.conf
-rw-r--r-- 1 root root 105 Jan 1 00:14 smbusers
[root@gp2x samba]$exit

What firmware are you running, and do you have any customized startup scripts? I will try another smb.conf since mine shows the system but does not let me browse.
 
I am using firmware 2.1.1 which I just updated to from 2.1.0. I'm not running any extra startup scripts or anything. In fact, I haven't modified anything except the smb.conf and then the entire samba folder. I did do a few things that I thought were weird.

1 I was messing around with the [Tab][Tab] command in telnet and typed dd to do a dump, but I wasn't sure what that meant and my GP2X seemed to stop responding after a while so I shut it off. Note that this happened well before I even messed with the smb.conf.

2 I had the GP2X originally configured to ip address 10.1.0.2 per that wiki guide. I set up the adapter on my comp to 10.1.0.1 with a mask of 255.0.0.0. I changed the ip address of the GP2X to 192.168.0.200 later because I needed to create a bridge between it and my other network adaptor.

3 I'm fairly sure that I may have corrupted the smb.conf through an incomplete ftp file transfer originally since core ftp crashed on me. This shouldn't still cause issues though.

4 Finally, I have to disable and enable the GP2X adaptor every time I connect my GP2X to my computer or else it won't recognize the GP2X.

5 I noticed that I have been using the password "root" to login with ftp. I read the guide and it said not to do this. Maybe that is the answer.

Hmm, it requires you to use "root" as the password. Is there any way to disable this? I feel that maybe the GP2X is unable to access the files since they are created with the root account that has a password. How can I remove the password?
 
Have you checked to see if the files get transfered to the GP2X prior to reboot? The root ownership is probably not a problem here because the samba code might be running as root. use the following to find out:

ps -ef | grep smb

"smbd" is one of the programs that is part of the "samba" suite.
 
Linux 2.4.25 (gp2x) (ttyp0)


gp2x login: root

[root@gp2x root]$
[root@gp2x root]$synch
sh: synch: command not found
[root@gp2x root]$
[root@gp2x root]$
Display all 248 possibilities? (y or n)
! doexec ifuser nmbd tail
+ domainname in nohup tar
. done in.ftpd nslookup tcpd
: du in.telnetd passwd tee
[ echo inetd pathchk telinit
[[ egrep init pidof test
]] elif initlog ping then
addgroup else insmod pinky thttpd
adduser enable ipcalc popd time
agetty env jpegdec portmap times
alias esac kill poweroff tinylogin
autologin eval killall printenv touch
basename exec killall5 printf traceroute
bash exit klogd ps trap
bind expand last pushd true
break export lastb pwd tty
builtin expr let quit type
busybox factor ll rdate typeset
case false ln read ulimit
cat fc local readonly umask
cd fdisk logger reboot umount
cd.. fgrep login reset unalias
chgrp fi logname return uname
chmod find logout rm uniq
chown for losetup rmdir unset
chroot free ls rmmod until
chvt freeramdisk lsmod route uptime
clear ftp m rungetty usernetctl
command function madplay runlevel users
compgen getkey mesg sed usleep
complete getopts mingetty select utmpdump
consoletype getty minilogd seq v
continue grep mkdir set va
cp groups mkdosfs sfdisk vdir
cut gunzip mkfs sh vi
d gzip mkfs.msdos shift wait
da halt mklost+found shopt wall
date hash mknod shutdown wc
dd head mkswap sleep which
declare history mkusers smbd while
delgroup hostid mkyaffs sort who
deluser hostname modprobe source whoami
devfsd hotplug more stty xargs
df hwclock mount su yes
dir id mv sulogin ypdomainname
dirname if nameif swapoff zcat
dirs ifconfig netreport swapon {
dmesg ifdown netstat sync }
dnsdomainname ifport nice syslog
do ifup nisdomainname syslogd
[root@gp2x root]$sync
[root@gp2x root]$
[root@gp2x root]$sync
[root@gp2x root]$
[root@gp2x root]$ps -ef | grep smb
87 root 2356 S grep smb
[root@gp2x root]$
[root@gp2x root]$ps -ef | grep smb
89 root 2356 S grep smb
[root@gp2x root]$
[root@gp2x root]$

I typed that twice and this is what came up.

Edit: I rebooted, typed in the same command, and this came up.

57 root 2356 S grep smb

Then I typed the command multiple times and each time everything increased a bit.

57 went up by 2 each time and 2356 went to 2308 and then back to 2356.
 
I turned on samba and then rebooted and here are two of the programs in the samba suite:

Code:
[root@gp2x root]$ps -ef | grep smb
   90 root	   4760 S	/sbin/smbd 
   99 root	   2356 S	grep smb 
[root@gp2x root]$ps -ef | grep nmb
   92 root	   3692 S	/sbin/nmbd 
  101 root	   2356 S	grep nmb 
[root@gp2x root]$exit
logout
Connection closed by foreign host.
/home/gmiller/ $

The first column is the 'pid' number (process id, followed by the user for that pid, next number is ??size?? and the S means (sicky bit, priv task - I think). So based on your results the samba code is not even running. Try copying the desired smb.conf to the system telnet'ing in and confirming it is there and has data in it (try 'cat smb.conf' to see the data). then do a 'sync' to force data to be written out. Exit from the telnet and then power off/on and check the file again.
 
Linux 2.4.25 (gp2x) (ttyp0)
gp2x login: root

[root@gp2x root]$
[root@gp2x root]$synch
sh: synch: command not found

It's sync. I really can't understand why people add a h to the end. Adding the 'h' makes it go from 'sink' to 'cintch'. Of course dictionary.com disagrees with me. Whatever, can't change the world.
 
Last edited by a moderator:
Linux 2.4.25 (gp2x) (ttyp0)
gp2x login: root

[root@gp2x root]$
[root@gp2x root]$synch
sh: synch: command not found

It's sync. I really can't understand why people add a h to the end. Adding the 'h' makes it go from 'sink' to 'cintch'. Of course dictionary.com disagrees with me. Whatever, can't change the world.

It was 2 in the morning. I was trying to type sync, but I messed up and added an h. I apologize. :p

Edit: When I do a sync after confirming that the data is there, do I type sync smb.conf or just sync?

Edit 2: Nope, still doesn't show up. I tried following all of your directions. :(

Edit again: I think that I'm just going to downgrade and reupgrade the firmware. It should replace the samba folder entirely. Where can I find firmware 2.1.0? It doesn't seem to be on the GP2X website.
 
Last edited by a moderator:
Back
Top