Use second hard disk in samba network for storage Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
nanooker
Posts: 38
Joined: Sun Dec 06, 2020 7:41 pm

Use second hard disk in samba network for storage

Post by nanooker »

Dietpi is running on raspberrypi 3B+ with ssd data storage in smb network. This works fine.
Now I have connected a second usb hard drive to the pi.
What is the process that this disk also works as storage and is recognized on the network.
The hard drive is visible in Dietpi-config and is recognized, but it does not appear in my network.
Despite mount, unmount I can not get it to work.
Could someone help me? Thanks
User avatar
Joulinar
Posts: 4815
Joined: Sat Nov 16, 2019 12:49 am

Re: Use second hard disk in samba network for storage

Post by Joulinar »

Hi,

pls can you share your smb.conf file as well as lsblk -o name,fstype,label,size,ro,type,mountpoint
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
nanooker
Posts: 38
Joined: Sun Dec 06, 2020 7:41 pm

Re: Use second hard disk in samba network for storage

Post by nanooker »

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298,1G 0 disk
└─sda1 8:1 0 298,1G 0 part /
sdb 8:16 0 111,8G 0 disk
└─sdb1 8:17 0 111,8G 0 part /mnt/d7afc196-c7ba-4af5-bb7d-56045bb9642a
mmcblk0 179:0 0 14,4G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14,2G 0 part

●─ sda ───────────────────────────────────────────── │
│ / : /dev/sda1 | ext4 | Capacity: 292.4G | Used: 72.1G │
│ ●─ mmcblk0 ───────────────────────────────────────── │
│ /boot : /dev/mmcblk0p1 | vfat | Capacity: 252M | Used: 30. │
│ /mnt/c6dd3b94-a789-4d57-9080-1472f721804b : /dev/mmcblk0p2 | ext4 | Not mounted │
│ ●─ sdb ───────────────────────────────────────────── │
│ /mnt/d7afc196-c7ba-4af5-bb7d-56045bb9642a : /dev/sdb1 | ext4 | Capacity: 109.5G | Used: 60M (0 │
│ ●─ Global Options ────────────────────────────────── │
│ Idle Spindown : Set a global idle duration, before drives power do │
│ ●─ Add / Refresh Drives ──────────────────────────── │
│ Add network drive : Select to mount networked drives │
│ Refresh : Scan for recently added/removed drives │
│ │
│ │
│ <Ok>
User avatar
Joulinar
Posts: 4815
Joined: Sat Nov 16, 2019 12:49 am

Re: Use second hard disk in samba network for storage

Post by Joulinar »

pls can you share smb.conf as requested above.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
nanooker
Posts: 38
Joined: Sun Dec 06, 2020 7:41 pm

Re: Use second hard disk in samba network for storage

Post by nanooker »

I do not know where and how to find this? Sorry
User avatar
Joulinar
Posts: 4815
Joined: Sat Nov 16, 2019 12:49 am

Re: Use second hard disk in samba network for storage

Post by Joulinar »

cat /etc/samba/smb.conf
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
nanooker
Posts: 38
Joined: Sun Dec 06, 2020 7:41 pm

Re: Use second hard disk in samba network for storage

Post by nanooker »

GNU nano 3.2 smb.conf

[global]

workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog only = no
syslog = 0

panic action = /usr/share/samba/panic-action %d

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes

passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\su$
pam password change = yes
map to guest = bad user
load printers = no
printcap name = /dev/null
disable spoolss = yes

[dietpi]
comment = DietPi Share
path = /mnt/dietpi_userdata
browseable = yes
create mask = 0664
directory mask = 0775
valid users = dietpi
writeable = yes



^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos M-U Undo
^X Exit ^R Read File ^\ Replace ^U Uncut Text ^T To Spell ^_ Go To Line M-E Redo
User avatar
Joulinar
Posts: 4815
Joined: Sat Nov 16, 2019 12:49 am

Re: Use second hard disk in samba network for storage

Post by Joulinar »

that the new drive is not shared via SAMBA is working as expected because it is not configured to be shared ;)

At the moment you are sharing everything below directory /mnt/dietpi_userdata. But your new drive is mounted to a different place /mnt/d7afc196-c7ba-4af5-bb7d-56045bb9642a. Therefore it is not visible on SAMBA. Basically you would have 3 options
  1. mount your new HDD on a mountpoint below /mnt/dietpi_userdata like /mnt/dietpi_userdata/HDD2
  2. change the SAMAB export to /mnt. This will share everything below /mnt, including your new drive
  3. create a 2nd SAMBA export for /mnt/d7afc196-c7ba-4af5-bb7d-56045bb9642a. This would need to be mapped as an additional drive on the client side
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
nanooker
Posts: 38
Joined: Sun Dec 06, 2020 7:41 pm

Re: Use second hard disk in samba network for storage

Post by nanooker »

Hello,
first of all thank you!!
I have now chosen the first option. Now I see the hard disk. There are two folders "Documents and Lost+found".
But I can not access them. No permission!
You write "change the samba export to mnt". I don't know how to do that??
Attachments
samba2.png
samba2.png (18.54 KiB) Viewed 559 times
samba.png
samba.png (6.99 KiB) Viewed 559 times
User avatar
Joulinar
Posts: 4815
Joined: Sat Nov 16, 2019 12:49 am

Re: Use second hard disk in samba network for storage

Post by Joulinar »

ok let's check permission ls -la /mnt/dietpi_userdata/HDD2
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply