PDA

View Full Version : Help sharing entire drive directory with Samba + Knoppix 5.0



Daddymac117
08-06-2006, 09:08 PM
Hey guys,

Im working on recovering files from a friend's laptop that WinXP crapped out on, and decided to try out a Knoppix CD for the first time :). I've connected the laptop to my home network to send files to my SuSE 10.0 machine (my current desktop), so i can save them here and reformat the laptop's NTFS drive. Samba is fully enabled, and I'm currently able to share files between both SuSE 10.0 and Knoppix 5.0.1 machines, but I can only share files or directories that reside within my /home directory on the Knoppix machine.

Theres about 8.5gb worth of stuff that im attempting to recover, and the task is going extremely slow since i have to copy a directory from the /media/hda1 hdd into the /home directory, and share from there...its extremely slow since it seems that any folder larger than 200mb lags extremely hard when copying over and eventually freezes, crashing the entire laptop.

Ideally, id really want to just share the entire /media/hda1 directory, so i can just access it all from my SuSE machine and save everything that i want here, rather than having to manipulate the files on the laptop, wait for the directories to be copied into /home, hope nothing freezes, then finally sharing the directory. Is there any possible settings to change to allow me to share directories that don't reside within my /home directory?

Thanks in advance!!

pstone
06-16-2007, 08:07 AM
Just fyi, I am also having the same problem in that sharing a drive that's NTFS via Knoppix (which can be done, I think you just need to engage the LISa server and then you can access the drive... I THINK... I'm a noob and I know when you just turn on SAMBA, it doesn't show up but everytime I configure LISa, it shows up), the transfer of the files off the NTFS drive are 1/2 as fast then off a FAT drive and they lock up and eventually the receiving machine times out / says the machine is not on the network anymore, etc... :(

There's a problem here with the NTFS drivers I think as I've already tried this on a linksys NIC card with the same results.

Also same problem happens in Debian.

rusty
06-16-2007, 04:11 PM
You might want to try using sftp as an alternative.

Start knoppix as root by typing: knoppix 2, at the root shell

at the root prompt set a password by typing: passwd

Start the x server type: startx

Start the ssh daemon: k->knoppix->services->start ssh server

mount the drive you want to share, i did it using konqueror.

On your Suse , open a shell and type: sftp root@ip.address.of.knoppix

type help, for a list of commands.


HTH

pstone
06-16-2007, 06:25 PM
Thanks Rusty.

I'm personally trying to be able to share the drive with 40 XP PC's via the network neighborhood - any idea on why nfts mounted drives would time out as they are doing?

mr-roboto
06-27-2007, 03:42 PM
Thanks Rusty.

I'm personally trying to be able to share the drive with 40 XP PC's via the network neighborhood - any idea on why nfts mounted drives would time out as they are doing?

I haven't tried to fix this, as my networked PCs are inches apart in the same room, but if you're having NTFS timeout probs it's probably bec the default Samba config is setup to mount/unmount the shares periodically. You'll be able to follow this if you start the System Log from the Knoppix->Services menu (I did that from memory, using Windows rite now.) Anyway, you can change that behavior by modifying the SMB.CONF template used by the Samba server script. I simply don't know the precise combination of SMB.CONF options....Jet

pstone
06-27-2007, 04:42 PM
Apparently it's not Samba, but no unix in the world will work with NTFS like the way I want. Pushing several 500-700MB files. For small files, NTFS is forgiving under unix but large files = doesn't work at all. Went FAT32 :)

mr-roboto
06-27-2007, 08:13 PM
Apparently it's not Samba, but no unix in the world will work with NTFS like the way I want. Pushing several 500-700MB files. For small files, NTFS is forgiving under unix but large files = doesn't work at all. Went FAT32 :)

Absolutely not true, at least not in my environment. I've been using Knoppix (5.1-CD) to move files of several hundred MBs from one PC to another all year. In fact, I just did an offload of a few GBs just yesterday. I do downloads off the 'Net (ISOs, movies, etc) on two PCs, but only one has a working DVD burner for moment. For reasons that defy reason, going from XP to XP (to the burner PC) really blows, hence my trial of Knoppix. In fact, the 1st few times I used my ad-hoc Knoppix server, I did MD5 digests to make sure I was getting accurate transfers. I'm sold on it now.

