Ubuntu – Udev – How to change device group

devicespermissionsudevusb

By default, all hard drive and usb drive devices belong to group "disk". I want to change usb drives to group "adm".

I verified the ID_BUS

$ udevadm info -q all -n /dev/sdb | grep ID_BUS
E: ID_BUS=usb

I created the file /etc/udev/rules.d/70-persistent-usb.rules and insert the following

# Enable admin controls on all usb devices.
ID_BUS=="usb", GROUP="adm"

Lastly, I disconnected my usb drive and reconnected it. It is still showing

$ ll /dev/sdb
brw-rw---- 1 root disk 8, 16 Apr 14 19:31 /dev/sdb

The drive group is not "adm"? What am I doing wrong?

Best Answer

In the udevadm info output, you see the E prefix which is used for environment variables. You can match against it with:

ENV{ID_BUS}=="..."

If you are trying to make just USB devices writable, see this recent question on Unix.SE: