Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #262602 > unrolled thread
| Started by | hw <hw@adminart.net> |
|---|---|
| First post | 2023-10-23 16:20 +0200 |
| Last post | 2023-10-23 18:10 +0200 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.debian.user
how to force mounting an entry in fstab on boot? hw <hw@adminart.net> - 2023-10-23 16:20 +0200
Re: how to force mounting an entry in fstab on boot? Greg Wooledge <greg@wooledge.org> - 2023-10-23 16:40 +0200
Re: how to force mounting an entry in fstab on boot? hw <hw@adminart.net> - 2023-10-23 17:30 +0200
Re: how to force mounting an entry in fstab on boot? David Wright <deblis@lionunicorn.co.uk> - 2023-10-23 21:10 +0200
Re: how to force mounting an entry in fstab on boot? Christoph Brinkhaus <c.brinkhaus@t-online.de> - 2023-10-23 17:00 +0200
Re: how to force mounting an entry in fstab on boot? hw <hw@adminart.net> - 2023-10-23 17:50 +0200
how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) hw <hw@adminart.net> - 2023-10-23 18:00 +0200
Re: how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) Christoph Brinkhaus <c.brinkhaus@t-online.de> - 2023-10-23 19:30 +0200
Re: how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) hw <hw@adminart.net> - 2023-10-27 21:10 +0200
Re: how to force mounting an entry in fstab on boot? Christoph Brinkhaus <c.brinkhaus@t-online.de> - 2023-10-23 18:10 +0200
| From | hw <hw@adminart.net> |
|---|---|
| Date | 2023-10-23 16:20 +0200 |
| Subject | how to force mounting an entry in fstab on boot? |
| Message-ID | <Hs3WG-igI-11@gated-at.bofh.it> |
Hi, I have an entry in the fstab to mount an NFS share via IPv6. For unknown reasons, the entry is being ignored on boot, so after booting, I have to log in as root and do a 'mount -a' which mounts the share without problems. The entry in the fstab looks like this: [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 I have another case in which machines need to be connected to a particular VLAN to mount home directories. In case they are not connected to that VLAN, I don't want the boot process to proceed at all because the home directories won't be available. So how do I force it that the entries in fstab are not being silently ignored? I want these shares either mounted, like through like 3 retries, or booting to stop when they can't be mounted.
[toc] | [next] | [standalone]
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2023-10-23 16:40 +0200 |
| Message-ID | <Hs4g1-inw-5@gated-at.bofh.it> |
| In reply to | #262602 |
On Mon, Oct 23, 2023 at 04:17:11PM +0200, hw wrote: > I have an entry in the fstab to mount an NFS share via IPv6. For > unknown reasons, the entry is being ignored on boot, so after booting, > I have to log in as root and do a 'mount -a' which mounts the share > without problems. Do your IPv4 NFS mounts have the same behavior? > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 On my systems, the options field contains "defaults,_netdev" and possibly a few other things. I don't know whether that matters. If you add an entry to /etc/hosts for this NFS server, and mount the share by hostname, does that change anything? > I have another case in which machines need to be connected to a > particular VLAN to mount home directories. In case they are not > connected to that VLAN, I don't want the boot process to proceed at > all because the home directories won't be available. Hmm... can you add the "fail" option after _netdev? I've never tried. > So how do I force it that the entries in fstab are not being silently > ignored? I want these shares either mounted, like through like 3 > retries, or booting to stop when they can't be mounted. I do not know how to allow a specific number of retries. Not without writing your own hacked-up shell scripts, at least.
[toc] | [prev] | [next] | [standalone]
| From | hw <hw@adminart.net> |
|---|---|
| Date | 2023-10-23 17:30 +0200 |
| Message-ID | <Hs52q-j17-15@gated-at.bofh.it> |
| In reply to | #262603 |
On Mon, 2023-10-23 at 10:30 -0400, Greg Wooledge wrote: > On Mon, Oct 23, 2023 at 04:17:11PM +0200, hw wrote: > > I have an entry in the fstab to mount an NFS share via IPv6. For > > unknown reasons, the entry is being ignored on boot, so after booting, > > I have to log in as root and do a 'mount -a' which mounts the share > > without problems. > > Do your IPv4 NFS mounts have the same behavior? No, I can mount the same share with the host name or the IPv4 address of the same server, and it works as it should. The IPv6 connection is set to be required at boot. > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > On my systems, the options field contains "defaults,_netdev" and possibly > a few other things. I don't know whether that matters. I'll try --- I think it uses defaults anywhen when no defaults are specified. What else would it use other than defaults ... > If you add an entry to /etc/hosts for this NFS server, and mount the > share by hostname, does that change anything? I have a DNS server (on the same machine that serves the share) which works fine. Making an entry in /etc/hosts is something I want to avoid. If the addresses of the server ever change, I wont remember that entry and will have to spend ever so much time to figure out what's wrong ... > > I have another case in which machines need to be connected to a > > particular VLAN to mount home directories. In case they are not > > connected to that VLAN, I don't want the boot process to proceed at > > all because the home directories won't be available. > > Hmm... can you add the "fail" option after _netdev? I've never tried. Hm, in man mount, there's only 'nofail' for when the mount is allowed to fail. That also means that mounts must not fail and the failure must not be ignored. Same goes man fstab. I doubt there's a 'fail' option. Who would want a mount to fail? > > So how do I force it that the entries in fstab are not being silently > > ignored? I want these shares either mounted, like through like 3 > > retries, or booting to stop when they can't be mounted. > > I do not know how to allow a specific number of retries. Not without > writing your own hacked-up shell scripts, at least. The retries aren't exactly necessary; I merely thought it can't hurt to retry, and systemd should do that anyway when there's a failure the first time.
[toc] | [prev] | [next] | [standalone]
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Date | 2023-10-23 21:10 +0200 |
| Message-ID | <Hs8tk-lDW-23@gated-at.bofh.it> |
| In reply to | #262608 |
On Mon 23 Oct 2023 at 17:28:54 (+0200), hw wrote: > On Mon, 2023-10-23 at 10:30 -0400, Greg Wooledge wrote: > > On Mon, Oct 23, 2023 at 04:17:11PM +0200, hw wrote: > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > > unknown reasons, the entry is being ignored on boot, so after booting, > > > I have to log in as root and do a 'mount -a' which mounts the share > > > without problems. > > > > Do your IPv4 NFS mounts have the same behavior? > > No, I can mount the same share with the host name or the IPv4 address > of the same server, and it works as it should. The IPv6 connection is > set to be required at boot. > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > > > On my systems, the options field contains "defaults,_netdev" and possibly > > a few other things. I don't know whether that matters. > > I'll try --- I think it uses defaults anywhen when no defaults are > specified. What else would it use other than defaults ... > > > If you add an entry to /etc/hosts for this NFS server, and mount the > > share by hostname, does that change anything? > > I have a DNS server (on the same machine that serves the share) which > works fine. Making an entry in /etc/hosts is something I want to > avoid. If the addresses of the server ever change, I wont remember > that entry and will have to spend ever so much time to figure out > what's wrong ... > > > > I have another case in which machines need to be connected to a > > > particular VLAN to mount home directories. In case they are not > > > connected to that VLAN, I don't want the boot process to proceed at > > > all because the home directories won't be available. > > > > Hmm... can you add the "fail" option after _netdev? I've never tried. > > Hm, in man mount, there's only 'nofail' for when the mount is allowed > to fail. That also means that mounts must not fail and the failure > must not be ignored. Same goes man fstab. I doubt there's a 'fail' > option. Who would want a mount to fail? > > > > So how do I force it that the entries in fstab are not being silently > > > ignored? I want these shares either mounted, like through like 3 > > > retries, or booting to stop when they can't be mounted. > > > > I do not know how to allow a specific number of retries. Not without > > writing your own hacked-up shell scripts, at least. > > The retries aren't exactly necessary; I merely thought it can't hurt > to retry, and systemd should do that anyway when there's a failure the > first time. You've read man mount, but have you read man systemd.mount? Specifically the second paragraph of FSTAB. Cheers, David.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Brinkhaus <c.brinkhaus@t-online.de> |
|---|---|
| Date | 2023-10-23 17:00 +0200 |
| Message-ID | <Hs4zn-iBc-1@gated-at.bofh.it> |
| In reply to | #262602 |
[Multipart message — attachments visible in raw view] — view raw
Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > Hi, > > I have an entry in the fstab to mount an NFS share via IPv6. For > unknown reasons, the entry is being ignored on boot, so after booting, > I have to log in as root and do a 'mount -a' which mounts the share > without problems. > > The entry in the fstab looks like this: > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > > I have another case in which machines need to be connected to a > particular VLAN to mount home directories. In case they are not > connected to that VLAN, I don't want the boot process to proceed at > all because the home directories won't be available. You might need the "late" option of mount. Its purpose is to mount when prerequisites as the network are available already. > > So how do I force it that the entries in fstab are not being silently > ignored? I want these shares either mounted, like through like 3 > retries, or booting to stop when they can't be mounted. > I have never tried to implement things as 3x retries or so. Kind regards, Christoph
[toc] | [prev] | [next] | [standalone]
| From | hw <hw@adminart.net> |
|---|---|
| Date | 2023-10-23 17:50 +0200 |
| Message-ID | <Hs5lL-jb1-1@gated-at.bofh.it> |
| In reply to | #262605 |
On Mon, 2023-10-23 at 16:53 +0200, Christoph Brinkhaus wrote: > Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > > Hi, > > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > unknown reasons, the entry is being ignored on boot, so after booting, > > I have to log in as root and do a 'mount -a' which mounts the share > > without problems. > > > > The entry in the fstab looks like this: > > > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > > > > > I have another case in which machines need to be connected to a > > particular VLAN to mount home directories. In case they are not > > connected to that VLAN, I don't want the boot process to proceed at > > all because the home directories won't be available. > > You might need the "late" option of mount. Its purpose is to mount when > prerequisites as the network are available already. There doesn't seem to a 'late' option in the man pages. Having '_netdev' is supposed to make sure that the network is up before mounting ... I found this, though: https://unix.stackexchange.com/questions/349264/fstab-mount-wait-for-network I'll try that, plus 'defaults'. > > So how do I force it that the entries in fstab are not being silently > > ignored? I want these shares either mounted, like through like 3 > > retries, or booting to stop when they can't be mounted. > > > I have never tried to implement things as 3x retries or so. Well, the retries are not so relevant; I'd expect that to happen anyway. But how can I stop the booting when a mount fails? Alternatively, how can I prevent booting or have the machine becoming inaccessible when it's not connected to a particular VLAN? Like the users can't log in and instead get a message that the computer is incorrectly connected ...
[toc] | [prev] | [next] | [standalone]
| From | hw <hw@adminart.net> |
|---|---|
| Date | 2023-10-23 18:00 +0200 |
| Subject | how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) |
| Message-ID | <Hs5vr-jhM-9@gated-at.bofh.it> |
| In reply to | #262609 |
On Mon, 2023-10-23 at 17:40 +0200, hw wrote: > On Mon, 2023-10-23 at 16:53 +0200, Christoph Brinkhaus wrote: > > Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > > > Hi, > > > > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > > unknown reasons, the entry is being ignored on boot, so after booting, > > > I have to log in as root and do a 'mount -a' which mounts the share > > > without problems. > > > > > > The entry in the fstab looks like this: > > > > > > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 Ok, it seems to work with: ... nfs defaults,_netdev,x-systemd.after=network-online.target 0 0 So the '_netdev' option is broken. I'll have to see if this reboot was an exception, but there's no good reason to assume that it won't work next time, too. So the next question remains: > [...] > > > So how do I force it that the entries in fstab are not being silently > > > ignored? I want these shares either mounted, like through like 3 > > > retries, or booting to stop when they can't be mounted. > > > > > I have never tried to implement things as 3x retries or so. > > Well, the retries are not so relevant; I'd expect that to happen > anyway. But how can I stop the booting when a mount fails? > > Alternatively, how can I prevent booting or have the machine becoming > inaccessible when it's not connected to a particular VLAN? Like the > users can't log in and instead get a message that the computer is > incorrectly connected ... Let me add that the machines are currently unaware that they are connected to a VLAN because the switch ports are configured untagged. I could change that to tagged but I don't see how that would solve anything. Unless maybe I could intervene before starting gdm by pinging a server and bringing up a message instead of starting gdm when the server can't be reached. That should be possible, but how would I bring up a message instead of gdm? It doesn't even have to be a GUI that's starting, just a message would suffice. After that, automatically shut down after a 2 minutes or so ...
[toc] | [prev] | [next] | [standalone]
| From | Christoph Brinkhaus <c.brinkhaus@t-online.de> |
|---|---|
| Date | 2023-10-23 19:30 +0200 |
| Subject | Re: how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) |
| Message-ID | <Hs6Ux-kmT-9@gated-at.bofh.it> |
| In reply to | #262612 |
[Multipart message — attachments visible in raw view] — view raw
Am Mon, Oct 23, 2023 at 05:57:28PM +0200 schrieb hw: > On Mon, 2023-10-23 at 17:40 +0200, hw wrote: > > On Mon, 2023-10-23 at 16:53 +0200, Christoph Brinkhaus wrote: > > > Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > > > > Hi, > > > > > > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > > > unknown reasons, the entry is being ignored on boot, so after booting, > > > > I have to log in as root and do a 'mount -a' which mounts the share > > > > without problems. > > > > > > > > The entry in the fstab looks like this: > > > > > > > > > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > Ok, it seems to work with: > > > ... nfs defaults,_netdev,x-systemd.after=network-online.target 0 0 > > > So the '_netdev' option is broken. I'll have to see if this reboot > was an exception, but there's no good reason to assume that it won't > work next time, too. > > So the next question remains: > > > [...] > > > > So how do I force it that the entries in fstab are not being silently > > > > ignored? I want these shares either mounted, like through like 3 > > > > retries, or booting to stop when they can't be mounted. > > > > > > > I have never tried to implement things as 3x retries or so. > > > > Well, the retries are not so relevant; I'd expect that to happen > > anyway. But how can I stop the booting when a mount fails? > > > > Alternatively, how can I prevent booting or have the machine becoming > > inaccessible when it's not connected to a particular VLAN? Like the > > users can't log in and instead get a message that the computer is > > incorrectly connected ... > > Let me add that the machines are currently unaware that they are > connected to a VLAN because the switch ports are configured untagged. > I could change that to tagged but I don't see how that would solve > anything. > > Unless maybe I could intervene before starting gdm by pinging a server > and bringing up a message instead of starting gdm when the server > can't be reached. That should be possible, but how would I bring up a > message instead of gdm? It doesn't even have to be a GUI that's > starting, just a message would suffice. After that, automatically > shut down after a 2 minutes or so ... > I have digged a little bit because this is an interesting task. I have tried to use the crontab of root but the messages are not printed to the console but send by mail. For that test I have not been logged in which seems to be your use case. Then I have had a look at gdm. I think one option to display stuff is to use gdm itself. The message of the greeting screen can be configured. A restart of gdm should be enough to update the content of the screen. I do not use gdm to try that. But I think that is at least an option. Kind regards, Christoph
[toc] | [prev] | [next] | [standalone]
| From | hw <hw@adminart.net> |
|---|---|
| Date | 2023-10-27 21:10 +0200 |
| Subject | Re: how to bring up message and prevent user login when not connected to a particular VLAN? (was: how to force mounting an entry in fstab on boot?) |
| Message-ID | <HtAnw-1hIl-9@gated-at.bofh.it> |
| In reply to | #262620 |
On Mon, 2023-10-23 at 19:22 +0200, Christoph Brinkhaus wrote: > Am Mon, Oct 23, 2023 at 05:57:28PM +0200 schrieb hw: > > On Mon, 2023-10-23 at 17:40 +0200, hw wrote: > > > On Mon, 2023-10-23 at 16:53 +0200, Christoph Brinkhaus wrote: > > > > Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > > > > > Hi, > > > > > > > > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > > > > unknown reasons, the entry is being ignored on boot, so after booting, > > > > > I have to log in as root and do a 'mount -a' which mounts the share > > > > > without problems. > > > > > > > > > > The entry in the fstab looks like this: > > > > > > > > > > > > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > > > Ok, it seems to work with: > > > > > > ... nfs defaults,_netdev,x-systemd.after=network-online.target 0 0 > > > > > > So the '_netdev' option is broken. I'll have to see if this reboot > > was an exception, but there's no good reason to assume that it won't > > work next time, too. > > > > So the next question remains: > > > > > [...] > > > > > So how do I force it that the entries in fstab are not being silently > > > > > ignored? I want these shares either mounted, like through like 3 > > > > > retries, or booting to stop when they can't be mounted. > > > > > > > > > I have never tried to implement things as 3x retries or so. > > > > > > Well, the retries are not so relevant; I'd expect that to happen > > > anyway. But how can I stop the booting when a mount fails? > > > > > > Alternatively, how can I prevent booting or have the machine becoming > > > inaccessible when it's not connected to a particular VLAN? Like the > > > users can't log in and instead get a message that the computer is > > > incorrectly connected ... > > > > Let me add that the machines are currently unaware that they are > > connected to a VLAN because the switch ports are configured untagged. > > I could change that to tagged but I don't see how that would solve > > anything. > > > > Unless maybe I could intervene before starting gdm by pinging a server > > and bringing up a message instead of starting gdm when the server > > can't be reached. That should be possible, but how would I bring up a > > message instead of gdm? It doesn't even have to be a GUI that's > > starting, just a message would suffice. After that, automatically > > shut down after a 2 minutes or so ... > > > I have digged a little bit because this is an interesting task. I have > tried to use the crontab of root but the messages are not printed to the > console but send by mail. For that test I have not been logged in which > seems to be your use case. > > Then I have had a look at gdm. I think one option to display stuff is to > use gdm itself. The message of the greeting screen can be configured. A > restart of gdm should be enough to update the content of the screen. I > do not use gdm to try that. But I think that is at least an option. Thank you very much, it sounds like a good option. I'll look into it and see if I can get it to work.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Brinkhaus <c.brinkhaus@t-online.de> |
|---|---|
| Date | 2023-10-23 18:10 +0200 |
| Message-ID | <Hs5F7-jAB-3@gated-at.bofh.it> |
| In reply to | #262609 |
[Multipart message — attachments visible in raw view] — view raw
Am Mon, Oct 23, 2023 at 05:40:54PM +0200 schrieb hw: > On Mon, 2023-10-23 at 16:53 +0200, Christoph Brinkhaus wrote: > > Am Mon, Oct 23, 2023 at 04:17:11PM +0200 schrieb hw: > > > Hi, > > > > > > I have an entry in the fstab to mount an NFS share via IPv6. For > > > unknown reasons, the entry is being ignored on boot, so after booting, > > > I have to log in as root and do a 'mount -a' which mounts the share > > > without problems. > > > > > > The entry in the fstab looks like this: > > > > > > > > > [fd53::11]:/srv/example /home/example/foo nfs _netdev 0 0 > > > > > > > > > I have another case in which machines need to be connected to a > > > particular VLAN to mount home directories. In case they are not > > > connected to that VLAN, I don't want the boot process to proceed at > > > all because the home directories won't be available. > > > > You might need the "late" option of mount. Its purpose is to mount when > > prerequisites as the network are available already. > > There doesn't seem to a 'late' option in the man pages. Having > '_netdev' is supposed to make sure that the network is up before > mounting ... Ups, that has been in my mind. It exists in FreeBSD but not in Debian. > > I found this, though: > https://unix.stackexchange.com/questions/349264/fstab-mount-wait-for-network > > I'll try that, plus 'defaults'. > > > > So how do I force it that the entries in fstab are not being silently > > > ignored? I want these shares either mounted, like through like 3 > > > retries, or booting to stop when they can't be mounted. > > > > > I have never tried to implement things as 3x retries or so. > > Well, the retries are not so relevant; I'd expect that to happen > anyway. But how can I stop the booting when a mount fails? > > Alternatively, how can I prevent booting or have the machine becoming > inaccessible when it's not connected to a particular VLAN? Like the > users can't log in and instead get a message that the computer is > incorrectly connected ... > You could start a crontab job to check the status some time after boot or create a systemd unit after almost everything has been finished. Kind regards, Christoph
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web