# Different device name for usb disks

## fikiz

Hi all.

I just fu***d up my system writing an image file onto /dev/sda, just because one moment ago /dev/sda was the same usb drive on my Raspberry PI. #@!?£$@%(!$!"$@!!!!!!! I lost MBR, boot partition and one LVM logical volume; I'm still evaluating the damage size but this isn't (still) my question.

Is it possible to write an udev rule to name differently all usb storage devices? HDD, pendrives, enumerating their partitions too (possibly not usb dvd drives, /dev/sr0 is ok)? Could you help me to do that?

Thanks!

----------

## frostschutz

Those udev rules exist by default, have a look around in /dev/disk/.../...

For more descriptive names use labels, and partlabels (but have a care to give only unique label names)

----------

## fikiz

I know, but I'm looking for something like:

/dev/usba = first usb drive

/dev/usbb = second usb drive

just like /dev/sda and /dev/sdb are first and second storage device.

----------

## Naib

Its not as simple as that... 

USB is a hotswappable and thus the default /dev label is provided based upon detection. aspects of the USB hub startup can easily re-order w.r.t. USB what physical device is assigned a node.

This is why udev rules exist to latch onto UUID to assign specific node labels to specific devices, independent of the detection order

----------

## fikiz

I understand.

I'll try to make a habit going deep into /dev/disk/... when I'm doing these kind of things.

Anyway, if anybody had an idea, I'm listening  :Smile: 

Bye

----------

## Roman_Gruber

 *Quote:*   

> A universally unique identifier (UUID) is an identifier standard used in software construction. A UUID is simply a 128-bit value. The meaning of each bit is defined by any of several variants.

 

I think thats the reason why UUIDs exists

Well this issue exists since windi95 days. 

When i do critical things i run parted to verify on which disc i do changes.

There is no guarantee on how devices are numbered

----------

