I have my fstab set to automatically mount several drives (via the default administrative shares) from my Windows 7 machine as such:
//192.168.0.2/a$ /mnt/earth/a cifs exec,credentials=/home/seamonkey/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlm 0 0
This works fine initially, but will randomly stop working for no apparent reason. If I run
sudo mount -a
after entering my password, it sits for several minutes before returning
Code: Select all
mount error(11): Resource temporarily unavailable
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Unable to find suitable address.
At the same time that sudo mount -a returns output, the shares become active again.
Linux Mint 17.3 64-bit
System: Host: EroticonVI Kernel: 3.19.0-32-generic x86_64 (64 bit gcc: 4.8.2)
Desktop: Cinnamon 2.8.6 (Gtk 3.10.8~8+qiana)
Distro: Linux Mint 17.3 Rosa
Machine: Mobo: Gigabyte model: GA-970A-UD3
Bios: Award v: F8f date: 12/16/2013
CPU: Quad core AMD FX-4170 (-MCP-) cache: 8192 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 33827
clock speeds: max: 4200 MHz 1: 2100 MHz 2: 2900 MHz 3: 2100 MHz
4: 2100 MHz
Graphics: Card: Advanced Micro Devices [AMD/ATI] Bonaire XTX [Radeon R7 260X]
bus-ID: 01:00.0
Display Server: X.Org 1.17.1 drivers: ati,radeon (unloaded: fbdev,vesa)
Resolution: 1600×900@59.9hz
GLX Renderer: Gallium 0.4 on AMD BONAIRE
GLX Version: 3.0 Mesa 10.5.9 Direct Rendering: Yes
Audio: Card-1 Advanced Micro Devices [AMD/ATI] Device 0002
driver: snd_hda_intel bus-ID: 01:00.1
Card-2 Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel HDA)
driver: snd_hda_intel bus-ID: 00:14.2
Sound: Advanced Linux Sound Architecture v: k3.19.0-32-generic
Network: Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
driver: r8169 v: 2.3LK-NAPI port: de00 bus-ID: 03:00.0
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives: HDD Total Size: 763.9GB (66.1% used)
ID-1: /dev/sda model: PLEXTOR_PX size: 128.0GB
ID-2: /dev/sdb model: Hitachi_HDS72105 size: 500.1GB
ID-3: /dev/sdc model: SAMSUNG_SSD_830 size: 128.0GB
ID-4: USB /dev/sdd model: Patriot_Memory size: 7.7GB
Partition: ID-1: / size: 102G used: 8.3G (9%) fs: ext4 dev: /dev/sdc1
ID-2: swap-1 size: 17.16GB used: 0.00GB (0%) fs: swap dev: /dev/sdc5
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 16.4C mobo: N/A gpu: 39.0
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 208 Uptime: 3 days Memory: 2003.3/16029.9MB
Init: Upstart runlevel: 2 Gcc sys: 4.8.4
Client: Shell (zsh 5.0.2) inxi: 2.2.28
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Issue
Running mount -a several times causes mount attempts of CIFS shares subdir, included in fstab even though they are already mounted :
[root@rhel74-2 tmp]# grep cifs /etc/fstab
//rhel73/myshare/mydir /mnt/mnt2 cifs credentials=/etc/fstab.d/cifs/myshare,uid=1000,gid=1000,dir_mode=0777,file_mode=0666 0 0
[root@rhel74-2 tmp]# grep cifs /proc/mounts
//rhel73/myshare/mydir /mnt/mnt2 cifs rw,relatime,vers=1.0,cache=strict,username=roberto,domain=RHEL73,uid=1000,forceuid,gid=1000,forcegid,addr=172.23.1.225,file_mode=0666,dir_mode=0777,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1 0 0
[root@rhel74-2 tmp]# df -k -t cifs
Filesystem 1K-blocks Used Available Use% Mounted on
//rhel73/myshare/mydir 8374272 7982708 391564 96% /mnt/mnt2
[root@rhel74-2 tmp]# mount -vvv -a
/ : ignored
/boot : already mounted
swap : ignored
/mnt : already mounted
mount.cifs kernel mount options: ip=172.23.1.225,unc=\rhel73myshare,dir_mode=0777,file_mode=0666,uid=1000,gid=1000,user=roberto,prefixpath=mydir,pass=********
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@rhel74-2 tmp]# mount -vvv -a
/ : ignored
/boot : already mounted
swap : ignored
/mnt : already mounted
mount.cifs kernel mount options: ip=172.23.1.225,unc=\rhel73myshare,dir_mode=0777,file_mode=0666,uid=1000,gid=1000,user=roberto,prefixpath=mydir,pass=********
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
You may get EBUSY or a successful mount depending on CIFS client/server setup (in this latter case, a successful mount, /proc/mounts gets duplicate entries each time mount -a runs) but mount is always attempted.
Environment
- RHEL 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.
Current Customers and Partners
Log in for full access
Log In
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- Networking & Wireless
- [xubuntu] mount error(16): Device or resource busy
-
mount error(16): Device or resource busy
ooow no, not another sambacifsmounting thread! yes sorry though i did many searches i wasn’t able to solve this one yet.
Setup:
— Samba server on turnkey linux (ubuntu) virtual machine.
— Trying to mount in fstab with «cifs».Though the share is perfectly reachable by my windows-xp virtual machine, my xubuntu is refucing to mount this share with the following error: mount error(16): Device or resource busy
Samba config:
Code:
[global] # workgroup = WORKGROUP server string = uTserver hosts allow = 10.0.0. 127. log file = /var/log/samba/%m.log max log size = 1024 security = user encrypt passwords = yes smb passwd file = /etc/smbpasswd unix password sync = Yes passwd program = /usr/bin/passwd %u passwd chat = *New*UNIX*password* %nn *ReType*new*UNIX*password* %nn *passwd:*all*authentication*tokens*updated*successfully* socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 name resolve order = lmhosts bcast dns proxy = yes #============================ Share Definitions ============================== [utorrent] comment = uTorrent files path = /media/torrents writeable = yes guest ok = no public = no valid users = user1 user2 read list = user1 write list = user2 [utorrent-config] comment = uTorrent configuration path = /etc/utserver writeable = yes guest ok = no public = no valid users = user1 user2 read list = user1 write list = user2 [utorrent-logs] comment = uTorrent configuration path = /var/log writeable = no guest ok = no public = no valid users = user1 user2 read list = user1 user2
/etc/fstab entries for these mounts:
Code:
##### Utorrent server ############################################################################# //10.0.0.25/utorrent/ /media/utserver-server cifs rw,noauto,user,credentials=/root/credfile.utserver,gid=users 0 0 //utserver/utorrent-config/ /media/utserver-config cifs rw,noauto,user,credentials=/root/credfile.utserver,gid=users 0 0 //utserver/utorrent-logs/ /media/utserver-logs cifs rw,noauto,user,credentials=/root/credfile.utserver,gid=users 0 0 ###################################################################################################
As this is a virtual machine running on the host, it should not automount on boot. therefore also ‘user’ is added so the desktop user is able to initiate the mount at a later stage.
As the mounts are working on other machines the error should be in the host, but to be honest i cannot see much going wrong in the fstab.. ?
Anyone able to share me some pointers on how to troubleshoot this ?
KR
kamaradski
-
Re: mount error(16): Device or resource busy
Hmm dis is proofing harder then expected.
No documentation on this error available as far as i can see.
I tried all different kind of mounts in fstab and from the command line, so fart nothing seems to be able to work.
Though both from my work laptop (win7), as from my win XP, i have no problem mounting the drive … kinda frustrating if you ask me.
KR
kamaradski
-
Re: mount error(16): Device or resource busy
Ok this is my last shameless bumb of this thread.
But would anyone be able to explain me more about the mount-error-16, Some extensive troubleshooting over the last few days is not bringing me closer to any solution.
It would a lot if i would know a little bit more about the error itself? What device is actually busy? testing shows there is nothing wrong with the server, so would actually my mount-point be busy ? I cannot find any proof of this being so.
Anyway i’m totally stuck with this and would appreciate any help or link, however small, anything is useful at this point.
KR
kamaradski
-
Re: mount error(16): Device or resource busy
Maybe the mount point is already busy.
See if you can get anything in the mount command output.
Also can give a try to ‘lsof’ and ‘fuser’ command for the mount paths.When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark it [SOLVED] if the issue has been resolved
Bookmarks
Bookmarks
Posting Permissions
-
chuckufarlie
- Posts: 4
- Joined: Sat Feb 15, 2014 7:06 am
I’m stumped — cifs/smb share help
Okay, here is the issue.
I have a Belkin N600 router that has a usb share.
I cannot control many of the share settings, so it in pcmanfm it shows up under network as: smb://router/Shared%28A1%29 AKA /router/Shared(A1) — it also does not have a password or username that I can find.
my router address is 192.168.2.1, but I am unable to access the shared drive via that IP or 192.168.2.1/Shared or any such iteration that I could find.
Here is the issue. My Pi does not have enough power to run my 2.5″ external drive so I want to run it from the router and I want to save to it from transmission on the pi.
Transmission on the Pi cannot see the networked shares like Pcmanfm can.
I have googled and tried every iteration of cifs that I found, tried adding lines to fstab, but nothing works… I cannot figure out how to mount this network smb share to the pi so that transmission can read and write to it.
Can anyone help?
For reference, I have tried:
sudo mount -t cifs -o password //192.168.2.1/Shared /mnt/Shared
sudo mount -t cifs -o guest //192.168.2.1/Shared /mnt/Shared
sudo mount -t cifs -o password smb://router/Shared%28A1%29 /mnt/Shared
sudo mount -t cifs -o guest smb://router/Shared%28A1%29 /mnt/Shared
the typical response is permission denied
Does anyone have any suggestions how I can create a mount point for this smb share so I can access it in Transmission?
-
DougieLawson
- Posts: 42329
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 8:46 am
man mount.cifs
You have an error in your cifs options.
-o user=yourcifsid,password=yourcifspassword
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors — are all on my foes list.
The use of crystal balls and mind reading is prohibited.
-
chuckufarlie
- Posts: 4
- Joined: Sat Feb 15, 2014 7:06 am
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 5:09 pm
What would my CIFS username and password be? Do I need to set them somehow?
The only piece out of this puzzle that requires a username or password is my pi, so I tried that but it failed saying: mount error(13): Permission denied.
I think the problem lies more in trying to determine the share server.
When I ran smbclient -L router -U% here is the result:
Code: Select all
smbclient -L router -U%WARNING: The security=share option is deprecated
Domain=[WORKGROUP] OS=[Unix] Server=[SMB@3]
Sharename Type Comment
--------- ---- -------
Shared(A1) Disk Device(A) (Myson Century, Inc.,USB Mass Storage Device)
IPC$ IPC IPC Service (Belkin Router)
Domain=[WORKGROUP] OS=[Unix] Server=[SMB@3]
Server Comment
--------- -------
RASPBERRYPI raspberrypi server
ROUTER Belkin Router
Workgroup Master
--------- -------
WORKGROUP ROUTER
Does this information tell you anything useful? Any suggest CIFS lines I should try?
-
rpdom
- Posts: 21223
- Joined: Sun May 06, 2012 5:17 am
- Location: Chelmsford, Essex, UK
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 5:25 pm
I dunno much about cifs as I the only fileserver/share I have is Linux, but could you try
Code: Select all
sudo mount -t cifs -o domain=WORKGROUP //192.168.2.1/Shared(A1) /mnt/Shared
# or
sudo mount -t cifs -o domain=WORKGROUP //192.168.2.1/Shared(A1) /mnt/Shared
-
chuckufarlie
- Posts: 4
- Joined: Sat Feb 15, 2014 7:06 am
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 5:43 pm
rpdom wrote:I dunno much about cifs as I the only fileserver/share I have is Linux, but could you try
Code: Select all
sudo mount -t cifs -o domain=WORKGROUP //192.168.2.1/Shared(A1) /mnt/Shared # or sudo mount -t cifs -o domain=WORKGROUP //192.168.2.1/Shared(A1) /mnt/Shared
I tried both. The first one said bash: syntax error near unexpected token `(‘
The second one prompted for a password. I tried altering the line to include username and password (both for my pi) and it said permission denied.
I also tried the line as is and tried any password I could think of including my pi password, my router password, passwd, password, blank, etc, but all say permission denied.
-
rpdom
- Posts: 21223
- Joined: Sun May 06, 2012 5:17 am
- Location: Chelmsford, Essex, UK
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 5:56 pm
Hmm, as I said I know very little about these. I have used a Windows share in the past, but can’t remember how I set it up.
Try just one more thing
Code: Select all
sudo mount -t cifs -o guest,domain=WORKGROUP //192.168.2.1/Shared(A1) /mnt/Shared
Hopefully the «guest» option will stop it asking for a password.
-
DougieLawson
- Posts: 42329
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 10:15 pm
The userid and password are defined on the cifs server. With cifs on linux (server is samba) the password is set using smbpasswd. Other systems will have something equivalent.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors — are all on my foes list.
The use of crystal balls and mind reading is prohibited.
-
SingaporePi
- Posts: 2
- Joined: Sat Feb 15, 2014 11:04 pm
Re: I’m stumped — cifs/smb share help
Sat Feb 15, 2014 11:35 pm
I am stumped to. Have read pretty much all cifs related threads.
In short I’m trying to mount a NAS (synology) on my raspberry pi and I just can’t get it working,. Raspbian.
Reading all the other threads on this I got to here:
sudo mount -t cifs //10.0.1.22/entertainment /mnt/DiskStation7809 -o username=pi,password=password,sec=ntlm
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
In the interim I experienced mount errors 2 and 13 (permission denied).
It may be worth noting that at one point I connected as a samba client (smbclient -L //10.0.1.22) but that had no visible impact on my ability to mount the drive in question, nor could I see any data on the NAS.#
Other relevant info: its a synology, yes, I created a user called «pi» on the synology side for the movies folder I want the pi to seem, and lastly the synology control panel insists pi is connected, which is weird, because Pi cannot do anything, cannout moount the drive or see any files. That might be just because of the samba log in.
I have spent hours reading what is out there and quite simply am stumped.
-
SingaporePi
- Posts: 2
- Joined: Sat Feb 15, 2014 11:04 pm
Re: I’m stumped — cifs/smb share help
Sun Feb 16, 2014 3:05 pm
[quote]sudo mount -t cifs //10.0.1.22/entertainment /mnt/DiskStation7809 -o username=pi,password=password,sec=ntlm
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)[/quote]
OK, so later on I could actually see the subfolders in the relevant NAS directory through the file manager. Because the NAS will be copying for several days I won’t have a chance to properly test until then. For now it looks promising.
To contribute to the community though, to whom should I report this bug? Is this a synology issue or an issue I’d report to Debian devs responsible for the mount command? Clearly the error is itself an error or at least could be made more clear. Just thinking about how to help the devs improve it. Please let me know if you have any thoughts.
Return to “Beginners”
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
axelrtgs opened this issue
Sep 21, 2020
· 10 comments
Assignees
Comments
Description
after some digging looks like the switch to findmnt may be causing the issue as we didn’t have a problem before and chef mounts the drive so its not something manually mounted. need to investigate more but not sure if anyone might have an idea on the extra section in the path shown in the findmnt output?
findmnt -rn output
/backups //MTLNAS/Servers/backup[/backup] cifs rw,relatime
mount output
//MTLNAS/Servers/backup on /backups type cifs (rw,relatime)
double checking the regex matching in the PR it looks like it doesnt account for the random [/backup] that gets outputted in the findmnt output vs mount output. fstab also doesnt have that extra notation and matches the mount output
one of my colleagues looked into it and found this recent PR and figured something might be the cause: https://github.com/chef/chef/pull/10171/files
Chef Version
16.5
Platform Version
Linux (CentOS/Ubuntu)
Replication Case
Use a CIFs mount that has a different output in mount vs findmnt. mounts will keep trying to get remounted but fail because the device is already mounted.
Client Output
Stacktrace
problem seems to be the argument in square brackets here:
/backups //MTLNAS/Servers/backup[/backup] cifs rw,relatime
offhand it looks like that is the path on the cifs server which isn’t very useful, and should just be stripped out?
It looks like there’s a pattern match in the provider which matches stuff that has square brackets but fails on this, and its not clear that it would be appropriate (since it seems like we need to match against //MTLNAS/Servers/backup
and not /backup
in that case, and of course there’s no tests — although there is a rubular link for the kind of moutpoint that the existing code is attempting to mount against.
i have no idea.
lamont-granquist
changed the title
Differences in moun vs findmount output causing idempotency issues
Differences in mount vs findmount output causing idempotency issues
Sep 22, 2020
@antima-gupta Any chance you can take a look at this one along with your other mount work?
@tas50 Sure I’ll look into this, currently working on another priority stuff.
@axelrtgs To make mount
resource idempotent, I used findmnt -rn
command. findmnt -rn
list the currently mounted file systems along with target mount point, and the source device.
Since it’s idempotent, so If mounts will keep trying to get remounted, it will fail because the device is already mounted.
Here is the Regex matching in the PR. It checks for the random [/backup] as well. Permalink for your case : https://rubular.com/r/r0RRTY45jE74SO, which matching with the PR Regex.
As per replication case description, it seems like you want it should not be idempotent.
If we make it as not idempotent
so mountpoints in fstab file are mounted again in every chef-run, if you run chef-client four times you are going to have the resource mounted four times.
Please correct me If my understanding is incorrect and could you please share piece of code that is failing and logs, would be helpful to reproduce the issue?
Copy link
Contributor
Author
So the issue is that the current regexes are not matching with /backups //MTLNAS/Servers/backup[/backup] cifs rw,relatime
causing it to not be idempotent.
The goal of this issue is to fix the regex so it can be idempotent again. Right now even though it is already mounted on every chef run it has the unwanted behaviour of trying to mount it again resulting in an error that the device is busy.
the expected behaviour would be that after the initial mount on subsequent chef runs it recognizes the mount already exists and does nothing. (idempotent)
the only regex that comes close to resembling the pattern above is the one here https://github.com/chef/chef/pull/10171/files#diff-9e68c237a560753a94569d68a9f375e17612cdba759ae777d96a46960e548e2dR52 since it has a similar look but it also does not match since the device_mount_regex is between the []
and not in the section before. the regex should be something like
when /A#{Regexp.escape(real_mount_point)}s+#{device_mount_regex}s+[[/w]+]/
rubular example https://rubular.com/r/jx7iX97t8Cer3c
@axelrtgs could you please provide more information such as recipe and error logs to reproduce the issue?
Copy link
Contributor
Author
mount '/backups' do
device '//MTLNAS/Servers/backup'
device_type :device
fstype 'cifs'
fsck_device '-'
options [
'iocharset=utf8',
'file_mode=0775',
'dir_mode=0775',
]
dump 0
pass 0
action [:mount, :enable]
end
error
STDERR: mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
the error only occurs on second converge. first converge mounts the drive properly but since idempotency is broken when it tries to run again it fails because the mount already exists and gives you a busy error.
Copy link
Contributor
Author
if you simplify the resource to its basics the error still occurs.
mount '/backups' do
device '//MTLNAS/Servers/backup'
fstype 'cifs'
action [:mount, :enable]
end
I believe we have this fixed by #10614. I’ll let you know when we resolve our windows build issues and get this out to the current channel. It would be great to know if this resolves all your issues or if we need to spec out a few more scenarios.