SSHFS mounts on a mobile laptop - system hangs when not on LAN

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












This is an Arch Linux system. I have 7 SSHFS mounts listed in /etc/fstab. They all use these options:



<source> <mountpoint> fuse.sshfs x-systemd.automount,_netdev,user,follow_symlinks,identityfile=/home/user/.ssh/id_rsa,default_permissions


The source for these mounts is a local file server. When connected to the LAN, everything works as expected.



However, when the laptop is elsewhere, these mounts cause a problem. Booting up takes a long time and some applications will hang for a long time. For example, Dolphin opens and hangs, then has to be force closed.



I would like for these SSHFS mounts to only be attempted when the laptop is connected to the LAN via wired Ethernet.



How can this be achieved?



(I could be wrong, but I don't believe autofs is the solution because I don't want the mounts to be attempted upon browsing to a mountpoint (as in Dolphin), unless the system is connected to the LAN.)







share|improve this question






















  • Did you have a look at creating a udev rule
    – RubberStamp
    Jan 4 at 21:50










  • @RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
    – MountainX
    Jan 5 at 0:40














up vote
3
down vote

favorite












This is an Arch Linux system. I have 7 SSHFS mounts listed in /etc/fstab. They all use these options:



<source> <mountpoint> fuse.sshfs x-systemd.automount,_netdev,user,follow_symlinks,identityfile=/home/user/.ssh/id_rsa,default_permissions


The source for these mounts is a local file server. When connected to the LAN, everything works as expected.



However, when the laptop is elsewhere, these mounts cause a problem. Booting up takes a long time and some applications will hang for a long time. For example, Dolphin opens and hangs, then has to be force closed.



I would like for these SSHFS mounts to only be attempted when the laptop is connected to the LAN via wired Ethernet.



How can this be achieved?



(I could be wrong, but I don't believe autofs is the solution because I don't want the mounts to be attempted upon browsing to a mountpoint (as in Dolphin), unless the system is connected to the LAN.)







share|improve this question






















  • Did you have a look at creating a udev rule
    – RubberStamp
    Jan 4 at 21:50










  • @RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
    – MountainX
    Jan 5 at 0:40












up vote
3
down vote

favorite









up vote
3
down vote

favorite











This is an Arch Linux system. I have 7 SSHFS mounts listed in /etc/fstab. They all use these options:



<source> <mountpoint> fuse.sshfs x-systemd.automount,_netdev,user,follow_symlinks,identityfile=/home/user/.ssh/id_rsa,default_permissions


The source for these mounts is a local file server. When connected to the LAN, everything works as expected.



However, when the laptop is elsewhere, these mounts cause a problem. Booting up takes a long time and some applications will hang for a long time. For example, Dolphin opens and hangs, then has to be force closed.



I would like for these SSHFS mounts to only be attempted when the laptop is connected to the LAN via wired Ethernet.



How can this be achieved?



(I could be wrong, but I don't believe autofs is the solution because I don't want the mounts to be attempted upon browsing to a mountpoint (as in Dolphin), unless the system is connected to the LAN.)







share|improve this question














This is an Arch Linux system. I have 7 SSHFS mounts listed in /etc/fstab. They all use these options:



<source> <mountpoint> fuse.sshfs x-systemd.automount,_netdev,user,follow_symlinks,identityfile=/home/user/.ssh/id_rsa,default_permissions


The source for these mounts is a local file server. When connected to the LAN, everything works as expected.



However, when the laptop is elsewhere, these mounts cause a problem. Booting up takes a long time and some applications will hang for a long time. For example, Dolphin opens and hangs, then has to be force closed.



I would like for these SSHFS mounts to only be attempted when the laptop is connected to the LAN via wired Ethernet.



How can this be achieved?



(I could be wrong, but I don't believe autofs is the solution because I don't want the mounts to be attempted upon browsing to a mountpoint (as in Dolphin), unless the system is connected to the LAN.)









share|improve this question













share|improve this question




share|improve this question








edited Jan 5 at 7:54









jasonwryan

46.9k14127176




46.9k14127176










asked Jan 4 at 21:28









MountainX

4,4612367116




4,4612367116











  • Did you have a look at creating a udev rule
    – RubberStamp
    Jan 4 at 21:50










  • @RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
    – MountainX
    Jan 5 at 0:40
















  • Did you have a look at creating a udev rule
    – RubberStamp
    Jan 4 at 21:50










  • @RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
    – MountainX
    Jan 5 at 0:40















Did you have a look at creating a udev rule
– RubberStamp
Jan 4 at 21:50




Did you have a look at creating a udev rule
– RubberStamp
Jan 4 at 21:50












@RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
– MountainX
Jan 5 at 0:40




@RubberStamp - udev seems like a good idea. I would need some help to implement it in this case. I wasn't even aware that udev could be used in this way until you suggested it.
– MountainX
Jan 5 at 0:40















active

oldest

votes











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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414861%2fsshfs-mounts-on-a-mobile-laptop-system-hangs-when-not-on-lan%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414861%2fsshfs-mounts-on-a-mobile-laptop-system-hangs-when-not-on-lan%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay