fwinans
unread,Feb 12, 2012, 1:26:31 AM2/12/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pick and MultiValue Databases
I don't use usb much, and can eyeball things ad hoc to find
devices I've just stuffed in, but once in a blue moon clients will
ambush me during an unrelated pick service call and give
me a pop quiz on how they can automatically detect usb
storage device insertion, and ask could I maybe spend 30
seconds or so to whip up some idiot-proof utility to help use
them. They absolutely insist on a quick answer, no research
on my part, and no billing to them about this off-the-cuff query.
So normally this is trivia I'd not bother keeping on file, but it just
so happens I recently saw all the relevent info at one time, and
have collected it here in one place after verifying it on three
servers I was visiting for other reasons. They were running
redhat linux rhel4, rhel5, and rhel5.4 so it seems widely useful.
Your given web page link was for a debian linux server, but yes,
the notes apply to redhat too, as it turns out.
{Stick in the usb device, say for example it becomes whole-device
name /dev/sdb and you use the first {and likely only} partition,
/dev/sdb1 then you'd do
blkid /dev/sdb1
For a specimen I have here, I get back, in part,
UUID="0C19-2368" from doing blkid /dev/sdb1
{Grrr, the lspci command is rubbish if you want to find UUID,
so instead of lspci use either
blkid /dev /sdb1
or /lib/udev/vol_id /dev/sdb1 }
lspci -v -v gave me, in part,
idVendor 0x13fe Kingston Technology Company Inc.
idProduct 0x1a00 512MB/1GB Flash Drive
bcdDevice 1.00
iManufacturer 1 Kingston
iProduct 2 DataTraveler 2.0
iSerial 3 5B7603927FAD
Whereas /lib/udev/vol_id /dev/sdb1 gave me
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=0C19-2368
ID_FS_LABEL=KINGSTON
ID_FS_LABEL_SAFE=KINGSTON
{Those KINGSTON labels both changed to FRED when I set up
/etc/mtools.conf file to assign MSDOS "d:" drive to
/dev/sdb1 then did mlabel d:
and when prompted supplied new label of
fred }
<< mlabel is dangerous -- with the -s flag it displays
current label but if you forget the -s
it displays then __erases__ the label
then prompts you for new one!!! Did you write
the
old one down? Are you relying on the old
label? >>
{Partiton is type vfat -- for a linux efs or efs2 filesys
I'd
have used tune2fs -L fred /dev/sdb1 to change the
label}
You can craft your line item in /etc/fstab file
replacing the plebian /dev/sb1 as first word with
UUID=0C19-2368 {in the case of my specimen device}
{no, you cannot use either "uuid" or "0c19-2368" instead}
I'd suggest relying on the filesystem label, since end-users could be
trained to change that after buying new devices. They may prefer
having a box of spare 'monday night media' devices all with label MON
for mounting on /media/MON/ or whatever. They'd rotate some
offsite,
and the rest of the box is for future monday-night backups. Scribble
'MON' on each one, and Bob's your uncle.
This is a label on the partition filesystem, not on the device as a
whole. On a winbox, properties of _that_partition_ shows this
label.
So then in fstab I'd use a line in with first word of
LABEL=KINGSTON {or now, LABEL=FRED} for my sample device.
I'm not sure UUID is immutable, graven in the hardware at the
factory. The man page for mke2fs notes UUID is stored in
superblock
at start of optionally external journal for the filesystem being made.
There is a linux command called uuid_generate
So UUID lives in a partition, instead of referring to whole physical
device.
I'd guess lsusb command's iSerial is the hardware
factory serial number, although iSerial is useless for fstab
purposes.