LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-26-2008, 03:12 AM   #1
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Rep: Reputation: 0
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
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bd87bd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1530    12289693+   7  HPFS/NTFS
/dev/sda2            1531        4865    26788387+   7  HPFS/NTFS

Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6639b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4660    37431418+  83  Linux
/dev/sdb2            4661        4865     1646662+   5  Extended
/dev/sdb5            4661        4865     1646631   82  Linux swap / Solaris

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x130f286b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       19457   156288321    c  W95 FAT32 (LBA)

Disk /dev/sdd: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7a3e006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       30401   244196001    b  W95 FAT32
As you can see XP is on sda1, Linux on sdb1, and sdc1/sdd1 are the SATA drives.

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
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x130f286b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19457   156288321    c  W95 FAT32 (LBA)

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7a3e006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30401   244196001    b  W95 FAT32

Disk /dev/sdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bd87bd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1530    12289693+   7  HPFS/NTFS
/dev/sdc2            1531        4865    26788387+   7  HPFS/NTFS

Disk /dev/sdd: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6639b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        4660    37431418+  83  Linux
/dev/sdd2            4661        4865     1646662+   5  Extended
/dev/sdd5            4661        4865     1646631   82  Linux swap / Solaris
As you can see the output of fdisk is completely different here. This was giving me fits. I would get the shares set, the XP box would see them, and could copy them (VERY SLOWLY), but the next time I booted the machine the mount points would disappear and so would the shares - along with the drives not mounting.

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.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0

UUID=e4e7a3e8-1a47-434d-89b9-27791d79be88 /               ext3    relatime,errors=remount-ro 0       1

UUID=6b80dd2e-1943-4a6b-a432-452160ac8c12 none            swap    sw              0       0

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 	0       0

/dev/scd1       /media/cdrom1   udf,iso9660 user,noauto,exec,utf8 	0       0

/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 	0       0

/dev/sdc1	/media/FAT32_REPO	vfat	rw,user,auto,exec	0	0

/dev/sdd1	/media/FAT32_ARCH	vfat	rw,user,auto,exec	0	0
Code:
[global]
    ; General server settings
    netbios name = OPTERON-185
    server string = %h server       (Samba, Ubuntu 8.04.1)
    workgroup = RBZGROUP
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = lmhosts wins bcast

    wins support = yes

    printing = CUPS
    printcap name = CUPS

    syslog = 1
    syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
    ;valid users = %S
    ;create mode = 0600
    ;directory mode = 0755
    ;browseable = no
    ;read only = no
    ;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
    ;path = /var/lib/samba/netlogon
    ;admin users = Administrator
    ;valid users = %U
    ;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
    ;path = /var/lib/samba/profiles
    ;valid users = %U
    ;create mode = 0600
    ;directory mode = 0700
    ;writeable = yes
    ;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
;    path = /var/lib/samba/printers
;    browseable = yes
;    guest ok = yes
;    read only = yes
;    write list = root
;    create mask = 0664
;    directory mask = 0775

#[printers]
;    path = /tmp
;    printable = yes
;    guest ok = yes
;    browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
    ;path = /media/cdrom
    ;browseable = yes
    ;read only = yes
    ;guest ok = yes

;[MyFiles]
;    path = /media/samba/
;    browseable = yes
;    read only = no
;    guest ok = no
;    create mask = 0644
;    directory mask = 0755
;    force user = YOUR_USERNAME
;    force group = YOUR_USERGROUP


;My stuff would go here, it isn't there now but will be after I sort this out:
;    path = /media/path/to/share
;    browseable = yes
;    read only = no
;    guest ok = yes
 
Old 07-26-2008, 07:57 AM   #2
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
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
IIAR, same must be true in your boot manager.

The devices storing your shares are mounted by device files:
Code:
/dev/sdc1   *           1       19457   156288321    c  W95 FAT32 (LBA) 
/dev/sdd1               1       30401   244196001    b  W95 FAT32
If these files (/dev/sdd1 and /dev/sdc1) do not exist, there is nothing to mount.

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
>cd /dev/disk/by-uuid

clemens@hammerhai : /dev/disk/by-uuid : 14:54
>ll
insgesamt 0
lrwxrwxrwx 1 root root 10 2008-07-26 15:58 34f01b8c-11db-48c0-8346-bb14d24901c8 -> ../../sda2
lrwxrwxrwx 1 root root 10 2008-07-26 15:58 a565f4e2-6d43-4e98-bd88-23b7fd056200 -> ../../sda6
lrwxrwxrwx 1 root root 10 2008-07-26 15:58 c2c447ca-83ea-4bbc-ab04-14aa31bc1b6e -> ../../sda3
lrwxrwxrwx 1 root root 10 2008-07-26 15:58 DEE800CFE800A83B -> ../../sda1
shows that a filesystem with UUID DEE800CFE800A83B is available by /dev/sda1.

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

Last edited by Clemente; 07-26-2008 at 08:12 AM.
 
Old 07-26-2008, 08:07 AM   #3
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
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
. This program checks your smb.conf for sanity and prints out all share definitions.
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

Last edited by Clemente; 07-26-2008 at 08:10 AM.
 
Old 07-26-2008, 12:58 PM   #4
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Ok, thanks for answering. I'll see if I can clear up your questions and maybe you will have some advice.

Quote:
Originally Posted by Clemente View Post
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.
Yes, that's correct.

Quote:
Originally Posted by Clemente View Post
I would work on second one first and gain performance afterwards.
My feelings as well.

Quote:
Originally Posted by Clemente View Post
The devices storing your shares are mounted by device files:
Code:
/dev/sdc1   *           1       19457   156288321    c  W95 FAT32 (LBA) 
/dev/sdd1               1       30401   244196001    b  W95 FAT32
If these files (/dev/sdd1 and /dev/sdc1) do not exist, there is nothing to mount.
I understand. I just don't understand why it only happens when I mark a share.

Quote:
Originally Posted by Clemente View Post
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
>cd /dev/disk/by-uuid

clemens@hammerhai : /dev/disk/by-uuid : 14:54
>ll
I have that directory, but I can't see anything in it..."ll" isn't a command I know. Here's the contents of the directory:
Code:
thunderrd@OPTERON-185:/dev/disk/by-uuid$ ls
4889-5BE5                             78209B95209B58C8  e4e7a3e8-1a47-434d-89b9-27791d79be88  ll
6b80dd2e-1943-4a6b-a432-452160ac8c12  C874268774267878  E8C8-82D7
If you can tell me how to look at what you want, I'll do it ASAP. Now, my question. When I know the uuid for say, sdd1, do I simply edit fstab and replace the /dev/sdd1 identification with the uuid?

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
total 0
drwxr-xr-x 2 root root 180 2008-07-27 00:30 .
drwxr-xr-x 6 root root 120 2008-07-25 22:49 ..
lrwxrwxrwx 1 root root  10 2008-07-25 15:49 4889-5BE5 -> ../../sdd1
lrwxrwxrwx 1 root root  10 2008-07-25 22:49 6b80dd2e-1943-4a6b-a432-452160ac8c12 -> ../../sdb5
lrwxrwxrwx 1 root root  10 2008-07-25 22:49 78209B95209B58C8 -> ../../sda2
lrwxrwxrwx 1 root root  10 2008-07-25 22:49 C874268774267878 -> ../../sda1
lrwxrwxrwx 1 root root  10 2008-07-25 22:49 e4e7a3e8-1a47-434d-89b9-27791d79be88 -> ../../sdb1
lrwxrwxrwx 1 root root  10 2008-07-25 15:49 E8C8-82D7 -> ../../sdc1
-rw-r--r-- 1 root root   0 2008-07-27 00:30 ll
So sda1 and sda2 are the NTFS partitions for windows on the master IDE.
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:
Originally Posted by Clemente View Post
according to your smb.conf, there is not one share your XP drives could see...
All share definitions (starting with [SHARENAME]) are commented out...
Yes, that is correct. I removed the lines from the file after I discovered that the mount points were shifting every time I marked a share. So yes, I know that at this time there are no shares marked.

Quote:
Originally Posted by Clemente View Post
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.
Well, the shared directory is on the Linux box[server?]. I wanted to copy files to the XP machine[client?]. At the time I did this, I could see the shared Linux directory in XP's filemanager. However, it copied so slowly that it was useless.

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.

Last edited by ThunderRd; 07-26-2008 at 01:21 PM.
 
Old 07-26-2008, 01:46 PM   #5
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
OK, I have edited fstab like this:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0

# sdb1: Linux
UUID=e4e7a3e8-1a47-434d-89b9-27791d79be88 /               ext3    relatime,errors=remount-ro 0       1

# sdb5: Linux swap
UUID=6b80dd2e-1943-4a6b-a432-452160ac8c12 none            swap    sw              0       0

# removable
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 	0       0
/dev/scd1       /media/cdrom1   udf,iso9660 user,noauto,exec,utf8 	0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 	0       0

# sdc1: SATA 160GB
#/dev/sdc1	/media/FAT32_REPO	vfat	rw,user,auto,exec	0	0
UUID=E8C8-82D7	/media/FAT32_REPO	vfat	rw,user,auto,exec	0	0

# sdd1: SATA 250GB
#/dev/sdd1	/media/FAT32_ARCH	vfat	rw,user,auto,exec	0	0
UUID=4889-5BE5	/media/FAT32_ARCH	vfat	rw,user,auto,exec	0	0
It looks ok, and the drives automount, but we have to change the permissions somehow so that mount and unmount are not restricted to root. Right now I can't unmount them unless I'm a superuser. How can I change this?

I'll try to edit smb.conf now, to set up the shares.

Thanks so far!

Last edited by ThunderRd; 07-26-2008 at 02:32 PM.
 
Old 07-26-2008, 01:48 PM   #6
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
I took a plunge and edited smb.conf to see if the shares would be seen on the XP machine:
Code:
[global]
    ; General server settings
    netbios name = OPTERON-185
    server string = %h server       (Samba, Ubuntu 8.04.1)
    workgroup = RBZGROUP
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    wins support = yes

    printing = CUPS
    printcap name = CUPS

    syslog = 1
    syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
    ;valid users = %S
    ;create mode = 0600
    ;directory mode = 0755
    ;browseable = no
    ;read only = no
    ;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
    ;path = /var/lib/samba/netlogon
    ;admin users = Administrator
    ;valid users = %U
    ;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
    ;path = /var/lib/samba/profiles
    ;valid users = %U
    ;create mode = 0600
    ;directory mode = 0700
    ;writeable = yes
    ;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
;    path = /var/lib/samba/printers
;    browseable = yes
;    guest ok = yes
;    read only = yes
;    write list = root
;    create mask = 0664
;    directory mask = 0775

#[printers]
;    path = /tmp
;    printable = yes
;    guest ok = yes
;    browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
    ;path = /media/cdrom
    ;browseable = yes
    ;read only = yes
    ;guest ok = yes

;[MyFiles]
;    path = /media/samba/
;    browseable = yes
;    read only = no
;    guest ok = no
;    create mask = 0644
;    directory mask = 0755
;    force user = YOUR_USERNAME
;    force group = YOUR_USERGROUP


[file_archive]
path = /media/FAT32_ARCH/file_archive
available = yes
browsable = yes
public = yes
writable = yes

