Idle timeout for NFS share mounted with systemd automount












0














I want to configure my /etc/fstab so that my NFS share was automatically:




  • mounted when accessed (auto-mount on-demand),

  • unmounted after specified idle timeout (x-systemd.idle-timeout).


AFAIK, I can achieve this behavior using AutoFS or systemd automount. I prefer systemd because I don't want to install additional packages unless needed.



This is excerpt from my /etc/fstab (I followed this tutorial):



192.168.1.14:/home/someuser/somedir /mnt/someuser_share nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,x-systemd.idle-timeout=1min,_netdev 0 0


Note that in the above line there is:



x-systemd.idle-timeout=1min


but it doesn't work. After waiting 1 minute without using /mnt/someuser_shar it is still mounted.



Why it doesn't work as expected?



Note that after system bootup my share is not mounted as expected. After I type eg. ls /mnt/someuser_share it's mounted (if 192.168.1.14 is online). After next 1 minute I would expect that my share will be unmounted, but it isn't.



I'm using Debian Stable, ie. Debian Stretch (9.6). systemd version: 232.





As a side note: I'm aware that systemd reads /etc/fstab and creates unit files, specifically automount and mount unit files that can be listed using systemctl command and viewed using systemctl cat name-of-the-unit-file.










share|improve this question
























  • can you specify both which version of systemd and distribution are you using ?
    – D'Arcy Nader
    37 mins ago






  • 1




    I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
    – patryk.beza
    20 mins ago












  • have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
    – D'Arcy Nader
    5 mins ago
















0














I want to configure my /etc/fstab so that my NFS share was automatically:




  • mounted when accessed (auto-mount on-demand),

  • unmounted after specified idle timeout (x-systemd.idle-timeout).


AFAIK, I can achieve this behavior using AutoFS or systemd automount. I prefer systemd because I don't want to install additional packages unless needed.



This is excerpt from my /etc/fstab (I followed this tutorial):



192.168.1.14:/home/someuser/somedir /mnt/someuser_share nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,x-systemd.idle-timeout=1min,_netdev 0 0


Note that in the above line there is:



x-systemd.idle-timeout=1min


but it doesn't work. After waiting 1 minute without using /mnt/someuser_shar it is still mounted.



Why it doesn't work as expected?



Note that after system bootup my share is not mounted as expected. After I type eg. ls /mnt/someuser_share it's mounted (if 192.168.1.14 is online). After next 1 minute I would expect that my share will be unmounted, but it isn't.



I'm using Debian Stable, ie. Debian Stretch (9.6). systemd version: 232.





As a side note: I'm aware that systemd reads /etc/fstab and creates unit files, specifically automount and mount unit files that can be listed using systemctl command and viewed using systemctl cat name-of-the-unit-file.










share|improve this question
























  • can you specify both which version of systemd and distribution are you using ?
    – D'Arcy Nader
    37 mins ago






  • 1




    I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
    – patryk.beza
    20 mins ago












  • have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
    – D'Arcy Nader
    5 mins ago














0












0








0


1





I want to configure my /etc/fstab so that my NFS share was automatically:




  • mounted when accessed (auto-mount on-demand),

  • unmounted after specified idle timeout (x-systemd.idle-timeout).


AFAIK, I can achieve this behavior using AutoFS or systemd automount. I prefer systemd because I don't want to install additional packages unless needed.



This is excerpt from my /etc/fstab (I followed this tutorial):



192.168.1.14:/home/someuser/somedir /mnt/someuser_share nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,x-systemd.idle-timeout=1min,_netdev 0 0


Note that in the above line there is:



x-systemd.idle-timeout=1min


but it doesn't work. After waiting 1 minute without using /mnt/someuser_shar it is still mounted.



Why it doesn't work as expected?



Note that after system bootup my share is not mounted as expected. After I type eg. ls /mnt/someuser_share it's mounted (if 192.168.1.14 is online). After next 1 minute I would expect that my share will be unmounted, but it isn't.



I'm using Debian Stable, ie. Debian Stretch (9.6). systemd version: 232.





As a side note: I'm aware that systemd reads /etc/fstab and creates unit files, specifically automount and mount unit files that can be listed using systemctl command and viewed using systemctl cat name-of-the-unit-file.










share|improve this question















I want to configure my /etc/fstab so that my NFS share was automatically:




  • mounted when accessed (auto-mount on-demand),

  • unmounted after specified idle timeout (x-systemd.idle-timeout).


AFAIK, I can achieve this behavior using AutoFS or systemd automount. I prefer systemd because I don't want to install additional packages unless needed.



This is excerpt from my /etc/fstab (I followed this tutorial):



192.168.1.14:/home/someuser/somedir /mnt/someuser_share nfs noauto,x-systemd.automount,x-systemd.device-timeout=30,x-systemd.idle-timeout=1min,_netdev 0 0


Note that in the above line there is:



x-systemd.idle-timeout=1min


but it doesn't work. After waiting 1 minute without using /mnt/someuser_shar it is still mounted.



Why it doesn't work as expected?



Note that after system bootup my share is not mounted as expected. After I type eg. ls /mnt/someuser_share it's mounted (if 192.168.1.14 is online). After next 1 minute I would expect that my share will be unmounted, but it isn't.



I'm using Debian Stable, ie. Debian Stretch (9.6). systemd version: 232.





As a side note: I'm aware that systemd reads /etc/fstab and creates unit files, specifically automount and mount unit files that can be listed using systemctl command and viewed using systemctl cat name-of-the-unit-file.







debian systemd nfs fstab autofs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 21 mins ago

























asked 1 hour ago









patryk.beza

504517




504517












  • can you specify both which version of systemd and distribution are you using ?
    – D'Arcy Nader
    37 mins ago






  • 1




    I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
    – patryk.beza
    20 mins ago












  • have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
    – D'Arcy Nader
    5 mins ago


















  • can you specify both which version of systemd and distribution are you using ?
    – D'Arcy Nader
    37 mins ago






  • 1




    I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
    – patryk.beza
    20 mins ago












  • have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
    – D'Arcy Nader
    5 mins ago
















can you specify both which version of systemd and distribution are you using ?
– D'Arcy Nader
37 mins ago




can you specify both which version of systemd and distribution are you using ?
– D'Arcy Nader
37 mins ago




1




1




I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
– patryk.beza
20 mins ago






I updated my post (Debian Stable, ie. Debian Stretch [9.6] + systemd ver. 232).
– patryk.beza
20 mins ago














have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
– D'Arcy Nader
5 mins ago




have you tried without _netdev and using seconds insted of minutes for x-systemd.idle-timeout= ? i would .
– D'Arcy Nader
5 mins ago















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',
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491367%2fidle-timeout-for-nfs-share-mounted-with-systemd-automount%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491367%2fidle-timeout-for-nfs-share-mounted-with-systemd-automount%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt