On Tue, 10 Jan 2017 20:08:10 +0100 Steffen Dettmer <steffen.dett...@gmail.com> wrote:
> On Sun, Jan 8, 2017 at 7:45 PM, Joe <j...@jretrading.com> wrote: > >> What happened before: > >> I had issue with a Debian server SATA bus [1]. I noticed because > >> apt-get upgrade hung, because initramfs updater calls "sync" which > >> hang because of [1]. All operations accessing a certain (backup) > >> disk blocked. Shutdown over network. It was reported server power > >> LED still up, so probably shutdown hang, too. Server was powered > >> off and disk pulled. > > > > The disc you removed: did it have an entry in /etc/fstab? Does this > > server use systemd? If yes to both, comment the /etc/fstab entry or > > give it an extra option 'noauto'. > > In short: yes, this was the problem. I didn't found this first because > there was no easily visible error message. > > Thanks you for your help! > > Do you - or anyone - know how to mount a disk at boot without > failing when it is not there? Like normal "classic" behavior? > Of course I can write a simple script if I somehow manage > systemd to execute it. In the old days there was some rc.local, > surely I find something like this. I just wonder what to put > into fstab that script detects as to be mounted without > systemd aborting when it is missing (without patching > systemd of course) > I ran into this problem on a system 'upgraded' to systemd-as-init, because I had a few USB sticks named in /etc/fstab in order that the nearly-brain-dead usbmount would actually mount them with a consistent name and place, and mount the partitions rather than the entire drive, as sometimes happened. Fortunately, systemd has a rather better automounter, and was able to mount the stick by name, which usbmount did not. So I could simply remove the fstab entries and everything worked better than before. I don't leave anything plugged in when I boot this machine, as I do sometimes boot from USB, and if I leave a USB storage device plugged in, the BIOS is not clever enough to realise that there is no bootloader on it... even a Kindle will kill the boot. But it is possible that if your BIOS does not try to boot from a pre-plugged USB medium, that systemd will automount it when it is found during boot. This should do what you want, if it happens. Having said that, I have a few network shares which were sometimes troublesome during boot, and now have 'noauto' in their fstab options. They *also* have 'x-systemd.automount' options, which mounts them on the first access attempt to the mount point. I've never needed to try whether this will work with removable drives, but it might, if systemd will not automount them (without an fstab entry) during boot. -- Joe