[REPO_TEST_SHARE]
path = /media/FAT32_REPO/REPO_TEST_SHARE
available = yes
browsable = yes
public = yes
writable = yes
...and they are. So that is good. I tried to copy some files. They copied at full speed, both to and from the Linux box, so I thought that my problems were nearly over. I wanted to check though, so I re-booted the Linux box. When it came up, the shares could still be seen on the XP box, so everything looked good.

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
/dev/sda1: LABEL="FAT32_REPO" UUID="E8C8-82D7" TYPE="vfat" 
/dev/sdb1: LABEL="FAT32_ARCH" UUID="4889-5BE5" TYPE="vfat" 
/dev/sdc1: UUID="C874268774267878" LABEL="NTFS_OS" TYPE="ntfs" 
/dev/sdd1: UUID="e4e7a3e8-1a47-434d-89b9-27791d79be88" TYPE="ext3" 
/dev/sdc2: UUID="78209B95209B58C8" LABEL="NTFS_APPS" TYPE="ntfs" 
/dev/sdd5: TYPE="swap" UUID="6b80dd2e-1943-4a6b-a432-452160ac8c12"

Last edited by ThunderRd; 07-26-2008 at 02:30 PM.
 
Old 07-27-2008, 07:01 AM   #7
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
Yes, blkid it was, thank you. I hope I will remember little longer this time. ;-)

To the three problems:
Quote:
1- the SATA drives mount automatically as I wish, but can't be unmounted except for superuser.
Change following lines in your fstab:
Code:
UUID=E8C8-82D7	/media/FAT32_REPO	vfat	rw,user,auto,exec	0	0
UUID=4889-5BE5	/media/FAT32_ARCH	vfat	rw,user,auto,exec	0	0
To this:
Code:
UUID=E8C8-82D7	/media/FAT32_REPO	vfat	rw,users,auto,exec	0	0
UUID=4889-5BE5	/media/FAT32_ARCH	vfat	rw,users,auto,exec	0	0
Notice that the "user" statement changed to "users".
This way, non-privilieged users can umount the device with following commands:
Code:
umount /media/FAT32_REPO
umount /media/FAT32_REPO
And they can remount the same way - do only replace umount by mount.

Quote:
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].
Do you mean, that only root can locally write on the mounted devices (that should be shared via sambe)? Means: Root is sitting in front of the linux box.
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
for any mount options you can use with any filesystem.
Using vfat, you can apply following options to specify access rights of your mounted device:
Code:
uid=value 
gid=value 
umask=value 
dmask=value 
fmask=value
You can add them into your fstab options, e.g:
Code:
UUID=E8C8-82D7	/media/FAT32_REPO	vfat	rw,users,auto,exec,uid=1000,gid=50,umask=0007	0	0
This fstab entry causes your device to be mounted with owner set to the user with id 1000, group set to "staff" (usually id 50) and access rights set to:
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 
getent group
If you do not manage to set access rights to something useful, please post the output of
Code:
ls -l /to/your/mountpoint # with device mounted
and the content of your fstab.

Quote:
And 3- Slow copy speeds again, in both directions.
Let's do 1 and 2 first.

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...

Last edited by Clemente; 07-27-2008 at 07:12 AM.
 
Old 07-27-2008, 11:29 AM   #8
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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.
 
Old 07-27-2008, 11:40 AM   #9
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
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. ;-)
 
Old 07-30-2008, 06:43 AM   #10
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x130f286b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19457   156288321    c  W95 FAT32 (LBA)

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7a3e006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30401   244196001    b  W95 FAT32

Disk /dev/sdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bd87bd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1530    12289693+   7  HPFS/NTFS
/dev/sdc2            1531        4865    26788387+   7  HPFS/NTFS

Disk /dev/sdd: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6639b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        4660    37431418+  83  Linux
/dev/sdd2            4661        4865     1646662+   5  Extended
/dev/sdd5            4661        4865     1646631   82  Linux swap / Solaris
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc            /proc           proc    defaults        0       0

