![mkusb:无目标设备或目标设备损坏](https://linux22.com/image/1169307/mkusb%EF%BC%9A%E6%97%A0%E7%9B%AE%E6%A0%87%E8%AE%BE%E5%A4%87%E6%88%96%E7%9B%AE%E6%A0%87%E8%AE%BE%E5%A4%87%E6%8D%9F%E5%9D%8F.png)
我正在尝试运行mkusb
创建 USB 设备以便在其上安装带有持久存储的 Live Ubuntu,并且我得到了No target device or bad target device
。
以下是会议记录:
mkusb
---------------------------------------------------------------------
Usage: mkusb [input-file] # optional parameter
---------------------------------------------------------------------
d: dus , guidus, mkusb-dus - New, easy to use
e: Eleven, sudo -H mkusb-11 - Classic user interface
n: NoX, sudo mkusb-nox - original text mode
b: Bas, sudo mkusb-bas - basic text mode for old/basic linux
q: Quit
---------------------------------------------------------------------
Select version of mkusb (d/e/n/b/q) d
dus 12.3.7
live system or temporary superuser permissions
source device: /dev/sdb4 'live system or temporary superuser permissions'
Drive that contains source file: /dev/sdb
Live drive, that is booted from: /dev/sdb
cands=2
931.5G
931.5G
built-in device
sde
SanDisk_Cruzer_Glide
14.6G
usb
USB or memory card
p_target: target=/dev/14.6G
No target device or bad target device
p_clean:
live system or temporary superuser permissions
我究竟做错了什么?
附加信息:
- 跑步
sudo lsblk -o model,name,size,fstype,model,mountpoint /dev/sdb
输出:
MODEL NAME SIZE FSTYPE MODEL MOUNTPOINT
Ultra Fit sdb 57.3G Ultra Fit
├─sdb1 13.2G ntfs /media/ubuntu/usbdata1
├─sdb2 1M
├─sdb3 244M vfat
├─sdb4 2G iso9660 /cdrom
└─sdb5 41.9G ext4 /media/ubuntu/casper-rw
- 跑步
df -h
输出:
Filesystem Size Used Avail Use% Mounted on
udev 2.8G 0 2.8G 0% /dev
tmpfs 576M 1.7M 575M 1% /run
/dev/sdb4 2.0G 2.0G 0 100% /cdrom
/dev/loop0 1.9G 1.9G 0 100% /rofs
/cow 42G 13G 27G 32% /
tmpfs 2.9G 135M 2.7G 5% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
tmpfs 2.9G 0 2.9G 0% /tmp
/dev/loop1 89M 89M 0 100% /snap/core/7396
/dev/loop2 55M 55M 0 100% /snap/core18/1144
/dev/loop3 90M 90M 0 100% /snap/core/7917
/dev/loop4 128K 128K 0 100% /snap/hello-world/29
/dev/loop5 55M 55M 0 100% /snap/core18/1192
/dev/loop6 43M 43M 0 100% /snap/gtk-common-themes/1313
/dev/loop7 45M 45M 0 100% /snap/gtk-common-themes/1353
tmpfs 576M 28K 576M 1% /run/user/999
/dev/sdb5 42G 13G 27G 32% /media/ubuntu/casper-rw
/dev/sdb1 14G 2.6G 11G 20% /media/ubuntu/usbdata1
/dev/sde4 2.0G 2.0G 0 100% /media/ubuntu/Ubuntu 18.04.3 LTS amd64
/dev/sde5 6.1G 1.1G 4.8G 19% /media/ubuntu/casper-rw1
/dev/sde1 6.2G 33M 6.2G 1% /media/ubuntu/usbdata2
答案1
您需要编辑该文件
gedit /usr/bin/dus
并找到函数 驱动器列表
我有 1168 行
该函数使用命令
ls -l /dev/drive/by-id
看起来像这样
root 9 02-06 14:24 usb-Samsung_Flash_01856-0:0 -> ../../sdb
root 10 02-06 14:24 usb-Samsung_Flash_01856-0:0-part1 -> ../../sdb1
驱动器列表将任何空格转换为制表符,但不会对双倍空格执行此操作
root 9 -double space-
root 10
我们必须添加一个命令来执行此操作,否则这将是一个糟糕的削减
p_target: target=/dev/14.6G -bad cut-
我对其进行了修改,因此我只分析了这个片段,以保留作者的想法,并且对 Debian 11 进行了一项测试。
以下是我所做的更改
1681-1682 行
ls -l /dev/disk/by-id |grep $i$ |grep -m1 'nvme-[A-Z]' |tr -s ' ' '\t' | tr -s ' ' '\t' \
|cut -f8,10|sed -e 's#../../##' |tr '\n' '\t'
1684-1685 行
ls -l /dev/disk/by-id |grep -v ^wwn|grep -m1 $i$ |tr -s ' ' '\t' | tr -s ' ' '\t' \
|cut -f8,10|sed -e 's#../../##' |tr '\n' '\t'
可以取消注释 lini 1689-1690
echo "byid:"
cat "$byid"
我现在很好
wipe the first Mibibyte
Live drive, that is booted from: /dev/nvme0n1
byid:
ata-HGST_HTS721010A9E630_JR100X4M0NM5HE sda 931,5G
usb-Samsung_Flash_Drive_FIT_0306818100001856-0:0 sdb 59,8G
nvme-Samsung_SSD_960_EVO_250GB_S3ESNX0JB43605R nvme0n1 232,9G
cands=2
sda
HGST_HTS721010A9E630
931,5G
ata
built-in device
sdb
Samsung_Flash_Drive_FIT
59,8G
usb
USB or memory card
p_target: target=/dev/sdb