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

Thread: Samba Help - worked fine and then went belly up

  1. #1
    Join Date
    Jul 2007
    Beans
    7

    Question Samba Help - worked fine and then went belly up

    ubuntu 20.04.2
    samba 4.11.6-Ubuntu

    Can anyone offer any advice to fix my Samba share problem?

    I run this computer as a Plex server. It has a SSD that runs the OS and such, and a HDD that has all my Plex media files on it. I run the server headless and use a Samba share to manage files on the HDD (add/change/delete) from various Windows 10 PCs and Android devices on the local network. One evening last week I added some files using the Samba share, and the next morning I tried again and could not connect to the Samba share.

    • The Plex server is running fine and can access the media files on the HDD
    • I can see the server on my Windows machine and Android devices.
    • sudo ufw status gives Status: inactive
    • I have stopped and started the Samba service using sudo service smbd stop and sudo service smbd start. Both commands ran with no errors.
    • I updated everything and have restarted the server multiple times.
    • I uninstalled and re-installed Samba (including a fresh smb.conf file)


    Sudo smbstatus gives the result below (no shares are listed)
    Code:
    Samba version 4.11.6-Ubuntu
    PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    Service      pid     Machine       Connected at                     Encryption   Signing
    ---------------------------------------------------------------------------------------------
    
    No locked files
    This is the share listed in my /etc/samba/smb.conf file
    Code:
    [hda]
       path = /media/hda/sharehda
       read only = no
       browsable = yes
       public = yes

  2. #2
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Samba Help - worked fine and then went belly up

    Thread moved to Server Platforms.

  3. #3
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    1,690
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Samba Help - worked fine and then went belly up

    Have you run this command yet to verify the syntax in your config file?
    Code:
    testparm
    LHammonds

  4. #4
    Join Date
    Jul 2007
    Beans
    7

    Re: Samba Help - worked fine and then went belly up

    Quote Originally Posted by LHammonds View Post
    Have you run this command yet to verify the syntax in your config file?
    Code:
    testparm
    LHammonds
    Code:
    Load smb config files from /etc/samba/smb.conf
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    
    Press enter to see a dump of your service definitions
    
    # Global parameters
    [global]
            log file = /var/log/samba/log.%m
            logging = file
            map to guest = Bad User
            max log size = 1000
            obey pam restrictions = Yes
            panic action = /usr/share/samba/panic-action %d
            passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:                                                                                                                     * %n\n *password\supdated\ssuccessfully* .
            passwd program = /usr/bin/passwd %u
            server role = standalone server
            server string = %h server (Samba, Ubuntu)
            usershare allow guests = Yes
            idmap config * : backend = tdb
    
    
    [printers]
            browseable = No
            comment = All Printers
            create mask = 0700
            path = /var/spool/samba
            printable = Yes
    
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/printers
    
    
    [hda]
            guest ok = Yes
            path = /media/hda/sharehda
            read only = No

  5. #5
    Join Date
    Mar 2007
    Beans
    1,325

    Re: Samba Help - worked fine and then went belly up

    Are you sure the path is correct? Shouldn't it be a partition rather than the whole disk?
    What does lsblk show?

  6. #6
    Join Date
    Jul 2007
    Beans
    7

    Re: Samba Help - worked fine and then went belly up

    Quote Originally Posted by rsteinmetz70112 View Post
    Are you sure the path is correct? Shouldn't it be a partition rather than the whole disk?
    What does lsblk show?
    The drive only has one partition and I share the whole thing (it just holds media files for the Plex server). The OS is installed on a solid state drive.

    The path works
    Code:
    peeweejd@plexy:/$ cd /media/hda/sharehda
    peeweejd@plexy:/media/hda/sharehda$ ls
    DCIM  plexmedia
    lsblk output
    Code:
    peeweejd@plexy:/$ lsblk
    NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    loop0                       7:0    0  67.6M  1 loop /snap/lxd/20326
    loop1                       7:1    0  55.5M  1 loop /snap/core18/1988
    loop2                       7:2    0  32.3M  1 loop /snap/snapd/11588
    loop3                       7:3    0  55.5M  1 loop /snap/core18/1997
    loop4                       7:4    0  32.3M  1 loop /snap/snapd/11402
    loop5                       7:5    0  70.4M  1 loop /snap/lxd/19647
    sda                         8:0    0 465.8G  0 disk
    └─sda1                      8:1    0 465.8G  0 part /media/hda
    sdb                         8:16   0 465.8G  0 disk
    nvme0n1                   259:0    0 232.9G  0 disk
    ├─nvme0n1p1               259:1    0     1M  0 part
    ├─nvme0n1p2               259:2    0     1G  0 part /boot
    └─nvme0n1p3               259:3    0 231.9G  0 part
      └─ubuntu--vg-ubuntu--lv 253:0    0   116G  0 lvm  /

  7. #7
    Join Date
    Dec 2009
    Beans
    6,776

    Re: Samba Help - worked fine and then went belly up

    The local server user "nobody" has to have write access to sharehda and at least execute permissions on media and hda so what are the permissions on the tree:
    Code:
    ls -al /media/hda

  8. #8
    Join Date
    Jul 2007
    Beans
    7

    Re: Samba Help - worked fine and then went belly up

    Quote Originally Posted by Morbius1 View Post
    The local server user "nobody" has to have write access to sharehda and at least execute permissions on media and hda so what are the permissions on the tree:
    Code:
    ls -al /media/hda
    I'm not good a permissions...

    Code:
    peeweejd@plexy:/$ ls -al /media/
    total 16
    drwxr-xr-x  4 root root 4096 Jan 15 17:48 .
    drwxr-xr-x 20 root root 4096 Nov  7  2020 ..
    drwxr-xr-x  4 root root 4096 Nov  7  2020 hda
    drwxr-xr-x  2 root root 4096 Jan 15 17:48 hdb
    Code:
    peeweejd@plexy:/$ ls -al /media/hda
    total 28
    drwxr-xr-x 4 root   root     4096 Nov  7  2020 .
    drwxr-xr-x 4 root   root     4096 Jan 15 17:48 ..
    drwx------ 2 root   root    16384 Nov  6  2020 lost+found
    drwxrwxrwx 4 nobody nogroup  4096 Apr 10 16:44 sharehda
    Code:
    peeweejd@plexy:/$ ls -al /media/hda/sharehda
    total 16
    drwxrwxrwx 4 nobody   nogroup  4096 Apr 10 16:44 .
    drwxr-xr-x 4 root     root     4096 Nov  7  2020 ..
    drwxrwxr-x 6 peeweejd peeweejd 4096 Apr 10 16:48 DCIM
    drwxrwxr-x 9 peeweejd peeweejd 4096 Apr  1 20:25 plexmedia

  9. #9
    Join Date
    Dec 2009
    Beans
    6,776

    Re: Samba Help - worked fine and then went belly up

    THe easiest way out of this is to edit your share definition to make all network connections - at least to this share - as peeweejd:

    [hda]
    path = /media/hda/sharehda
    read only = no
    browsable = yes
    public = yes
    force user = peeweejd
    Then restart smbd:
    Code:
    sudo service smbd restart
    Right now no one has write access to the plexmedia folder but peeweejd. The change above will ensure it.

  10. #10
    Join Date
    Jul 2007
    Beans
    7

    Re: Samba Help - worked fine and then went belly up

    Quote Originally Posted by Morbius1 View Post
    THe easiest way out of this is to edit your share definition to make all network connections - at least to this share - as peeweejd:


    Then restart smbd:
    Code:
    sudo service smbd restart
    Right now no one has write access to the plexmedia folder but peeweejd. The change above will ensure it.
    Thanks for helping so much. I don't think it's working still.

    testparm shows the same output as earlier (except the force user line I just added).

    smbstatus does not show the share still. I believe it should show the [hda] part in there, correct?
    Code:
    peeweejd@plexy:/$ sudo smbstatus
    
    Samba version 4.11.6-Ubuntu
    PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    Service      pid     Machine       Connected at                     Encryption   Signing
    ---------------------------------------------------------------------------------------------
    
    No locked files
    edit: I believe it's working again. I restarted the client PC and I am able to connect. I cannot connect on my android devices though. I will look into this separately.
    Last edited by peeweejd; May 12th, 2021 at 06:33 PM.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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