Udev - How to change device group?

5,770

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:

Share:
5,770

Related videos on Youtube

Rucent88
Author by

Rucent88

Updated on September 18, 2022

Comments

  • Rucent88
    Rucent88 over 1 year

    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?