# sdb1: Linux
UUID=e4e7a3e8-1a47-434d-89b9-27791d79be88 /               ext3    relatime,errors=remount-ro 0       1

# sdb5: Linux swap
UUID=6b80dd2e-1943-4a6b-a432-452160ac8c12 none            swap    sw            	0       0

# removable
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 			0       0
/dev/scd1       /media/cdrom1   udf,iso9660 user,noauto,exec,utf8 			0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 			0       0

# sdc1: SATA 160GB
#/dev/sdc1	/media/FAT32_REPO	vfat	rw,user,auto,exec			0	0
UUID=E8C8-82D7	/media/FAT32_REPO	vfat	defaults,auto,users,umask=000		0	0

# sdd1: SATA 250GB
#/dev/sdd1	/media/FAT32_ARCH	vfat	rw,user,auto,exec			0	0
UUID=4889-5BE5	/media/FAT32_ARCH	vfat	defaults,auto,users,umask=000		0	0
Code:
[global]
    ; General server settings
    netbios name = OPTERON-185
    server string = %h server       (Samba, Ubuntu 8.04.1)
    workgroup = RBZGROUP
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    wins support = yes

    printing = CUPS
    printcap name = CUPS

    syslog = 1
    syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
    ;valid users = %S
    ;create mode = 0600
    ;directory mode = 0755
    ;browseable = no
    ;read only = no
    ;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
    ;path = /var/lib/samba/netlogon
    ;admin users = Administrator
    ;valid users = %U
    ;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
    ;path = /var/lib/samba/profiles
    ;valid users = %U
    ;create mode = 0600
    ;directory mode = 0700
    ;writeable = yes
    ;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
;    path = /var/lib/samba/printers
;    browseable = yes
;    guest ok = yes
;    read only = yes
;    write list = root
;    create mask = 0664
;    directory mask = 0775

#[printers]
;    path = /tmp
;    printable = yes
;    guest ok = yes
;    browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
    ;path = /media/cdrom
    ;browseable = yes
    ;read only = yes
    ;guest ok = yes

;[MyFiles]
;    path = /media/samba/
;    browseable = yes
;    read only = no
;    guest ok = no
;    create mask = 0644
;    directory mask = 0755
;    force user = YOUR_USERNAME
;    force group = YOUR_USERGROUP


[file_archive]
path = /media/FAT32_ARCH/file_archive
available = yes
browsable = yes
public = yes
writable = yes


[REPO_TEST_SHARE]
path = /media/FAT32_REPO/REPO_TEST_SHARE
available = yes
browsable = yes
public = yes
writable = yes
Code:
thunderrd@OPTERON-185:~$ ls -l /media/FAT32_ARCH
total 16
drwxrwxrwx 13 thunderrd thunderrd 16384 2008-07-30 18:08 file_archive
Again, I'm not concerned with user security since I'm the only user; any way that will get me normal speeds of file operations is OK for me. I need to be able to copy both to and from the shares from the XP box. Now, I'm back to 45 minutes for a 100Mb file;( It's far faster to use a thumb drive.
 
Old 07-30-2008, 08:24 AM   #11
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
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
These are small monitoring tools that propably become handy later.

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
and run it as cient on the other machine:
Code:
 netio -t $(SERVER_IP)
You have to run it within command line environment on the windows machine. To get an overview of all options, run netio without any parameters.

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

Last edited by Clemente; 07-30-2008 at 08:25 AM.
 
Old 07-30-2008, 11:02 AM   #12
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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

Last edited by ThunderRd; 07-30-2008 at 11:03 AM.
 
Old 07-31-2008, 07:45 AM   #13
Clemente
Member
 
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188

Rep: Reputation: 30
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
 
Old 07-31-2008, 08:46 AM   #14
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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]



C:\Documents and Settings\Administrator\Desktop\netio126\bin>win32-i386 -t 192.168.0.10



NETIO - Network Throughput Benchmark, Version 1.26

