惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
美团技术团队
量子位
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
小众软件
小众软件
博客园 - 司徒正美
罗磊的独立博客
云风的 BLOG
云风的 BLOG
B
Blog RSS Feed
博客园 - 聂微东

Arch Linux Forums

Avidemux crashes without strace / Applications & Desktop Environments how to apply patches with non-linux linends / Newbie Corner Replicating CachyOS on vanilla Arch (or at least getting close) / Arch Discussion What's arch linux GUI package manager ? / Newbie Corner Hibernation failing due to insufficient memory / System Administration profiledef.sh editting question / Installation trying to script kde plasma wallpaper settings / Programming & Scripting Looking for new Audacious package maintainer / Creating & Modifying Packages issues installing arch with LUKS2 encryption / Newbie Corner QEMU PXE booting does not work with OVMF.4m.fd / Applications & Desktop Environments Wired lan regular disconnect / Newbie Corner Need Help setting up ARCH in my G16 G634JZR iwlwifi started failing consistently, trying to determine root cause Windows randomly jumping between monitors after GNOME 50 update No display via DP or HDMI after boot. / Kernel & Hardware how to change acpi platform_profile? / Newbie Corner Linux denied all kernel modules which not loaded right now Use iPhone as Webcam for Arch Linux Video Output Failure on nvidia-580xx-dkms on TTY --> Desktop switch (Page 2) / Kernel & Hardware I was going to rant ..WINE32 Sabotage compliments of Arvind Krishna / Arch Discussion [SOLVED] LUKS drive auto unlocked by TPM when expected not to / Networking, Server, and Protection Hibernate/suspend from X = dark panel; from TTY = works (ASUS G14, hyb (Page 2) / Laptop Issues Headphone jack noise/buzz / Newbie Corner segmentation fault in cc1plus when building CLK / AUR Issues, Discussion & PKGBUILD Requests Console alternative to meld / GNU/Linux Discussion Problem with paru git clone / Newbie Corner XKB questions / Applications & Desktop Environments gnome-keyring-daemon is not working correctly / Applications & Desktop Environments [SOLVED] Steam opens and immediately closes constantly / Newbie Corner Firefox rounded edges on Sway / Applications & Desktop Environments
Creating/deleting a mounting directory based on FS mount ...
Therk · 2026-06-21 · via Arch Linux Forums

Hi everyone, I'm currently converting an old-ish gaming pc into a sort of home server/NAS, it's all a lot of fun. There is a filesystem on there I want to mount to my laptop, but only when I'm at home. At the moment and for the foreseeable future, I won't be able to access this server over the internet.

To be able to quickly see if the file system is mounted, I'd like the mount directory to only exist when the FS is available. So whenever I'm not at home, there's no visible mount directory, when my laptop connects to my home's wifi, the directory gets created and the FS gets mounted, when I leave, the FS gets unmounted and the directory gets removed, if I'm at home, but the FS is inaccessible (like if the server were to be shut down), it gets unmounted and the directory gets removed. 

So far, I've found no easy way to do this. The simplest way to mount the network drive seems to be using /etc/fstab, using the x-systemd.automount and either nofail or soft options. From what I understand, this will also prevent the network drive mount timeout from slowing down my boot. Using the x-mount.mkdir option, it seems like I can also have fstab automatically create the directory, which is almost what I want! It just doesn't remove the directory when the FS gets unmounted.

Does this sound possible? Maybe I'm coming at this from a completely wrong point of view. Does it even make sens to think of network file systems as "successfully mounted", or does my machine only check when it needs to access a file?