Other umounting nfs causes terminal to hang have to power off

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#1
Hi everyone

When i try and unmount an nfs share my computer locks up and i have to power off

The nfs share is in my fstab as shown below

Bash:
192.168.1.25:/volume1/Video /home/djwilcox/video nfs rw,noauto 0 0
When i run

Bash:
sudo umount ~/video
to unmount the nfs share the terminal hangs and becomes unresponsive,
if i try and control c it just prints ^c in the terminal

i have also noticed the problem trying to unmount usb drives as well

i also tried opening a new terminal to unmount the share,
so i have to re enter my admin password using sudo to unmount the drive but i still have the same issue

I can kill the bash process the terminal is running which close the terminal window,
trying to kill the process id of the umount process doesnt work

when i open a new terminal and try and run another command like ls the terminal also hangs,
and again control c just prints c^ in the terminal so i have to power off by pressing the power button

im running freebsd 11.2 on a 2011 11inch macbook air

ive been running freebsd for the last 18 months after using linux for 5 or 6 years,
so i comfortable on the command line and not a total noob

i cant see any errors in the logs and it has me totally baffled

i dont get the issue unmounting the nfs share on ubuntu 18.04 only on freebsd,
so i dont think its an issue with the nfs server which is running on a synology nas

any ideas what the issue might be and how to resolve it
 

Sevendogsbsd

Active Member

Thanks: 38
Messages: 141

#2
Interesting - I also have a synology NAS and a similar entry in my /etc/fstab but I never unmount it. I mount and unmount other directories on the NAS all the time with no issues. Not running a Mac though but not sure that matters. I'll try to unmount my /etc/fstab entry tonight after work and post back.

Same FreeBSD version: 11.2 - p4 - I'll provide my config contents as well to see if maybe that can help.
 

michaelgalassi

New Member


Messages: 2

#3
This is almost certainly a buffer that the OS does not think has been successfully written to disk by the server. You have two options (maybe more, but two come to mind). You can run lsof(8) in a different terminal and try to figure out what I/O has been lost, or (less desirably), you can change your mount to soft (or inter) as described in the mount_nfs(8) manpage. This second path is likely to cause some level of data loss so you should only pursue it if you feel you have no alternatives. You would do so by changing your mount line to 192.168.1.25:/volume1/Video /home/djwilcox/video nfs rw,soft,noauto 0 0.
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#4
Interesting - I also have a synology NAS and a similar entry in my /etc/fstab but I never unmount it. I mount and unmount other directories on the NAS all the time with no issues. Not running a Mac though but not sure that matters. I'll try to unmount my /etc/fstab entry tonight after work and post back.

Same FreeBSD version: 11.2 - p4 - I'll provide my config contents as well to see if maybe that can help.
Hi Sevendogsbsd

cheers mate
i reinstalled freebsd from scratch a couple of months ago so its quite a new install

also i close any programs before trying to unmount the nfs share so nothing else is running
but the terminal still hangs when i try and unmount the share

i have listed my root and home dotfiles below with all my config files if thats any help

my freebsd root dotfiles

my freebsd home dotfiles

i also make sure the synology nas is spun up before trying to unmount
by opening the nas ui in a browser on another computer

weird thing is opening another terminal and running ls also hangs as well
so wondering if its some kind of io issue
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#5
This is almost certainly a buffer that the OS does not think has been successfully written to disk by the server. You have two options (maybe more, but two come to mind). You can run lsof(8) in a different terminal and try to figure out what I/O has been lost, or (less desirably), you can change your mount to soft (or inter) as described in the mount_nfs(8) manpage. This second path is likely to cause some level of data loss so you should only pursue it if you feel you have no alternatives. You would do so by changing your mount line to 192.168.1.25:/volume1/Video /home/djwilcox/video nfs rw,soft,noauto 0 0.
Hi michaelgalassi

i have installed lsof
Ill try running lsof in the terminal when the nfs share doesnt unmount

What should i do then, try and kill the process id

Then try and force umount the nfs share

Bash:
sudo umount -f -l ~/video
-f – Force unmount
-l – Lazy unmount

or

Bash:
sudo umount -fr ~/video
-r argument remounts as read-only and then unmounts the folder.

and maybe

sudo service nfsclient restart
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#6
HI all

i use the ranger file manager to browse the nfs share and then use ranger to open video file with mpv player
so im wondering if its actually ranger that might be the issue

im running py36-ranger
i have noticed that ranger can be a bit sluggish opening text files with vim and then closing them again

ill see if thats the issue
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#7
Hi All

i think its using ranger file manager to browse the nfs share and open files thats the issue

i just mounted and unmounted the nfs share several times with no problems at all,
without using ranger and playing video files directly with mpv

Solution dont use ranger to browse nfs shares and open files with external programs like mpv for videos

Seems like some issue with ranger which use the rifle.conf config file to launch external applications based on the file type

this is the line from rifle.conf to open videos with mpv

