Can't connect to a Linode after detaching a Block Storage Volume and rebooting.
After detaching a Block Storage volume from a Linode and rebooting, the Linode is only accessible through LISH. How can this be fixed and it be prevented from happening again?
1 Reply
What is happening?
When you attach a volume using the Linode Manager, the instructions include an optional line to add to your /etc/fstab
file to auto-mount the volume at boot. For a volume named "test", it would look like this:
/dev/disk/by-id/scsi-0Linode_Volume_test /mnt/test ext4 defaults,noatime 0 2
However, if you detach the volume without editing /etc/fstab
appropriately, and reboot the Linode, it will time out, unable to find the drive, and lock the user out. The boot log will show something like this:
[ TIME ] Timed out waiting for device dev-di...x2d0Linode_Volume_test.device.
[DEPEND] Dependency failed for File System C...y-id/scsi-0Linode_Volume_test.
[DEPEND] Dependency failed for /mnt/test.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for Relabel all filesystems, if necessary.
[DEPEND] Dependency failed for Migrate local... structure to the new structure.
How can I fix this?
This requires the user to LISH in and edit /etc/fstab
to get normal ssh access. This can be done a few ways:
1. Add nofail
:
/dev/disk/by-id/scsi-0Linode_Volume_test /mnt/test ext4 defaults,noatime,nofail 0 2
This will skip the wait if the drive was not found and allow a normal boot. This can be useful if you are regularly moving a Block Storage volume back and forth between Linodes.
2. Add noauto
:
/dev/disk/by-id/scsi-0Linode_Volume_test /mnt/test ext4 defaults,noatime,noauto 0 2
This will disable auto mounting at boot, so it won't search for the drive at boot, however, the drive will need to be mounted manually after boot if you need to use it.
3. Remove the drive’s /etc/fstab
entry entirely.
This is useful if you have no plans to re-attach the Block Storage volume to the Linode.