(C) 1997-2005 Kai Uwe Rommel



TCP connection established.

Packet size  1k bytes:  11253 KByte/s Tx,  11469 KByte/s Rx.

Packet size  2k bytes:  11303 KByte/s Tx,  11480 KByte/s Rx.

Packet size  4k bytes:  11490 KByte/s Tx,  11496 KByte/s Rx.

Packet size  8k bytes:  11527 KByte/s Tx,  11481 KByte/s Rx.

Packet size 16k bytes:  11508 KByte/s Tx,  11491 KByte/s Rx.

Packet size 32k bytes:  11578 KByte/s Tx,  11454 KByte/s Rx.

Done.


[with Linux machine as client; copy speeds are normal]

thunderrd@OPTERON-185:~/Desktop/netio126/bin$ ./linux-i386 -t 192.168.0.1

NETIO - Network Throughput Benchmark, Version 1.26
(C) 1997-2005 Kai Uwe Rommel

TCP connection established.
Packet size  1k bytes:  11406 KByte/s Tx,  11117 KByte/s Rx.
Packet size  2k bytes:  11410 KByte/s Tx,  11123 KByte/s Rx.
Packet size  4k bytes:  11420 KByte/s Tx,  11363 KByte/s Rx.
Packet size  8k bytes:  11418 KByte/s Tx,  11383 KByte/s Rx.
Packet size 16k bytes:  11413 KByte/s Tx,  10996 KByte/s Rx.
Packet size 32k bytes:  11383 KByte/s Tx,  11448 KByte/s Rx.
Done.
This probably doesn't tell you much but at least it is a baseline reference.

When the speeds get slow again I'll do the rest of the tasks you assigned me, and I'll post again.

Thanks.

Last edited by ThunderRd; 07-31-2008 at 08:47 AM.
 
Old 08-02-2008, 03:43 AM   #15
ThunderRd
LQ Newbie
 
Registered: Jul 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Clemente View Post
If possible, run netio while having trouble with samba speed and another time while having no trouble.

Please post the output.
OK, here is the output when speeds are slow. I ran the test twice in each direction:

Code:
XP client/Linux server, copy speeds are slow

C:\Documents and Settings\Administrator\Desktop\netio126\bin>win32-i386 -t 192.1

68.0.10



NETIO - Network Throughput Benchmark, Version 1.26

(C) 1997-2005 Kai Uwe Rommel



TCP connection established.

Packet size  1k bytes:  4598 KByte/s Tx,  43658 Byte/s Rx.

Packet size  2k bytes:  5487 KByte/s Tx,  53789 Byte/s Rx.

Packet size  4k bytes:  1629 KByte/s Tx,  55 KByte/s Rx.

Packet size  8k bytes:  2054 KByte/s Tx,  101 KByte/s Rx.

Packet size 16k bytes:  6970 KByte/s Tx,  68 KByte/s Rx.

Packet size 32k bytes:  11530 KByte/s Tx,  80 KByte/s Rx.

Done.



C:\Documents and Settings\Administrator\Desktop\netio126\bin>win32-i386 -t 192.1

68.0.10



NETIO - Network Throughput Benchmark, Version 1.26

(C) 1997-2005 Kai Uwe Rommel



TCP connection established.

Packet size  1k bytes:  3223 KByte/s Tx,  78 KByte/s Rx.

Packet size  2k bytes:  2808 KByte/s Tx,  47980 Byte/s Rx.

Packet size  4k bytes:  11515 KByte/s Tx,  63 KByte/s Rx.

Packet size  8k bytes:  9235 KByte/s Tx,  58769 Byte/s Rx.

Packet size 16k bytes:  4521 KByte/s Tx,  61 KByte/s Rx.

Packet size 32k bytes:  8242 KByte/s Tx,  43204 Byte/s Rx.

Done.


Linux client/xp server, copy speeds are slow

