Well, I got a pendrive that I want to be automounted on my Raspberry Pi. Simple as hell. Do an $ lsblk command. Find the drive name. Mine was /dev/sda1.
I edited the /etc/fstab file to automount it at boot
/dev/sda1 /mnt/externaldrive auto defaults 0 0
Problem is that when the pendrive was not on the raspberry pi, the latter would refuse to boot properly. Even the WiFi or ethernet doesn’t work. Had to actually plug in my TV’s HDMI cable to view the boot error messages.
Some googling after, found this page: http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
Edited my /etc/fstab like this now. Notice the nofail option.
/dev/sda1 /mnt/externaldrive auto nofail,auto 0 0
Now I can boot with either a pendrive in or not. 😉