samba is changing mount points?
I have tentatively posted this here; if it should be in "networking" let me know.
I have a dual boot machine with Ubuntu Hardy 8.04.1 and XP. Each OS is on its own IDE drive, XP on the primary. This machine runs Linux most of the time, and is a file server. There are also two SATA drives for storage on the machine. I installed XP first, followed by Ubuntu, and fdisk reported this: Code:
Disk /dev/sda: 40.0 GB, 40020664320 bytes So far, no problem, although I did wonder at the time why the OS's werent on hda/hdb. I thought that would be correct for IDE drives. Anyway, I wanted to set up SAMBA to share some of the directories on the SATA drives with another[XP]machine. I had all kinds of problems - the drives would show up, then not show up after a reboot/startup; EXTREMELY SLOW copy speeds both to and from the Linux box, (for example the machine wanted 70 minutes to copy a 23MB file to the XP machine); and various other problems with the setup. I do have some practice with SAMBA in 7.10 but 8.04 has changed all that. I researched and read inumerable posts over a three day period and decided to start over and set up SAMBA again. Basically, I installed SAMBA and SMBFS, set the mount points for the two drives in fstab, and slowly worked through smb.conf. Every time I marked a share, the drive would not automount. I couldn't understand this but kept looking for the problem. After some time I realized that the mount points were shifting[?]/changing[?] on their own-like this: Code:
Disk /dev/sda: 160.0 GB, 160041885696 bytes I'm not sure what I'm doing wrong. All I want to do is be able to automount the 2 SATA drives and share some of the directories with the XP machine. I reckon that something I did wrong was also the cause of the slow file operations. If I can get SAMBA set up properly, I can check that next. fstab and smb.conf are here: Code:
# /etc/fstab: static file system information. Code:
[global] |
Hi Thunder,
if I understand correctly, you have in fact two problems: One related to samba causing your accesses to be very slow, and a second one causing your drives not to get predictable device files. I would work on second one first and gain performance afterwards. If I understand correctly furthermore, your system does not generate predictable device files on booting time. (E.g. system disk is /dev/sdb one time and /dev/sdd next time). You have no trouble with your system disk since it is mounted using its UUID. Your fstab shows: Code:
UUID=e4e7a3e8-1a47-434d-89b9-27791d79be88 / ext3 relatime,errors=remount-ro 0 1 The devices storing your shares are mounted by device files: Code:
/dev/sdc1 * 1 19457 156288321 c W95 FAT32 (LBA) So how to get out of this... You can use UUIDs for these devices, too. This way it does not matter what device files your system generates for these devices. UUIDs are unique for any filesystem and do not change - this is what you need. To determine your devices UUIDs, you can either use a command line tool - but I sadly did forget its name. Another way to determine them is to look at /dev/disk/by-uuis. You find a symbolic link for each device. The link has the UUID as name and points towards the coresponding device. E.g: Code:
clemens@hammerhai : ~ : 14:54 Use this UUID according to the pattern for your root filesystem in your fstab. Another way would be configuring udev to generate predictable device names - but to do this, you should ask anyone other. ;-) Hope this long (sorry) posting helps a bit. Greet-o-mente |
Hi again,
according to your smb.conf, there is not one share your XP drives could see... All share definitions (starting with [SHARENAME]) are commented out... To check your smb.conf, you can type Code:
testparm Do you get any? You mentioned that copy data from your linux box to another xp box took very long time. I assume, that you mounted a share from your xp machine into your linux filesystem. If so, the copy operation does not involve your samba server. In this case, the server is your xp machine. Please post how you did mount your xp share. You should propably clarify yourself, that the samba server does not mount anything anywhere. Your system mounts any local or remote filesystems into its root filesystem to access them. The samba server uses any local mounted directory to present it other machines as mountable filesystem. -- The samba server can use any directory - and this includes everything your system mounted from anywhere - and export it to remote machines. Remote machines can use these exported directories to mount them locally, then. -- The remote (client) machine uses a filesystem as smbfs to mount any shared samba directory. The local machint (server) does use the samba server to export any directories. I realize, that I did write the same thing three times and stop for not becoming too boring... ;-) Greet-o-mente |
Ok, thanks for answering. I'll see if I can clear up your questions and maybe you will have some advice.
Quote:
Quote:
Quote:
Quote:
Code:
thunderrd@OPTERON-185:/dev/disk/by-uuid$ ls EDIT: Duh. Figured it out, and here's the output. Now what do I do? Code:
thunderrd@OPTERON-185:~$ ls /dev/disk/by-uuid/ -alh sdb1 and sdb5 are Linux partitions on the slave. sdc1 is SATA 160GB - there will be shares on this one sdd1 is SATA 250GB - there will be shares on this one Quote:
Quote:
There is nothing on the XP machine that I want to share on the Linux machine[for now, at least]. I hope that this will help you to understand my problem, and thank you for spending your time with me. ;) |
OK, I have edited fstab like this:
Code:
# /etc/fstab: static file system information. I'll try to edit smb.conf now, to set up the shares. Thanks so far! |
I took a plunge and edited smb.conf to see if the shares would be seen on the XP machine:
Code:
[global] But...file copying is back to super slow speeds again. I can't think of why this could be happening. All I did was reboot the machine. At this point I have 3 problems: 1- the SATA drives mount automatically as I wish, but can't be unmounted except for superuser. 2- I can't write to the shares, except as superuser, so I can't write to them from the XP box[related to #1]. And 3- Slow copy speeds again, in both directions. Thanks again! PS the command you were thinking of before is blkid: Code:
thunderrd@OPTERON-185:~$ sudo blkid |
Yes, blkid it was, thank you. I hope I will remember little longer this time. ;-)
To the three problems: Quote:
Code:
UUID=E8C8-82D7 /media/FAT32_REPO vfat rw,user,auto,exec 0 0 Code:
UUID=E8C8-82D7 /media/FAT32_REPO vfat rw,users,auto,exec 0 0 This way, non-privilieged users can umount the device with following commands: Code:
umount /media/FAT32_REPO Quote:
Or do you mean, that you only can write into the sambe share, if you access the share as root or administrator or similar? Means: Root is sitting in front of the XP machine. Hopefully that you mean first - this one is propably easier to solve, hehe - you can check Code:
man mount Using vfat, you can apply following options to specify access rights of your mounted device: Code:
uid=value Code:
UUID=E8C8-82D7 /media/FAT32_REPO vfat rw,users,auto,exec,uid=1000,gid=50,umask=0007 0 0 owner: read, write, execute group: read, write, execute others: no access The umask option does determine what rights are NOT to be granted. Keep in mind, that vfat does not know any real access rights. They are all "virtual". Even if any file appears to be unaccessable by any user, on next remount things can look completely different. You can list all user and group ids known to the system using following commands: Code:
getent passwd Code:
ls -l /to/your/mountpoint # with device mounted Quote:
A last thing: Do you plan to share removable devices with samba? If yes, you should make sure, that you do not produce funny situations. E.g. one user does a large write job using network while another user unmounts the filesystem. I am not sure about what samba feels about getting it's shares unmounted. If all is set up, you propably should do some testing... |
Well, thanks to you I *think* that I have it under control now. I played with the permissions and was able to accomplish what I wanted - to mount and umount teh devices and access them from the remote machine(s). Since it's only my home office network and I really the only user it makes it fairly easy; I don't have to be too concerned with security at this level.
And the good news is that after I got the proper permissions set the copy speeds were back to normal, and after rebooting it stayed that way. I remember going through all of this before when I installed Gutsy but the upgrade to Hardy and the newer kernel broke all of that work. I'm not alone. Many users have been experiencing the same kinds of Samba problems after upgrading. I didn't document for myself what I had done to get it right the last time but you can be sure that I won't make that mistake again. In any case I think that Samba is like a bunch of rubber bands and duct tape that everyone uses to fix stuff. It isn't really that great a fix for windows networking, and it's not terribly intuitive in setup. I hope that ultimately a better way will come along. Many thanks again for the tips and the help. I'll ask again if I need something more, but I have a feeling that it's ok now. |
Then... Good luck!
By the way, I never trusted in distribution upgrades by package managers - No matter what people. Your story does strengthen my distrust. ;-) |
Negative progress-
Today the file copy speed is gone again. It had been ok since my last post, and I have changed nothing. I am totally confused as to why this would happen. I'll post the relevant files here; if anyone needs something more just let me know what will help the troubleshooting process. Code:
thunderrd@OPTERON-185:~$ sudo fdisk -l Code:
# /etc/fstab: static file system information. Code:
[global] Code:
thunderrd@OPTERON-185:~$ ls -l /media/FAT32_ARCH |
Hi again.
Bad news. So we have to look for the reason of this slow transfer rate - I hope we wil find it, and we will find it fast... I would take a look on your ethernet connection first. 1) Do you use a realtek gigabit network adapter (RTL8169 IIRC)? 2) On your ubuntu machine, please install iftop, dstat and htop: Code:
sudo apt-get install iftop dstat htop 3) Do you know netio? This is a little tool to check network transfer rates at somewhat low level. You can get it here: netio Usage is quite simple: Start the tool in server mode on one machine Code:
netio -s -t Code:
netio -t $(SERVER_IP) If possible, run netio while having trouble with samba speed and another time while having no trouble. Please post the output. 4) Pease do following: While transferring some files at very slow speed using samba, a) run iftop on ubuntu command line as root. You will see nice statistics about current network traffic. Find the meter, that represents the data stream that copies your file. b) In another terminal, do ping the XP client. Does the connection gain speed significantly while executing the ping? 5) While running a very slow transfer, please start htop on ubuntu. You will see some CPU and memory usage snapshots (much more nice than odd top). Is the CPU kind of busy (between 90% and 100%)? If yes, what are main COU cycle consumers? (Should mean - what processes give heavy load...). That's all for now. Perhaps we find some hints so far. Greet-o-mente |
1 - I have all the tools you asked for but I'm not sure how to compile netio...when I figure it out I'll let you know.
2 - After a reboot, the file copy speeds have returned. I don't know why it's doing this. We made fdsik look at the UUID for these drives; is it possible that something is still "shifting" at the reboot? Most likely, the next reboot hoses the speeds again. Do you think this is Samba, or something else? And...thanks again for taking time for me:) |
I already wrote by pm - just for the archives: The netio zip file linked above contains a folder "bin". Within this folder are binaries for linux and Windows - if applicable, no compiling is necessary.
Without knowing too much about your systems, I don't think that there is any problem with Samba. In fact, my problems with samba file sharings did always concern any problems outside of sambe. I once had serious performance trouble - and this is what I thought about when I asked you for your network adapter - while transfering big or a lot of files (more than 15 files, more than 20 MB). This resolved to a major driver problem with F*$&!(§ Realtek 1000MB cards I never get fixed... I replaced that card. ;-) We will see how to get your problem solved. ;-) Greet-o-mente |
Well, I have a couple of bits for you.
1- no Realtek network cards. 2- here is the output of netio; note that this is while files are copying normally. As I said in my last post, the file speeds are ok again. Code:
[with xp machine (gateway) as client; copy speeds are normal] When the speeds get slow again I'll do the rest of the tasks you assigned me, and I'll post again. Thanks. |
Quote:
Code:
XP client/Linux server, copy speeds are slow Quote:
Quote:
I hope this can tell you something, but I don't know. ;) I'm going to reboot, re-mount, and see if the speeds will come back as before. ======>EDIT:<====== Fdisk is still reporting the mount points of attached drives differently at times. When fdisk looks like this, everything is OK: Code:
Disk /dev/sda: 40.0 GB, 40020664320 bytes Code:
Disk /dev/sda: 160.0 GB, 160041885696 bytes |
All times are GMT -5. The time now is 07:31 AM. |