Regarding Samba vs FAT32/NTFS, when I discovered Samba (2.x) several years ago, it didn't work well w/ FAT32 partitions. Big files uploaded during peak server loads == periodic server crashes. Samba 3 is much improved and I haven't seen a single hangup going to/from Knoppix+Samba. Of course, YMMV....Jet

pstone
06-27-2007, 08:20 PM
Odd cause I also am using Knoppix 5.1 and it failed on 3 different machines using a NTFS drive. It would slow down/stutter after about 5 seconds of xfer to just one machine... then eventually time out and the WXP machine would claim it could not find the machine on the network anymore.

Could you maybe post your SAMBA file and if I feel crazy enough on day, I can try it again.

Ohh... off topic a little, is there any other network monitoring programs like the one that comes with knoppix that shows realtime data of data xfering across the network - hasn't someone made a matrix style looking data monitor yet? :)

mr-roboto
06-28-2007, 05:03 AM
There's little to share but here it is:



;
; /etc/samba/smb.conf
;
; Sample configuration file for the Samba suite for Debian GNU/Linux
;
; Please see the manual page for smb.conf for detailed description of
; every parameter.
;

[global]

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
printing = cups
printcap name = cups
load printers = yes
guest account = nobody
invalid users = root

; "security = user" is always a good idea. This will require a Unix account
; in this server for every user accessing the server.
security = user

; Change this for the workgroup your Samba server will part of
workgroup = WORKGROUP

server string = %h server (Samba %v)

; If you want Samba to log though syslog only then set the following
; parameter to 'yes'. Please note that logging through syslog in
; Samba is still experimental.
syslog only = no

; We want Samba to log a minimum amount of information to syslog. Everything
; should go to /var/log/{smb,nmb} instead. If you want to log through
; syslog you should set the following parameter to something higher.
syslog = 0;

; This socket options really speed up Samba under Linux, according to my
; own tests.
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=4096 SO_RCVBUF=4096

; Passwords are encrypted by default. This way the latest Windows 95 and NT
; clients can connect to the Samba server with no problems.
encrypt passwords = true
; passdb backend = smbpasswd guest

; It's always a good idea to use a WINS server. If you want this server
; to be the WINS server for your network change the following parameter
; to "yes". Otherwise leave it as "no" and specify your WINS server
; below (note: only one Samba server can be the WINS server).
; Read BROWSING.txt for more details.
wins support = no

; If this server is not the WINS server then specify who is it and uncomment
; next line.
; wins server = 172.16.0.10

# If we receive WINS server info from DHCP, override the options above.
include = /etc/samba/dhcp.conf

; Please read BROWSING.txt and set the next four parameters according
; to your network setup. There is no valid default so they are commented
; out.
; os level = 0
; domain master = no
; local master = no
; preferred master = no

; What naming service and in what order should we use to resolve host names
; to IP addresses
name resolve order = lmhosts host wins bcast

; This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

; Name mangling options

preserve case = yes
short preserve case = yes

; This boolean parameter controlls whether Samba attempts to sync. the Unix
; password with the SMB password when the encrypted SMB password in the
; /etc/samba/smbpasswd file is changed.
unix password sync = false

; For Unix password sync. to work on a Debian GNU/Linux system, the following
; parameters must be set (thanks to Augustin Luton
; <aluton@hybrigenics.fr> for sending the correct chat script for
; the passwd program in Debian Potato).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

; The following parameter is useful only if you have the linpopup package
; installed. The samba maintainer and the linpopup maintainer are
; working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

; The default maximum log file size is 5 MBytes. That's too big so this
; next parameter sets it to 1 MByte. Currently, Samba rotates log
; files (/var/log/{smb,nmb} in Debian) when these files reach 1000 KBytes.
; A better solution would be to have Samba rotate the log file upon
; reception of a signal, but for now on, we have to live with this.
max log size = 1000

obey pam restrictions = yes

; Some defaults for winbind (make sure you're not using the ranges
; for something else.)
; winbind uid = 10000-20000
; winbind gid = 10000-20000
; template shell = /bin/bash

; ISOLATIN1 with euro sign
unix charset = iso-8859-15
display charset = iso-8859-15
dos charset = 850

[homes]
comment = Home Directories
browseable = no

; By default, the home directories are exported read only. Change next
; parameter to "no" if you want to be able to write to them.
read only = no

; File creation mask is set to 0700 for security reasons. If you want to
; create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

; Directory creation mask is set to 0700 for security reasons. If you want to
; create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
guest ok = no
read only = no
write list = knoppix

[printers]
printer admin = knoppix
comment = All Printers
browseable = no
path = /tmp
printable = yes
public = no
writable = no
create mode = 0700

; A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; writable = no
; locking = no
; path = /cdrom
; public = yes
;
; The next two parameters show how to auto-mount a CD-ROM when the
; cdrom share is accesed. For this to work /etc/fstab must contain
; an entry like this:
;
; /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
;
; The CD-ROM gets unmounted automatically after the connection to the
;
; If you don't want to use auto-mounting/unmounting make sure the CD
; is mounted on /cdrom
;
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

[cdrom]
comment = /media/cdrom
browseable = yes
path = /media/cdrom
writeable = yes
preexec = /bin/mount /media/cdrom
postexec = /bin/umount /media/cdrom
[hdd]
comment = /media/hdd
browseable = yes
path = /media/hdd
writeable = yes
preexec = /bin/mount /media/hdd
postexec = /bin/umount /media/hdd
[hdc]
comment = /media/hdc
browseable = yes
path = /media/hdc
writeable = yes
preexec = /bin/mount /media/hdc
postexec = /bin/umount /media/hdc
[hda1]
comment = /media/hda1
browseable = yes
path = /media/hda1
writeable = yes
preexec = /bin/mount /media/hda1
postexec = /bin/umount /media/hda1
[hda2]
comment = /media/hda2
browseable = yes
path = /media/hda2
writeable = yes
preexec = /bin/mount /media/hda2
postexec = /bin/umount /media/hda2
[hda3]
comment = /media/hda3
browseable = yes
path = /media/hda3
writeable = yes
preexec = /bin/mount /media/hda3
postexec = /bin/umount /media/hda3
[hda5]
comment = /media/hda5
browseable = yes
path = /media/hda5
writeable = yes
preexec = /bin/mount /media/hda5
postexec = /bin/umount /media/hda5
[hda6]
comment = /media/hda6
browseable = yes
path = /media/hda6
writeable = yes
preexec = /bin/mount /media/hda6
postexec = /bin/umount /media/hda6
[hdb1]
comment = /media/hdb1
browseable = yes
path = /media/hdb1
writeable = yes
preexec = /bin/mount /media/hdb1
postexec = /bin/umount /media/hdb1
[hdb2]
comment = /media/hdb2
browseable = yes
path = /media/hdb2
writeable = yes
preexec = /bin/mount /media/hdb2
postexec = /bin/umount /media/hdb2
[hdb3]
comment = /media/hdb3
browseable = yes
path = /media/hdb3
writeable = yes
preexec = /bin/mount /media/hdb3
postexec = /bin/umount /media/hdb3


It sounds like you're having Ethernet probs, bec the default SMB.CONF
is so simplistic that I can't imagine how its settings would have an effect
on anything....

pstone
06-28-2007, 05:44 AM
I may be having an ethernet issue after all. I just hooked the gigabit network up, SAMBA'ed into a PC and am xfering 15gigs of data at a stead 12mbit a second :-|

That's just not right... XP to XP it's running a lot faster then that...

Ugh... I'm thinking it's an ethernet driver issue. It's an on board ethernet gigabit interface and I even dropped a linksys gigabit ethernet adapter in there thinking it would be more standard but same problem exists.... time to do more research... 12mb on a 1000 connection is bad :P

Harry Kuhman
06-28-2007, 06:13 AM
.... xfering 15gigs of data at a stead 12mbit a second :-|

That's just not right... XP to XP it's running a lot faster then that...
There is absolutely no reason to think that Microsoft wouldn't deliberately work slower when it detects a non-Xp OS out there. In fact I can assure you that it does. Of course, I can't say that this is a deliberate effort to make Linux look bad, but form your own opnion about that.

If transfer speed matters then I suggest firing up an FTP server on XP and using Konquror as an FTP client on Knoppix, your transfers will be much faster (with the same ethernet drivers).

pstone
06-28-2007, 07:31 AM
heh - well the issue is that this is an active gaming center and we can't have ftp servers running in the background on all the machines... I'm thinking it's some sort of setting of the ethernet card on the unix machine maybe?

We chose unix as our fileserver because of the limitation in windows of how many machines can be on the network at one time (something like 10 or 12 in XP) and we need all machines to be able to access batch files and mounting CD images all at once. With over 30 machines, you can't do that with a windows file server without paying thousands of dollars to get past the machine limitation.

Every once in a while however we would like to push 10gigs or so to a bunch of machines at once. Our old 100 based network system did this without the hiccups we're seeing here but once we added the gig network, not only does the unix box show 1/8th the speed, but when we push from 1 machine source to more then 1 machine, we get massive slow downs...

1:1 machine push of 15 gigs of data = 8 mins
1:2 machines push of 15 gigs od data = 100 mins avg each machine... somethings wrong there :(

Turning flow control off really screwed things up strangly enough and Jumbo Frames made no difference.

Harry Kuhman
06-28-2007, 07:48 AM
heh - well the issue is that this is an active gaming center and we can't.....
I'm not at all clear on what you are trying to do. If you are trying to have a way to let customers outside your local network send files to your system, or send files from your system to them, then you are inviting trouble, even with XP. More and more ISPs, some very large ones, are actively blocking the ports used in Microsoft file sharing. (A reprocussion of file sharing being so insecure and of many older systems having it on and sharing files with the entire world by default.) If you're only talking about moving files in-house then you certainly could have a secure small FTP server running all of the time, or you could use any number of ways to automatically start one just when you need it. By the way, I don't believe you'll find only XP to Linux transfers to be slower than XP to XP transfers. Even transfers from Win98 to Xp are much slower than transfers between XP and Xp or between Win98 and Win98.

And I certainly hope you're not using Knoppix in this system as a production tool. A Linux intended for hard disk install makes so much more sense.

mr-roboto
06-28-2007, 02:31 PM
Actually, I don't believe that Samba is the issue. As I wrote earlier, when I was new to Samba, I tried to use it as pstone is, by using FAT32 partitions for my shares. Sub-optimal idea. A hdrive-installed Linux won't completely address these issues. However once the Samba config file is perfected (tweaked out), ext2 partitions are created and shared, Samba will perform quite well as compared to a XP/2K3 server box. (BTW, I also learned the hard way that not all Linux Ethernet drivers are equal, particularly in a LAN/NAS context.) Knoppix' Samba Server script is the best that a newbie can expect, prior to learning to customize an optimal solution for Linux-based NAS.

Tweaking Samba is a non-trivial (altho not difficult) exercise, esp for a Linux newbie. One answer to that is NAS-Lite (http://www.serverelements.com/index.php). Server Elements gets pretty good reviews and is a very inexpensive way to jump-start a Linux-based NAS server, that comes standard w/ other helpful bells-n-whistles....

mr-roboto
06-28-2007, 04:42 PM
Here's a link to O'Reilly's Using Samba, Appendix B (http://www.oreilly.com/catalog/samba/chapter/book/appb_01.html), covering performance tuning.....

pstone
06-29-2007, 05:05 AM
Ok - problem solved - dropped Knoppix - using debian. Works like a dream. Just need to not only share the drive with it's built in sharing but also mount drive w/fstab as if you don't you can't actually change the permissions to allow for any guests to log into it - DOH -