thunderrd@OPTERON-185:~/Desktop/netio126/bin$ ./linux-i386 -t 192.168.0.1

NETIO - Network Throughput Benchmark, Version 1.26
(C) 1997-2005 Kai Uwe Rommel

TCP connection established.
Packet size  1k bytes:  121 KByte/s Tx,  656 KByte/s Rx.
Packet size  2k bytes:  87381 Byte/s Tx,  803 KByte/s Rx.
Packet size  4k bytes:  71851 Byte/s Tx,  1397 KByte/s Rx.
Packet size  8k bytes:  110 KByte/s Tx,  949 KByte/s Rx.
Packet size 16k bytes:  87381 Byte/s Tx,  457 KByte/s Rx.
Packet size 32k bytes:  87378 Byte/s Tx,  4406 KByte/s Rx.
Done.

thunderrd@OPTERON-185:~/Desktop/netio126/bin$ ./linux-i386 -t 192.168.0.1

NETIO - Network Throughput Benchmark, Version 1.26
(C) 1997-2005 Kai Uwe Rommel

TCP connection established.
Packet size  1k bytes:  94 KByte/s Tx,  2955 KByte/s Rx.
Packet size  2k bytes:  87381 Byte/s Tx,  1790 KByte/s Rx.
Packet size  4k bytes:  57113 Byte/s Tx,  3764 KByte/s Rx.
Packet size  8k bytes:  77169 Byte/s Tx,  2982 KByte/s Rx.
Packet size 16k bytes:  106 KByte/s Tx,  3720 KByte/s Rx.
Packet size 32k bytes:  62 KByte/s Tx,  2990 KByte/s Rx.
Done.
Quote:
Originally Posted by Clemente View Post
4) Please 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?
The result of the test was: file copy speed increased from 391Kb to 586Kb. Doesn't seem too significant to me. Both speeds are terribly slow.


Quote:
Originally Posted by Clemente View Post
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...).
Nothing is using cpu cycles. The highest usage was X, using 9%. Total around 12-13%.

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
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bd87bd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1530    12289693+   7  HPFS/NTFS
/dev/sda2            1531        4865    26788387+   7  HPFS/NTFS

Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6639b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4660    37431418+  83  Linux
/dev/sdb2            4661        4865     1646662+   5  Extended
/dev/sdb5            4661        4865     1646631   82  Linux swap / Solaris

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x130f286b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       19457   156288321    c  W95 FAT32 (LBA)

Disk /dev/sdd: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7a3e006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       30401   244196001    b  W95 FAT32
But when it looks like this, speeds are slow:
Code:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x130f286b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19457   156288321    c  W95 FAT32 (LBA)

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7a3e006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30401   244196001    b  W95 FAT32

Disk /dev/sdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7bd87bd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1530    12289693+   7  HPFS/NTFS
/dev/sdc2            1531        4865    26788387+   7  HPFS/NTFS

Disk /dev/sdd: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d6639b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        4660    37431418+  83  Linux
/dev/sdd2            4661        4865     1646662+   5  Extended
/dev/sdd5            4661        4865     1646631   82  Linux swap / Solaris
This seems to happen *sometimes* [but not always] on reboot. The drives mount OK, and they are browsable on the XP box either way. But the slow speed only happens when /sdd1 /sdd2 /sdd5 are the linux partitions. When the linux partitions are /sdb1 /sdb2 /sdb5, all is OK. What do you think?

Last edited by ThunderRd; 08-02-2008 at 04:09 AM. Reason: NEW INFO
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing mount points maverick_pol Solaris / OpenSolaris 3 10-26-2007 03:14 AM
changing mount /dev/sd* points - please explain sockknitter Linux - Hardware 4 01-05-2007 01:07 AM
Changing where a shortcut points perrymans Linux - General 1 09-12-2003 07:29 PM
changing mount points superbondbond Linux - Hardware 3 07-03-2003 08:23 AM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration