Accessing a network smb share in linux

Hi All,

192.168.1.93 (is my server/nas)

…following is from my /etc/fstab file (Kubuntu 21.10)

192.168.1.93:/mnt/user/Linux /mnt/Linux nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0
192.168.1.44://mnt/Storage/NFS-share /mnt/nfs nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0

192.168.1.93:/mnt/user/Media /mnt/Media cifs defaults 0 0

Last 3 lines in my /etc/fstab file, nfs shares setup and working

last line for cifs(smb) share Im having issues with

If I uncomment last line I get following error (when running sudo mount -av)

mount.cifs: bad UNC (192.168.1.93:/mnt/user/Media)

I did install cifs-utils after some googling (any other depedancies??)

I have also tried
//192.168.1.93/mnt/user/Media /mnt/Media cifs username=Craig,password=Password,_netdev 0 0

any advice would be appreciated

I havent had much luck googling this and hope the experts here can shed some light on what I might be doing wrong, thanks

also tried
//192.168.1.93/mnt/user/Media /mnt/Media cifs username=Craig,password=Password,uid=1000,gid=100 0 0

and get error
mount.cifs kernel mount options: ip=192.168.1.93,unc=\192.168.1.93\mnt,uid=1000,gid=100,user=Craig,prefixpath=user/Media,pass=********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

running sudo mount -av

Welcome to the forum!

Check this out:

You may want to try

//192.168.1.93/mnt/user/Media /mnt/Media cifs credentials=/home/user/.smbcreds,uid=1000,gid=1000,iocharset=utf8,rw,file_mode=0660,dir_mode=0770 0 0

You can find the UID and GID of your user by running id user. Usually the first user created starts at 1000.

It’s possible that the password may interfere with the mount. Also, it’s not secure to keep your password in a world-readable file, like fstab. Buffy described in the post I linked how to create the .smbcreds file. After you are done, chmod 600 /home/user/.smbcreds to make it readable and writable only by your user.

If it keeps giving you headaches, do as the mount command says and run sudo dmesg | grep -i -e cifs -e smb

1 Like

WORKGROUP is what my smb is set to on my unraid box…not sure why its saying formatted incorrectly

but sudo dmesg saying bad network name…not sure what that means…only been into linux 12 months
still alot to learn, but I ask for help what I cant find an answer via googling

1 Like

Never seen that message before, bad network name may be either a wrong dns entry, but we’re using ips, so maybe the cifs client is trying to convert the ip and slashes into a domain name, which would be dumb.

Try installing smbclient or smb-client or smb_client (one of them, on debian it’s usually the first).

smbclient -A /home/user/.smb.credentials -gL 192.168.1.93

See if this one works first.

all my shares show up
but last line says no work group avail…there is on my unraid server

and says smb1 disabled is that right?

1 Like

Keep the workgroup disabled and remove any workgroups from your settings, like for example from the .smbcreds file. SMB1 should be disabled, as it’s highly insecure (remember wannacry and petya? yeah, they were using EternalBlue, a SMB1 vulnerability). SMB2+ should be used.

By the way, if you are using KDE, why not let Dolphin take care of the CIFS mount? You should be able to create a shortcut for the Samba share and not have to worry about fstab and other stuff, unless you have something on the share that you need on your PC at bootup, which is not something that happens often.

I can mount via dolphin, but my docker-compose (plex) needs a mount point

1 Like

Im thinking of setting up a backup plex server…is there any particular linux distro, you would recommend for file operations? samba

I don’t understand if it’s a backup server for plex, to backup your media, or if it’s a plex backup server, as in, another plex instance that you can use in case your main plex goes down.

The former does make sense and can be used for more than just plex. The later would be a bit weird in a home environment situation, I don’t expect plex to suddenly die, it doesn’t really justify running 2 instances.

For the former, you are already running Docker, so get a docker-BackupPC and give its backup mountpoint to either a physical server, or to a dedicated backup disk. Also advisable to run Docker on the backup disk, in case your main OS disk dies, you can take the backup disk out, plug it into another host and relaunch the docker instance from the disk containing all your backups. Bonus points if you are using a RAID1 on 2 internal sata drives or RAID5 on 3 disks as your backup location.