Results 1 to 8 of 8
I have Windows shares mounted on my Ubuntu media center. However, when the Windows machine is down the Linux machine hangs when trying to access folders that have links to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-14-2009 #1Just Joined!
- Join Date
- Apr 2003
- Posts
- 50
Linux hangs when network share is unavailable
I have Windows shares mounted on my Ubuntu media center. However, when the Windows machine is down the Linux machine hangs when trying to access folders that have links to the Windows shares. So going into /media for example will hang because I have a videosd and videose folder that point to the Windows shares. It's really annoying. On top of that when I restart the machine it tries mounting the shares and will hang there forever trying to access the files it doesn't seem to time out. Anyone got any tips I can try. Here's my /etc/fstab file:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sdb2
UUID=77a55212-d927-4e48-9039-5b79d7c0a848 / ext3 relatime,errors=remount-ro,noatime 0 1
# /dev/sdb1
UUID=810a5d9d-d8a0-4fdd-9f92-032ff7e3ae03 none swap sw 0 0
#/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
LABEL=bigdrive /media/bigdrive ext3 defaults,noatime 0 0
LABEL=usb /media/usb ext3 defaults,noatime 0 0
LABEL=systemspare /media/systemspare ext3 defaults,noatime 0 0
//192.168.1.101/videosd /media/videosd cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
//192.168.1.101/videose /media/videose cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
//192.168.1.101/dvd /media/mainbox_dvd cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
LABEL=160GB-USB /media/160GB-USB ntfs-3g defaults,force,umask=000 0 0
//192.168.1.101/software /media/software cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
/dev/scd0 /media/usbdvd udf,iso9660 user,auto,exec,utf8 0 0
//192.168.1.101/backup /media/backup cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
//192.168.1.101/documents /media/documents cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
//192.168.1.101/downloads /media/downloads cifs defaults,username=gene,password=hea9671,uid=gene,u mask=000 0 0
- 07-17-2009 #2Just Joined!
- Join Date
- Jul 2009
- Posts
- 58
What would like to happen to you go to a mount point that is not available? It can't magically show you the files. If you decrease the timeout you're going to have issues accessing large files across your network.
- 07-17-2009 #3
You could solve this pretty easily with a shell script, assuming you have root or sudo access. Instead of automounting them in fstab, you have a script that executes on startup. Here is the script:
This should work.Code:#!/bin/bash ping -c 1 192.168.1.101 > /tmp/ping.txt if [ ! `grep "1 received" /tmp/ping.txt` = "" ] ; then echo "Mounting shares..." mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/videosd /media/videosd mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/videose /media/videose mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/dvd /media/mainbox_dvd mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/software /media/software mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/backup /media/backup mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/documents /media/documents mount -t cifs -o defaults,username=gene,password=hea9671,uid=gene,umask=000 //192.168.1.101/downloads /media/downloads echo "Done mounting shares." else echo "192.168.1.101 is not up!" fi
- 07-17-2009 #4
Also, here is how you make it start on boot
Code:Write a script. put it in the /etc/init.d/ directory. Lets say you called it FOO. You then run update-rc.d FOO defaults You also have to make the file you created, FOO, executable, using chmod +x FOO
- 07-17-2009 #5Just Joined!
- Join Date
- Jul 2009
- Posts
- 58
I don't think his complaint is mount or unmounting, its when both systems are up and mounted. Than the .101 server goes away, the mount shouldn't hang.
There is no way to "fix" that since it isn't broken. That's the expected result. To unmount with force is a horrible idea, so a script isn't going to help.
- 07-17-2009 #6
Not exactly wht you asked ... but I take this Ubuntu runs as a kind of server? Better would be to mount server volumes from desktops than vice versa. Make sure the server has a big enugh hard drive and let desktops use it for downloads and media sharing.
- 07-17-2009 #7
- 07-18-2009 #8Just Joined!
- Join Date
- Jul 2009
- Posts
- 58


Reply With Quote

