CIFS option unable to mount Windows share

Our Raspberry Pi4 based test stations run CIFS for auto mounting a couple network shared drives(Windows and Epicore) to log test results to the server. All our previous builds used Ubuntu Mate from 20.10 on without issue. We just built a Pi 22.04 Mate station from the newly released long term desktop build and are having issues mounting the Windows shared drive. The odd thing is that we have a test station running 22.04 that was made from the Pi server image and then loaded with a Mate desktop and it does not have any issues.

If we stop the autofs service and bring it up in debug mode from the command line to attempt to troubleshoot:
sudo systemctl stop autofs.service
sudo automount -f –d

sudo mount -t cifs -o rw,credentials=/root/.testcreds,uid=1001 //Company05/tester /mnt/tester
Couldn''t chdir to /mnt/tester: No such file or directory

-----Debug output-------------
handle_packet: type = 3
handle_packet_missing_indirect: token 45, name tester, request pid 4580
attempting to mount entry /mnt/tester
lookup_mount: lookup(file): looking up tester
lookup_mount: lookup(file): tester -> -fstype=cifs,rw,credentials=/root/.testcreds,uid=1001 ://Company05/tester
parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/root/.testcreds,uid=1001 ://Company05/tester
parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/root/.testcreds,uid=1001
parse_mount: parse(sun): dequote("://Company05/tester") -> ://Company05/tester
parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/root/.testcreds,uid=1001, loc=://Company05/tester
sun_mount: parse(sun): mounting root /mnt, mountpoint tester, what //Company05/tester, fstype cifs, options rw,credentials=/root/.testcreds,uid=1001
do_mount: //Company05/tester /mnt/tester type cifs options rw,credentials=/root/.testcreds,uid=1001 using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/tester
mount(generic): calling mount -t cifs -o rw,credentials=/root/.testcreds,uid=1001 //Company05/tester /mnt/tester
>> mount error: could not resolve address for Company05: Unknown error
mount(generic): failed to mount //Company05/tester (type cifs) on /mnt/tester
dev_ioctl_send_fail: token = 45
failed to mount /mnt/tester
handle_packet: type = 3
handle_packet_missing_indirect: token 46, name tester, request pid 4585
dev_ioctl_send_fail: token = 46

We are not sure if it had something to do with the kernel CONFIG_NFS_DISABLE_UDP_SUPPORT mentioned in this thread:

https://askubuntu.com/questions/1405231/unable-to-mount-nfs-on-ubuntu-22-04

Still not sure why 22.04 server image runs ok but not the destop. Any suggestions as the error is "Unknown".

Thanks

it seems the pi cannot resolve Company05 ... try with ip

can you ping company05 from pi?

does the samba configuration in pi match the WORKGROUP as it is in the Windows server?
(on pi /etc/samba/smb.conf)

from linux: sudo mount -t cifs //t430s/public /mnt
asked for my pw on the T430s (a laptop running win10 with a share named public)
it mounted on /mnt as rw

details:
//t430s/public on /mnt type cifs (rw,relatime,vers=3.1.1,cache=strict,username=root,uid=0,noforceuid,gid=0,noforcegid,addr=10.0.0.28,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)

Tried using the ip address and it did mount and can be seen(but does kick out a mount error):

From the command line

tester@hydrostat-desktop:~$ sudo mount -t cifs -o rw,credentials=/root/.testcreds,uid=1001 //192.xxx.x.xx/tester /mnt/tester
[sudo] password for tester:
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
tester@hydrostat-desktop:~$

From the debug session:

attempting to mount entry /mnt/tester
lookup_mount: lookup(file): looking up tester
lookup_mount: lookup(file): tester -> -fstype=cifs,rw,credentials=/root/.testcreds,uid=1001 ://192.xxx.x.xx/tester
parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/root/.testcreds,uid=1001 ://192.xxx.x.xx/tester
parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/root/.testcreds,uid=1001
parse_mount: parse(sun): dequote("://192.168.1.14/tester") -> ://192.xxx.x.xx/tester
parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/root/.testcreds,uid=1001, loc=://192.xxx.x.xx/tester
sun_mount: parse(sun): mounting root /mnt, mountpoint tester, what //192.xxx.x.xx/tester, fstype cifs, options rw,credentials=/root/.testcreds,uid=1001
do_mount: //192.xxx.x.xx/tester /mnt/tester type cifs options rw,credentials=/root/.testcreds,uid=1001 using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/tester
mount(generic): calling mount -t cifs -o rw,credentials=/root/.testcreds,uid=1001 //192.xxx.x.xx/tester /mnt/tester
mount_mount: mount(generic): mounted //192.xxx.x.xx/tester type cifs on /mnt/tester
st_readmap: state 1 path /mnt
dev_ioctl_send_ready: token = 13
mounted /mnt/tester
re-reading map for /mnt
lookup_nss_read_map: reading map file /etc/auto.sharedocs
do_init: parse(sun): init gathered global options: (null)
st_ready: st_ready(): state = 4 path /mnt

We have never modified the samba configuration as it was always left as default.

Are you sure about the uid=1001 ? The basic mount from a pi to a win10 server is:

sudo mount.cifs //192.168.1.14/tester /mnt/tester -o user=yourWindowsUser,password=yourWindowsPassword

/root/.testcreds should be 600 perm and contain
username=value
password=value
domain=value

The other Mate 22.04 that was built from the server image and then had the Mate desktop added is able to resolve the company05 name.

ping company05
PING company05 (192.xxx.x.xx) 56(84) bytes of data.
64 bytes from company05.company.org (192.xxx.x.xx): icmp_seq=1 ttl=128 time=1.04 ms
64 bytes from company05.company.org (192.xxx.x.xx): icmp_seq=2 ttl=128 time=1.41 ms
64 bytes from company05.company.org (192.xxx.x.xx): icmp_seq=3 ttl=128 time=1.42 ms
^C
--- company05 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.042/1.287/1.415/0.173 ms
tester@efficiency1:/home$ 

What is strange is that the name resolution picks up the 'company.org' but that domain is only used in the /root/.testcreds file.

I even went as far as adding hostname resolution feature(which we have as optional) but it did not resolve the issue either.

sudo apt-get install net-tools
sudo apt-get install winbind
sudo apt-get install libnss-winbind
sudo nano /etc/nsswitch.conf (insert “wins” after “files” in the “hosts:” line)

We have always used the same /root.testcreds without a domain and the UID is verified(I don't remember why it was originally needed.)

[email protected]
password=xxxxx

Is anyone else using cifs to mount a Windows share on the Raspberry Pi4? We have loaded a i386 VM machine with Ubuntu Mate 22.04 and have no issues mounting our Windows share. Would like to fix this so we can move our test stations over to long term support.