Tag: usb

Debian

Mount encrypted LUKS usb disk at boot

Find USB Disk UUID sudo blkidsudo blkid or e.g. sudo blkid /dev/sdg1 | awk -F ‘"’ ‘{print $4}’sudo blkid /dev/sdg1 | awk -F ‘"’ ‘{print $4}’ Edit crypttab file sudo nano /etc/crypttabsudo nano /etc/crypttab and add a new line entry such as: UUID=<name> UUID=<disk_uuid> <mount_point> <type>UUID=<name> UUID=<disk_uuid> <mount_point> <type> Example: sdg5_crypt UUID=123456789-1234-1234-1234-1234567890ab none lukssdg5_crypt UUID=123456789-1234-1234-1234-1234567890ab …

Debian

Automatically mount usb drive at startup

Find USB Disk UUID sudo blkidsudo blkid or sudo blkid /dev/sdf1 | awk -F ‘"’ ‘{print $4}’sudo blkid /dev/sdf1 | awk -F ‘"’ ‘{print $4}’ Edit fstab file sudo nano /etc/fstabsudo nano /etc/fstab and add a new line entry such as: UUID=<disk_uuid> <mount point> <type> <options> <dump> <pass>UUID=<disk_uuid> <mount point> <type> <options> <dump> <pass> Example: …

Linux

List USB devices in Linux

1. Open terminal 2. Issue the following command: lsusblsusb Other options: -v, –verbose Increase verbosity (show descriptors) -s [[bus]:][devnum] Show only devices with specified device and/or bus numbers (in decimal) -d vendor:[product] Show only devices with the specified vendor and product ID numbers (in hexadecimal) -D device Selects which device lsusb will examine -t Dump …

C#

Get USB information in C#

We will see how we can retrieve various information about usb devices in C#. We need the class ManagementObjectSearcher and Win32_DiskDrive class. To use this class we have to add a reference to System.Management namespace. and now.. the interesting part: 1 2 3 4 5 6 7 8 9 10 ManagementObjectSearcher theSearcher = new ManagementObjectSearcher("SELECT …