Bash:
mime ^video,       has mpv,      X, flag f = mpv -- "$@"
its seems like when you close mpv and ranger somehow its keeping the process alive somewhere
and so you cant unmount the share because it still in use

thats my theory anyway
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#9
may have to look for another terminal based file manager instead of ranger

shame because i rather like ranger and the vim keyboard shortcuts
any suggestions for an alternative terminal based file manager
 

Sevendogsbsd

Active Member

Thanks: 38
Messages: 141

#13
I love midnight commander, however, the pkg does not work with /bin/sh, and with /bin/tcsh it destroys your shell history file. The reason is the subshell support compiled into the pkg. If you use ports and not packages, just build the midnight commander port without subshell support and it works great.

I have since settled on misc/lfm which is SORT of like midnight commander - does the same thing basically but uses some different keys. The web site for it has pretty good docs.
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#14
I love midnight commander, however, the pkg does not work with /bin/sh, and with /bin/tcsh it destroys your shell history file. The reason is the subshell support compiled into the pkg. If you use ports and not packages, just build the midnight commander port without subshell support and it works great.

I have since settled on misc/lfm which is SORT of like midnight commander - does the same thing basically but uses some different keys. The web site for it has pretty good docs.
those do sound like annoying bugs with midnight commander
i use bash so maybe i wouldnt be bitten by those bugs

im using pkg and not ports because i only have 4gig of ram on my old macbook air

went to have a look at the lfm site but seems to be down at the moment
lfm site
 

Sevendogsbsd

Active Member

Thanks: 38
Messages: 141

#15
You might be fine with misc/mc then - that's my favorite cli based file manager but I have switched back to pkgs from ports because of the compile times and pkgs are just easier...give this link a go: lfm
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#17
HI All

i spoke to soon its not ranger thats the issue

i mounted the nfs share played a video with mpv,
stopped mpv and then tried to unmount the share and i had the same issue of the the share not unmounting

whats strange is when i run

Bash:
sudo ps aux
its shows

Code:
sudo mount /home/djwilcox/video
umount /home/djwilcox/video
even though i opened a new terminal so i had to enter my admin password to umount the drive
sudo ps aux shows umount /home/djwilcox/video and not sudo umount /home/djwilcox/video

i cant see anything using lsof or in the logs

im using i3wm and not a heavy desktop like gnome or kde,
nothing else was running and i only had one terminal open

the only other thing i noticed was when booting up it saw nfs cache time=60

im running 11.2 and its quite a new install only 3 months old

i can kill bash for the terminal thats trying to unmount the nfs share,
but i cant kill the umount process

if i try and run ls in another terminal it hangs and trying to control c just print c^ in the terminal

i wondering if its some io error or something to do with the nfs cache time=60

really has me totally baffled

anyone got any ideas what the issue might be
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#19
im running a synology nas and this is the /etc/exports file for the nfs share

Bash:
/volume1/Video  192.168.1.0/24(rw,async,no_wdelay,insecure,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)
anything there that might be causing the issue
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#20
ive changed my fstab

Bash:
192.168.1.25:/volume1/Video /home/djwilcox/video nfs rw,noauto,noatime,rsize=32768,wsize=32768 0 0
thats the fstab ive been using on linux for a couple of years with nfs share on a synology nas
hopefully that will fix the issue

ill see how it goes
 

Sevendogsbsd

Active Member

Thanks: 38
Messages: 141

#21
I also have a synology NAS but have never touched the OS - guessing you SSH'd into the NAS and built an exports file? I have only used the web GUI they provide and have never had an issue. The /etc/fstab mount I have is for music. I could try and unmount it to see what happens. After work I'll log on and do a test and report back what happens when I unmount.

I have a similar line in my workstation's /etc/fstab as well.
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#22
i just used the synology web ui to set up the nfs exports,
but i did ssh in and switch to root to cat the /etc/exports file so i could see the contents of the file

i just mounted the nfs share with my new fstab and i still get the same issue of it hanging when trying to unmount

i had to force unmount by doing

Bash:
sudo umount -f ~/video
at least i didnt have to power off
the synology nfs share is using nfsv4, i dont think ive had any synology system updates recently

really got my baffled as to what the cause is
 

Sevendogsbsd

Active Member

Thanks: 38
Messages: 141

#23
OK, so you were accessing video, as in playing one, then stopped and tried to unmount the drive, right? Want to be sure I duplicate what you are doing.
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#24
HI Mate

yes mount the share play a video and unmount the share

also even if i just mount the share and then unmount it without playing a video or accessing anything on the share it will hang when i try and unmount
 
OP
OP
NapoleonWils0n

NapoleonWils0n

Member

Thanks: 4
Messages: 44

#25
when the nfs share is mounted and i run

Bash:
mount
it just shows

nfs, noatime

and not all the options from my fstab for the nfs share
as shown below

Bash:
192.168.1.25:/volume1/Video /home/djwilcox/video nfs rw,noauto,noatime,rsize=32768,wsize=32768 0 0
 
Top