Showing posts with label usb. Show all posts
Showing posts with label usb. Show all posts

12 February 2025

Ensuring USB DVD order

As my USB dvd drives were being detected into a seemingly random order, I wanted to be able to control what device each was being assigned.


Adding udev rules

  • Find serials to add
    • sudo udevadm info /dev/sr0 | grep ID_SERIAL_SHORT
    • sudo udevadm info /dev/sr1 | grep ID_SERIAL_SHORT
    • sudo udevadm info /dev/sr2 | grep ID_SERIAL_SHORT
  • Create /etc/udev/rules.d/99-dvd.rules
ACTION="add", KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="first drive serial", SYMLINK+="dvd0"

ACTION="add", KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="second drive serial", SYMLINK+="dvd1"

ACTION="add", KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="third drive serial", SYMLINK+="dvd2"

  • Reboot or force rerunning the rules
    • sudo udevadm control --reload
    • sudo udevadm trigger
  • However, this did not work
  • Edit /etc/udev/rules.d/99-dvd.rules and remove the ACTION
KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="first drive serial", SYMLINK+="dvd0"

KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="second drive serial", SYMLINK+="dvd1"

KERNEL="sr[0-9]", ENV{ID_SERIAL_SHORT}="third drive serial", SYMLINK+="dvd2"

  • Reboot or force rerunning the rules
    • sudo udevadm control --reload
    • sudo udevadm trigger


Outcome

Success, it now creates the /dev/dvd* in a consistent order. Unfortunately, Handbrake still tries to use the /dev/sr* labels.


Appendix

Sources


14 September 2024

Adding a USB card to Dell r730xd

As I was tired of being limited to just 2 USB ports, I picked up the Inateck RedComets U21 20Gbps on Prime Day for $31.99 plus tax.


Specs

  • 2 lanes of PCIe 2.0/3.0/4.0 (3.0 or 4.0 required for full speed)
  • Max combined throughput 16 Gbps
  • 10 Gbps dedicated port
    • USB-A
  • 10 Gbps split between
    • 2 x USB-A
    • 2 x USB-C


Add USB Card

  • Shutdown containers and VMs
  • Turn off the server
  • Install the USB card
    • I installed it above the 2.5" drive bays in the back in Riser 3 (Slot 6)
  • Turn on the server
  • Fix fan speed
    • apt-get install ipmitool
    • ipmitool -I lanplus -H 192.168.1.X -U root -P <password> raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00
    • response:
      • 16 05 00 00 00
  • Shutdown the VM you want to add it to
  • Add the USB Card to a VM
    • Select your VM -> Hardware -> Add -> PCI Device
    • Select Raw Device -> Device: ASM2142/ASM3142 USB 3.1 Host Controller
    • Check All Functions
    • Add
  • Start the VM
  • Check that it is working
    • lsusb -t


Test a USB hard drive

  • plug in the USB hard drive
  • determine what drive letter it is:
    • ls -l /dev/disk/by-id
  • Mount it
    • sudo mount -m /dev/sdb1 /mnt/backup-plus
  • Error: unknown filesystem type 'exfat'
    • sudo apt-get install exfat-fuse
    • sudo mount /dev/sdb1 /mnt/backup-plus -t exfat-fuse


Appendix

Sources

09 December 2022

Ventoy: Ultimate Boot USB

I learned about Ventoy from ThioJoe on Youtube in this video. It is a bootable USB image that allows you to place ISOs on the drive and then choose which one to boot. This allows one USB drive to act as a master install/rescue/debug drive.

Linux Instructions:

  1. Download from github: https://github.com/ventoy/Ventoy/releases
  2. Extract
    • tar xvzf ventoy-*-linux.tar.gz
  3.  run Web UI
    • cd ventory-*/
    • sudo ./VentoyWeb.sh
  4. Use browser to go to http://127.0.0.1:<port>
    • Format the USB drive
    • WARNING: This will delete all data/files off the USB drive
  5. Refresh local drives
    • sudo partprobe
  6. Open the USB folder and copy in ISOs

What I put on the USB drive: