OpenSUSE Leap 42.3: How to mount a CIFS file share at boot when the network won't start?
I am using OpenSUSE Leap 42.3
I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.
However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.
By this time the mount attempt at boot time has already failed because no Wifi connection was active.
How do I make sure there is an active Wifi connection before the cifs file share is mounted?
opensuse networkmanager
add a comment |
I am using OpenSUSE Leap 42.3
I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.
However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.
By this time the mount attempt at boot time has already failed because no Wifi connection was active.
How do I make sure there is an active Wifi connection before the cifs file share is mounted?
opensuse networkmanager
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
If you add the optionsnofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in someifup
script).
– ridgy
Dec 22 '17 at 16:38
add a comment |
I am using OpenSUSE Leap 42.3
I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.
However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.
By this time the mount attempt at boot time has already failed because no Wifi connection was active.
How do I make sure there is an active Wifi connection before the cifs file share is mounted?
opensuse networkmanager
I am using OpenSUSE Leap 42.3
I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.
However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.
By this time the mount attempt at boot time has already failed because no Wifi connection was active.
How do I make sure there is an active Wifi connection before the cifs file share is mounted?
opensuse networkmanager
opensuse networkmanager
asked Dec 22 '17 at 13:29
Aditya KAditya K
789821
789821
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
If you add the optionsnofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in someifup
script).
– ridgy
Dec 22 '17 at 16:38
add a comment |
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
If you add the optionsnofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in someifup
script).
– ridgy
Dec 22 '17 at 16:38
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
If you add the options
nofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifup
script).– ridgy
Dec 22 '17 at 16:38
If you add the options
nofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifup
script).– ridgy
Dec 22 '17 at 16:38
add a comment |
1 Answer
1
active
oldest
votes
Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d
You can create a script of the kind:
===== 50-smb-mount =====
#! /bin/sh
case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac
========================
Do not forget to chmod +x it.
In addition you may add 'user,nofail' options in your fstab cifs entries.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412508%2fopensuse-leap-42-3-how-to-mount-a-cifs-file-share-at-boot-when-the-network-won%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d
You can create a script of the kind:
===== 50-smb-mount =====
#! /bin/sh
case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac
========================
Do not forget to chmod +x it.
In addition you may add 'user,nofail' options in your fstab cifs entries.
add a comment |
Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d
You can create a script of the kind:
===== 50-smb-mount =====
#! /bin/sh
case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac
========================
Do not forget to chmod +x it.
In addition you may add 'user,nofail' options in your fstab cifs entries.
add a comment |
Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d
You can create a script of the kind:
===== 50-smb-mount =====
#! /bin/sh
case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac
========================
Do not forget to chmod +x it.
In addition you may add 'user,nofail' options in your fstab cifs entries.
Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d
You can create a script of the kind:
===== 50-smb-mount =====
#! /bin/sh
case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac
========================
Do not forget to chmod +x it.
In addition you may add 'user,nofail' options in your fstab cifs entries.
answered Jan 24 at 17:54
Autumn FoxAutumn Fox
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412508%2fopensuse-leap-42-3-how-to-mount-a-cifs-file-share-at-boot-when-the-network-won%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.
– guiverc
Dec 22 '17 at 13:48
If you add the options
nofail,user
to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in someifup
script).– ridgy
Dec 22 '17 at 16:38