[sclug] How to find which /dev/xxx a usb device is on?

Andy Hayward ach at buteo.org
Sat Jun 21 16:05:14 UTC 2008


2008/6/21 John Stumbles <sclug at yaph.org.uk>:
> I'm trying to script mounting usb devices such as digicam memory cards
> and a USB external HDD. The digicam card script has a horrible kludge of
> code like: 'try /dev/sdc1 ... sdd1? ... sde1? ...' etc until it finds
> where the card has popped up on.
>
> I've now got an external hdd for backup which needs to be mounted
> (ideally on bootup but it's encrypted so couldn't go in fstab anyway (or
> could it?)).
>
> Before I redo the 'try this/try that' code can anyone suggest a better way?

Mount using the filesystem UUID instead of giving the device.

-- ach



More information about the Sclug mailing list