logo

What is udev?

Last Updated: 2024-07-23

udev = userspace /dev: /dev used to static, udev is for plugable devices running in userspace.

To be able to deal with peripheral devices that are hotplug-capable in a user-friendly way, a part of handling all of these hotplug-capable hardware devices was handed over from the kernel to a daemon running in user-space. Running in user space serves security and stability purposes.

udev primarily manages device nodes in the /dev directory. Unlike traditional Unix systems, where the device nodes in the /dev directory have been a static set of files, the Linux udev device manager dynamically provides only the nodes for the devices actually present on a system.

$ ps -e | grep udevd
    304 ?        00:00:00 systemd-udevd

udev is event driven: udev handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

Check attacked EBS(sda/sdf may be renamed to xvda/xvdf)

$ sudo fdisk -l
Disk /dev/xvda1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvda1 doesn't contain a valid partition table

Disk /dev/xvdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Format EBS

$ sudo mkfs -t ext4 /dev/xvdf

Edit fstab and reboot

$ vi /etc/fstab

or manually mount

# mkdir /mnt/tmp
# mount /dev/xvdf /mnt/tmp
# umount /dev/xvdf