[opensuse] conditional cifs mount
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab: //192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0 but if the NAS is not switched on, the boot process stops for ages, presumably when it tries to mount it as without the line in fstab it boots fast. I can write a script to mount it and have the user click on it to run in a terminal as: sudo mount -t cifs -o username=lynn,password=xxx //192.168.1.4/part1 /home/lynn/t50 I have tried to use it as a samba share from konqueror but I am then unable to write torrent data to it. I know I can ping it to find out if it's on or not but the whole thing is just too difficult for an ordinary user. Could anyone point me in the right direction? I think it's automount but nothing I have seen mentions cifs, only nfs. Phew, Lynn -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 lynn wrote:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
Add "noauto" there: ... noauto,username=lynn,password=xxx 0 0 and then, mount manually or by script. - -- Cheers / Saludos, Carlos E. R. (from 11.1-ex-factory) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkm5k4YACgkQU92UU+smfQUyPwCffU0Bo5VpmDK73rtISaMVE3At fq8An1kksNMTRKRvb/2NrpcTgjbNBVD8 =r8HE -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 12 March 2009 23:58:14 Carlos E. R. wrote:
lynn wrote:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
Add "noauto" there:
... noauto,username=lynn,password=xxx 0 0
and then, mount manually or by script.
-- Cheers / Saludos Carlos E. R. (from 11.1-ex-factory)
Hola Carlos Have I got the noauto bit correct: If the share is available at boot time it mounts it. If it isn't available it doesn't? If so, that's xactly what I want. L x -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I guess that noauto option doesn't solve your problem .
From 'man mount'
noauto Can only be mounted explicitly (i.e., the -a option will not cause the file system to be mounted) I'd try with a shell script by testing if the remote service is available 2009/3/13 lynn <lynn@steve-ss.com>:
On Thursday 12 March 2009 23:58:14 Carlos E. R. wrote:
lynn wrote:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
Add "noauto" there:
... noauto,username=lynn,password=xxx 0 0
and then, mount manually or by script.
-- Cheers / Saludos Carlos E. R. (from 11.1-ex-factory)
Hola Carlos Have I got the noauto bit correct:
If the share is available at boot time it mounts it. If it isn't available it doesn't? If so, that's xactly what I want.
L x -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2009-03-13 at 18:54 +0100, lynn wrote:
Add "noauto" there:
... noauto,username=lynn,password=xxx 0 0
and then, mount manually or by script.
Hola Carlos Have I got the noauto bit correct:
If the share is available at boot time it mounts it. If it isn't available it doesn't? If so, that's xactly what I want.
No, not that way. The "noauto" means that it will not mount automatically, that you have to explicitly mount it by hand, by command. This way the boot process will not stop for ages if the remote is not available, which is part of your problem. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkm6xwkACgkQtTMYHG2NR9VNIQCfZKXWTJyuTI0yMcwRMGEEcPEN ZAIAoIMMecsxMZz5f8MDnaj1jzZcXpKy =MwYM -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 14 Mar 2009 04:24:12 lynn wrote:
On Thursday 12 March 2009 23:58:14 Carlos E. R. wrote:
lynn wrote:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
Add "noauto" there:
... noauto,username=lynn,password=xxx 0 0
and then, mount manually or by script.
--
Lynn, Rather than putting smb/cifs mounts in /etc/fstab, you should rather specify them in /etc/samba/smbfstab. This file is readable only by root and thus regular users cannot view the passwords stored in there (as they can for /etc/fstab). Having done this on 2 laptops, I've not been aware of any timeout issues during boot when the shares (or rather the network) is not available. The other options is to try automount and setting up the mounts in auto.master or auto.misc. The automount system is supposed to automatically mount file systems the first time they're accessed (rather than at boot time) and unmount them after a specified inactivity timeout. I don't know, though, whether it works for smb/cifs shares - I've not tried it. YMMV. Rodney. -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au ===================================================
2009/3/12 lynn <lynn@steve-ss.com>:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
but if the NAS is not switched on, the boot process stops for ages, presumably when it tries to mount it as without the line in fstab it boots fast. I can write a script to mount it and have the user click on it to run in a terminal as:
sudo mount -t cifs -o username=lynn,password=xxx //192.168.1.4/part1 /home/lynn/t50
I have tried to use it as a samba share from konqueror but I am then unable to write torrent data to it. I know I can ping it to find out if it's on or not but the whole thing is just too difficult for an ordinary user. Could anyone point me in the right direction? I think it's automount but nothing I have seen mentions cifs, only nfs.
Phew, Lynn
The best thing you can do is use autofs instead of listing the share in fstab. Some examples: http://linux.bononline.nl/linux/automountsmbshares/index.php http://blog.sontek.net/2007/10/30/autofs-automount-network-shares/ I think that's what you're after... Regards, -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 14 March 2009 16:16:41 you wrote:
2009/3/12 lynn <lynn@steve-ss.com>:
I'm trying to automate a cifs mount from a NAS. Sometimes the NAS is switched on sometimes it isn't. If the NAS is on, I want to mount it and store stuff on it. If it's not then just ignore it. I've tried putting it in fstab:
//192.168.1.4/part1 /home/lynn/t50 cifs username=lynn,password=xxx 0 0
but if the NAS is not switched on, the boot process stops for ages, presumably when it tries to mount it as without the line in fstab it boots fast. I can write a script to mount it and have the user click on it to run in a terminal as:
sudo mount -t cifs -o username=lynn,password=xxx //192.168.1.4/part1 /home/lynn/t50
I have tried to use it as a samba share from konqueror but I am then unable to write torrent data to it. I know I can ping it to find out if it's on or not but the whole thing is just too difficult for an ordinary user. Could anyone point me in the right direction? I think it's automount but nothing I have seen mentions cifs, only nfs.
Phew, Lynn
The best thing you can do is use autofs instead of listing the share in fstab.
Some examples: http://linux.bononline.nl/linux/automountsmbshares/index.php http://blog.sontek.net/2007/10/30/autofs-automount-network-shares/
I think that's what you're after...
Regards,
OMG that is *utterly amazing. I add one line to /etc/auto.master and start autofs. And it just works. There must be a catch! L x -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Carlos E. R.
-
Chema
-
Ciro Iriarte
-
lynn
-
Rodney Baker