Samba running on wrong partition

Hello all,

This is my first forum post so my apologies if it is not in the right section. I have a Western Digital My Book Live, and have been following the install instructions below to get a samba share up a running on my WD MBL.

I followed the install exactly and was able to get the samba client working. The problem is that I think it was created on sda2, because there is only 264MiB of available storage, even though my hard drive has 2.7 terabytes allocated to sda3.

Here we create a swap of 4Gb (4096MiB)

Since we have a partition of 8MiB that is the boot of uImage uboot and the rootfs of 256MiB

then we start from 264MiB and 4096MiB + 264MiB are 4360Mib ....

I think there may be a problem with fstab and the mount point /mnt/Data because the samba drive is mounted to that point, but it somehow still is referencing the sda2 instead of sda3.

uci set fstab.@global[0].check_fs='1' # This will run a fsck (like chkdsk) at startup

uci add fstab mount
uci set fstab.@mount[-1].target='/mnt/Data'
uci set fstab.@mount[-1].device='/dev/sda4'
#uci get fstab.@mount[-1].uuid # will have a value like this: 'd5d107df-316d-4007-8727-XXXXXXXXXXX', do not modify it!
uci set fstab.@mount[-1].enabled='1'
uci set fstab.@mount[-1].enabled_fsck='1'
uci set fstab.@mount[-1].options='rw,sync,noatime,nodiratime'

But I have no idea how to troubleshoot from here. I think there is just a big picture idea thing i am not understanding as I am new to linux.

Okay, there's a lot to unpack here.

  • If you followed the tutorial and used exactly the image file described in it, you are using a massively outdated version of OpenWrt. 17.01 is, at this point, more than 3 years old and 2 major versions back, and newer versions are much more performant on My Book Live. I would recommend installing the latest 19.07, which you can do like in your tutorial -- or better yet, follow the installation process on
  • To date, I don't know why you would create and use a swap partition. The MBL comes with a rather generous 256 MB RAM, so unless you want to have really memory-heavy software running on it (Samba not being one of them), you don't need a swap partition.
  • If you follow the process on the wiki page, you will have /dev/sda3 and the first thing you should try to do is getting the system to reliably mount it into the same place. This is really not hard to do, I am positive will help you out.
  • Once that is done, we can take a look at Samba. 19.07 does not come with Samba3 anymore, and Samba4 is a huge package, so I would advise to use the new, lean ksmbd (that is, as of now, unfortunately still not very well documented)

Also, don't try to do all of the things at once. One after another, so you will know what step failed. Getting MBL to be a Samba server is not really hard, but it involves about half a dozen things that need to work. And I'm afraid just following an outdated tutorial will not do it, you will have to get at least a little bit involved with Linux.

Thank you for the quick reply!

I followed the tutorial, but installed v19.07 instead of the older version.

Per your instructions I deleted the swap drive using gdisk, and created a new sda3 ext4 drive. I then mounted it with block mount. Here is the result of my block detect:

root@OpenWrt:~# block detect
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'

config 'mount'
        option  target  '/boot'
        option  uuid    'd7fc6dcf-ff6d-4bfe-a866-698da1e51737'
        option  enabled '0'

config 'mount'
        option  target  '/'
        option  uuid    '57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
        option  enabled '0'

config 'mount'
        option  target  '/mnt/sda3'
        option  uuid    'd2e85614-6798-4a93-b0d5-cb12e1ea5f30'
        option  enabled '0'

So I think everything is good to go.

I then installed the Ksmbd base package and also the luci app. In the luci interface I set the following:

Interface: lan
Workgroup: WORKGROUP
Description: Ksmbd

I created a new shared directory as follows:
Name: Storage
Path: /mnt/sda3
Browesable: yes
Allow Guests: yes
Hide dot files: yes
Create mask: 0666
Directory mask: 0777

Under system mount points I have enabled the mount point /mnt/sda3, filessystem auto(ext 4), mount options: defaults, run system check: no.

After doing all that, the ksmbd samab drive does not seem to be running. On windows 10 when I refresh the network drives, the MBL does not show up. I may try the old samba client to see if it is a configuration problem or a problem related to my ksmbd setup.

Thank you for your help :slight_smile:

...So I was able to get the samba36 server package to work. I had to change my mount points to a new directory on sda3 called mnt/Data. I then changed my mount point and network share path to /mnt/Data and I was able to see the drive and use it on windows.

I then went back to Ksmbd to try to run that server with the updated path to /mnt/Data, but it doesn't show up on windows still.

My global settings for Ksmbd are:

netbios name = |NAME|
server string = |DESCRIPTION|
workgroup = |WORKGROUP|
interfaces = |INTERFACES|
bind interfaces only = yes
ipc timeout = 20
deadtime = 15
map to guest = Bad User
smb2 max read = 64K
smb2 max write = 64K
smb2 max trans = 64K
cache read buffers = no
cache trans buffers = no

Don't forget to enable your share in fstab for auto-mounting. :wink:

Right, the ksmbd Samba daemon is just that, a SMB daemon. It does not announce shares to the network, you would have to connect to the IP (or the server name) manually.

There is a companion daemon, wsdd2, that would do the announcing, but I don't use it and can't tell you how to use and configure it. There is a forum thread for ksmbd where wsdd2 is also on-topic and that might help you already or be able to help you if you have questions.

Has no configuration, it parses the needed stuff from smb.conf and sys-fs, based on what service is running. So should work out of the box.

1 Like