How to get udev to identify a USB device regardless of the USB port it is plugged in?

I'd like to write a script that backups data on a USB device every time the latter is getting plugged in a random USB slot. Now I know about the KERNEL=sdX identifier but the problem is that depending on the slot and on whether other devices are already plugged in the sdX will change. What would be the best way to identify my USB device in udev ? I've been thinking about using partuuid but I don't know how and I don't know where the partuuid is stored in the first place or how it is worked out.


I've done something similar, using the UUID (Universally Unique Identifier library) of the USB device.

You can see UUIDs with blkid command:

# blkid

You can find more information about blkid, looking into it's man page

# man blkid

Category: udev Time: 2016-07-31 Views: 0
Tags: udev

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.162 (s). 12 q(s)