Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Giving acces to usb harddrive

  1. #1

    Default Giving acces to usb harddrive

    Hi.
    I have an USB drive and I made a share with samba and accessed it from windows computer.
    I've been using openSUSE 11.3 with no problems.

    Recently, I've installed openSUSE 11.4. Now I can't write to my USB Disk through samba.

    It is formatted as ntfs.

    samba log tells a lot of things.... for eg.:
    Code:
    [2011/05/30 11:46:54.148085,  2] smbd/trans2.c:5531(smb_set_file_dosmode)
      smb_set_file_dosmode: file_set_dosmode of 1 failed (Permission denied)
    [2011/05/30 11:46:54.148163,  3] smbd/error.c:80(error_packet_set)
      error packet at smbd/trans2.c(7759) cmd=50 (SMBtrans2) NT_STATUS_ACCESS_DENIED
    [2011/05/30 11:46:54.154426,  3] smbd/process.c:1485(process_smb)
      Transaction 203 of length 45 (0 toread)
    [2011/05/30 11:46:54.154572,  3] smbd/process.c:1294(switch_message)
      switch message SMBclose (pid 15374) conn 0xb77b6e00
    [2011/05/30 11:46:54.154638,  3] smbd/reply.c:4653(reply_close)
      close fd=-1 fnum=12766 (numopen=1)
    [2011/05/30 11:46:54.154750,  2] smbd/close.c:656(close_normal_file)
      root closed file 1 (numopen=0) NT_STATUS_OK
    Tried to set NTFS access from Windows PC. It doesn't work.
    Tried to change options in fstab:
    Code:
    /dev/disk/by-id/usb-StoreJet_TS120GSJ25T-S_404812FF-0:0-part1 /media/USBHDD        ntfs-3g    defaults,locale=en_US.UTF-8 0 0
    I can write to USB HardDrive from SUSE with no su privileges. But I stil can't write to it through samba.

    Any ideas?

    Thanks a lot!

  2. #2
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    The mount defines root ownership which likely is in conflict with the samba permissions as contained in the file smb.conf.
    1. Please post a copy of the file here so I can check Samba permissions. Run this command: cat /etc/samba/smb.conf
    2. Please post results of next command here so I can cross check with above. Run this command (while drive is mounted): ls -l /media | grep USB
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  3. #3

    Default Re: Giving acces to usb harddrive

    Thanks for reply!

    1:
    Code:
    [global]
            workgroup = WORKGROUP
            netbios name = LS00006
    #       passdb backend = smbpasswd
    #       printing = cups
    #       printcap name = cups
    #       printcap cache time = 750
    #       cups options = raw
    #       map to guest = Bad User
    #       include = /etc/samba/dhcp.conf
    #       logon path = \\%L\profiles\.msprofile
    #       logon home = \\%L\%U\.9xprofile
    #       logon drive = P:
            security = share
    #       usershare allow guests = Yes
            guest account = smbanon
    #       guest account = root
            log level = 3
            ldap suffix = 
            wins server = 
            wins support = No
    
    [h]
            comment = USD
            path = /media/USBHDD/
            read only = No
            browseable = Yes
            guest ok = Yes
            writable = Yes
    
    [temp]
            comment = temp
            path = /home/rusart/temp
            guest ok = Yes
            browsable = Yes
            read only = No
    
    [r]
            comment = test
            path = /media/36BA-C65A
            guest ok = Yes
            browsable = Yes
    2:
    Code:
    rusart@L000006:/media>         ls -l /media | grep USB
    drwxrwxrwx 1 root root 12288 May 30 12:00 USBHDD

  4. #4
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    I don't know how smbanon and security = share mix in with a root share. But I can suggest what should work. You should keep a copy of the old smb.conf and make a new one using this:
    Code:
    [global]
            workgroup = WORKGROUP
            netbios name = LS00006
    name resolve order = bcast host lmhosts wins
    local master = auto
    preferred master = auto
    os level = 32
    #       passdb backend = smbpasswd
    #       printing = cups
    #       printcap name = cups
    #       printcap cache time = 750
    #       cups options = raw
           map to guest = Bad User
    #       include = /etc/samba/dhcp.conf
    #       logon path = \\%L\profiles\.msprofile
    #       logon home = \\%L\%U\.9xprofile
    #       logon drive = P:
     security = user
    #       usershare allow guests = Yes
    #       guest account = smbanon
    #       guest account = root
            log level = 3
    #        ldap suffix = 
    #        wins server = 
    #        wins support = No
    
    [h]
            comment = USD
            path = /media/USBHDD/
            read only = No
    #        browseable = Yes
            guest ok = Yes
    #        writable = Yes
    force user = rusart
    
    [temp]
            comment = temp
            path = /home/rusart/temp
            guest ok = Yes
            browsable = Yes
            read only = No
    
    [r]
            comment = test
            path = /media/36BA-C65A
            guest ok = Yes
            browsable = Yes

    And change the mount code in fstab to be this:
    Code:
    /dev/disk/by-id/usb-StoreJet_TS120GSJ25T-S_404812FF-0:0-part1 /media/USBHDD        ntfs-3g    defaults,uid=rusart,gid=users,locale=en_US.UTF-8 0 0
    That would match most everything up OK I hope
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  5. #5
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    I'm assuming that your username is rusart.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  6. #6

    Default Re: Giving acces to usb harddrive

    fstab changed
    smb.conf changed

    after remounting....

    The same result...

    Code:
    # ls -l /media/ | grep US
    drwxrwxrwx 1 rusart users 12288 May 30 12:00 USBHDD
    Code:
    # mount | grep USB
    /dev/sdc1 on /media/USBHDD type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

  7. #7
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    Oh and another thing just to mind, there's a bug in Samba daemon in 11.4, that might cause a problem, check it's not active, run this command and report back:
    Code:
    su - -c "rcnmb status;rcsmb status"
    (ps there are two minuses in there, it's not a typo)
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  8. #8

    Default Re: Giving acces to usb harddrive

    Code:
    > su - -c "rcnmb status;rcsmb status"
    Password: 
    Checking for Samba NMB daemon                                                                                                                            unused
    Checking for Samba SMB daemon                                                                                                                            running

    starting of NMB does nothing

  9. #9
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    Quote Originally Posted by RusArt View Post
    Code:
    > su - -c "rcnmb status;rcsmb status"
    Password: 
    Checking for Samba NMB daemon                                                                                                                            unused
    Checking for Samba SMB daemon                                                                                                                            running

    starting of NMB does nothing
    You've been hit by the bug. Go to Yast -->Novell AppArmor --> AppArmor Control Panel --> Set Profile Modes --> Configure --> highlight usr.sbin.smbd and "Toggle" to read "complain". Do that also for usr.sbin.nmbd. Lock that in (Done --> Done etcr).

    Next go to Yast --> system --> system services runlevels and find nmb and smb and make sure they're set to running=yes. If not, then toggle them to on with Enable button.

    After, reboot.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  10. #10
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Giving acces to usb harddrive

    I've assumed from your experience with 11.3 that you know how to set SuSEfirewall2 and have done that.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •