Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

HATs and other add-ons • Re: Raspberry Pi Flash Drive 256GB

$
0
0
I bought one of the 128GB ones, and on my Ubuntu desktop machine, the USB vendor ID seems to resolve to the name "General" rather than "Raspberry Pi". Perhaps my usb.ids database is out of date? Is this the first ID the Raspberry Pi Foundation has officially registered?

Also, SU_BEMOMYRAB_R sure is a strange name. That name just makes me think of lame "mom" jokes.

On my Ubuntu desktop, udevadm info says:

Code:

P: /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2.1/2-2.1:1.0/host9/target9:0:0/9:0:0:0/block/sdbM: sdbJ: b8:16U: blockT: diskD: b 8:16N: sdbL: 0S: disk/by-id/ata-SU_BEMOMYRAB_R_0374200000015052S: disk/by-diskseq/42S: disk/by-id/usb-General_USB_Flash_Drive_03742000055E-0:0S: disk/by-path/pci-0000:00:14.0-usb-0:2.1:1.0-scsi-0:0:0:0S: disk/by-path/pci-0000:00:14.0-usbv3-0:2.1:1.0-scsi-0:0:0:0Q: 42E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2.1/2-2.1:1.0/host9/target9:0:0/9:0:0:0/block/sdbE: SUBSYSTEM=blockE: DEVNAME=/dev/sdbE: DEVTYPE=diskE: DISKSEQ=42E: MAJOR=8E: MINOR=16E: USEC_INITIALIZED=7952294112E: ID_ATA=1E: ID_TYPE=diskE: ID_BUS=ataE: ID_MODEL=SU_BEMOMYRAB_RE: ID_MODEL_ENC=SU_BEMOMYRAB\x20RE: ID_REVISION=V1.0.4C1E: ID_SERIAL=SU_BEMOMYRAB_R_0374200000015052E: ID_SERIAL_SHORT=0374200000015052E: ID_ATA_WRITE_CACHE=1E: ID_ATA_WRITE_CACHE_ENABLED=1E: ID_ATA_READ_LOOKAHEAD=1E: ID_ATA_READ_LOOKAHEAD_ENABLED=1E: ID_ATA_FEATURE_SET_PM=1E: ID_ATA_FEATURE_SET_PM_ENABLED=1E: ID_ATA_FEATURE_SET_SMART=1E: ID_ATA_FEATURE_SET_SMART_ENABLED=1E: ID_ATA_DOWNLOAD_MICROCODE=1E: ID_ATA_SATA=1E: ID_ATA_ROTATION_RATE_RPM=0E: ID_ATA_PERIPHERAL_DEVICE_TYPE=0E: ID_USB_MODEL=USB_Flash_DriveE: ID_USB_MODEL_ENC=USB\x20Flash\x20Drive\x20E: ID_USB_MODEL_ID=0030E: ID_USB_SERIAL=General_USB_Flash_Drive_03742000055E-0:0E: ID_USB_SERIAL_SHORT=03742000055EE: ID_USB_VENDOR=GeneralE: ID_USB_VENDOR_ENC=General\x20E: ID_USB_VENDOR_ID=2e8aE: ID_USB_REVISION=1100E: ID_USB_TYPE=diskE: ID_USB_INSTANCE=0:0E: ID_USB_INTERFACES=:080650:080662:E: ID_USB_INTERFACE_NUM=00E: ID_USB_DRIVER=uasE: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv3-0:2.1:1.0-scsi-0:0:0:0E: ID_PATH=pci-0000:00:14.0-usb-0:2.1:1.0-scsi-0:0:0:0E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_2_1_1_0-scsi-0_0_0_0E: ID_PART_TABLE_UUID=d0ac8467-8939-4106-ba7e-fbff676ac896E: ID_PART_TABLE_TYPE=gptE: NVME_HOST_IFACE=noneE: DEVLINKS=/dev/disk/by-id/ata-SU_BEMOMYRAB_R_0374200000015052 /dev/disk/by-diskseq/42 /dev/disk/by-id/usb-General_USB_Flash_Drive_03742000055E-0:0 /dev/disk/by-path/pci-0000:00:14.0-usb-0:2.1:1.0-scsi-0:0:0:0 /dev/disk/by-path/pci-0000:00:14.0-usbv3-0:2.1:1.0-scsi-0:0:0:0E: TAGS=:systemd:E: CURRENT_TAGS=:systemd:
I intend to use it on an OpenWrt x86 machine as a secondary disk in place of an RTL9210B enclosure.
There's no udev in OpenWrt, so I made a simple hotplug.d script for it.

/etc/hotplug.d/block/10-trim

Code:

#!/bin/shif [ "$ACTION" == "add" ] && [ "$DEVTYPE" == "disk" ]; then        block_dir="/sys$DEVPATH"        dev_dir="$(readlink -f $block_dir/device)"        # use awk to trim trailing spaces        vendor="$(cat $dev_dir/vendor | awk '{$1=$1};1')"        model="$(cat $dev_dir/model | awk '{$1=$1};1')"        rev="$(cat $dev_dir/rev | awk '{$1=$1};1')"        provisioning_mode=""        discard_max_bytes=""        if [ "$vendor" == "General" -o "$vendor" == "Raspberry Pi" ] && [ "$model" == "USB Flash Drive" ] && [ "$rev" == "1100" ]; then                provisioning_mode="unmap"                discard_max_bytes="1073741824"        fi        if [ "$vendor" == "LSY M.2" ] && [ "$model" == "9210B" ]; then                provisioning_mode="unmap"                discard_max_bytes="1073741824"        fi        if [ -n "$provisioning_mode" ] && [ -n "$discard_max_bytes" ]; then                scsi_addr="$(basename $dev_dir)"                scsi_dir="$dev_dir/scsi_disk/$scsi_addr"                echo "$provisioning_mode" > "$scsi_dir/provisioning_mode"                echo "$discard_max_bytes" > "$block_dir/queue/discard_max_bytes"        fifi
For reference, the block hotplug script on the OpenWRT machine doesn't receive the USB ID:

Code:

ACTION=addDEVICENAME=sdcDEVNAME=sdcDEVPATH=/devices/pci0000:00/0000:00:15.0/usb2/2-1/2-1.4/2-1.4:1.0/host2/target2:0:0/2:0:0:0/block/sdcDEVTYPE=diskHOTPLUG_TYPE=blockMAJOR=8MINOR=32SUBSYSTEM=block

Statistics: Posted by UnicodeFiend — Wed Feb 04, 2026 6:20 am



Viewing all articles
Browse latest Browse all 8093

Trending Articles