linuxbashsata

How to check for a drive's existence in Debian Linux


I have a Debian Linux server with two eSATA drives attached to it (NTFS, bleh). They are currently mounted fine and have proper fstab entries setup (using UUID, not /dev locations).

I've come to the conclusion that I need to add 'noauto' mount options so that they aren't mounted when the server boots (to prevent the server from hanging when they aren't present. I do plan on taking them on an occasional excursion).

However, how should I setup an init script to mount them once the system has booted? I could do a mount /mount/location, but I would prefer to check for their existence before doing that (to prevent an error from being thrown). Also, do I just need to throw this script into the /etc/init.d/ directory for it to work? (I'm fairly new to Debian)


Solution

  • blkid shows a list of block devices.