USB驱动器操作问题:插入方法及编程恢复挂载已弹出的/dev/sdd
1. How to Insert a USB Drive?
- Ensure your device (laptop/server) is powered on and its USB ports are functional.
- Locate an available USB port (typically Type-A or Type-C). Pay attention to your drive's connector orientation—never force it if it doesn't fit smoothly.
- Gently push the USB drive into the port until you feel a slight click, indicating it's properly seated.
- On Linux systems, you can confirm the drive is recognized by running
dmesg | tailorlsblkin the terminal.
2. Programming Remount of USB Drive (/dev/sdd) Without Physical Access or Reboot
It sounds like your USB drive was marked as "removed" at the kernel level, even though it’s still physically connected. Since you can’t reboot or interact with the device directly, we’ll focus on triggering the kernel to re-enumerate the USB device. Here’s a step-by-step approach:
Step 1: Locate the USB Device & Controller
First, find the USB bus and device ID associated with your drive:
# List USB devices with their hierarchical structure lsusb -t # Or get a simplified list of connected USB devices lsusb
Look for entries matching your drive’s manufacturer or model. Note the bus and device number (e.g., Bus 002 Device 003 corresponds to the path /sys/bus/usb/devices/2-3).
Step 2: Rebind the USB Device
This forces the kernel to reset and re-recognize the device:
# Switch to root or use sudo for these commands sudo su # Unbind the device (replace "2-3" with your device's path suffix) echo -n "2-3" > /sys/bus/usb/drivers/usb/unbind # Wait 2-3 seconds, then rebind it echo -n "2-3" > /sys/bus/usb/drivers/usb/bind
Step 3: Rescan the Entire USB Bus (if rebinding fails)
If targeting the individual device doesn’t work, trigger a full rescan of the USB bus:
# Replace "usb2" with your target bus path (e.g., usb2 for Bus 002) echo 1 > /sys/bus/usb/devices/usb2/rescan
Step 4: Re-Read the Partition Table (if /dev/sdd reappears)
Once the kernel detects /dev/sdd again, force it to re-read the partition table:
partprobe /dev/sdd
You should then see /dev/sdd1 reappear, allowing you to mount it normally with mount /dev/sdd1 /mnt/your-mount-point.
Check Kernel Logs for Clues
If none of the above works, inspect kernel logs to identify enumeration or driver issues:
dmesg | grep -i usb
Look for error messages related to your device—this can help narrow down additional fixes.
内容的提问来源于stack exchange,提问作者Yeti

