这是WSL 的设计限制 + Windows 对 USB 的管理方式导致的,不是你系统坏了。
WSL(包括 Windows 11 的 Ubuntu 子系统)默认是“看不到”U 盘的块设备的。
❌ 看不到
/dev/sdX❌ 不能直接
mount /dev/sdb1✅ 只能通过Windows 挂载 → WSL 访问 Windows 文件系统
或使用usbipd把 USB 设备“直通”给 WSL2
一、为什么 WSL 识别不到 U 盘?
1️⃣ WSL2 不是完整物理 Linux
WSL2 架构是:Windows └─ Hyper-V 虚拟机(WSL2 Linux Kernel)
USB 控制器在 Windows
Linux 内核不直接接管 USB
所以:
/dev/sdb/dev/sdc/sys/block
👉默认不存在
2️⃣ Windows 已经“占用”了 U 盘
插 U 盘后:
Windows 会:
识别分区
自动挂载
分配盘符(如 E:)
👉这个设备已经被 Windows 独占
👉 WSL不能再直接访问
二、正确访问 U 盘的 3 种方式(推荐顺序)
✅ 方式 1(最推荐):通过 /mnt 访问 Windows 挂载的 U 盘
操作步骤
1️⃣先在 Windows 里插 U 盘
比如分配为
E:
2️⃣在 WSL 里访问
ls /mnt/e
优点
最稳定
不折腾权限
不破坏 Windows
缺点
❌ 不能做:
mkfsddsmartctl底层块设备操作
👉只适合文件读写
⚠️ 方式 2:usbipd 直通 U 盘到 WSL2(高级)
这是唯一能在 WSL 里看到
/dev/sdX的方式
适用场景
需要:
ddmkfs测试 U 盘
固件工具
烧录镜像
步骤(Windows 11)
1️⃣ 安装 usbipd
winget install usbipd
2️⃣ 插入 U 盘,查看设备
usbipd list
会看到类似:
BUSID VID:PID DEVICE 1-3 0781:558a SanDisk Ultra
3️⃣ 绑定到 WSL
usbipd bind --busid 1-3
usbipd attach --wsl --busid 1-3
4️⃣ 进入 WSL
lsblk
你现在就能看到:
sdb └─sdb1
⚠️ 注意(非常重要)
绑定后:
Windows无法再访问该 U 盘
用完要解绑:
usbipd detach --busid 1-3