我们正在尝试使用标准 dd 命令制作 Raspberry Pi 测试站的备份映像,但无法解决 IO 错误。dd 出现 IO 错误,ddrescue 出现未对齐错误,但 gparted 没有发现 USB 驱动器存在任何问题。系统正常启动和运行,所以我认为这与此线程建议的扇区大小定义有关。
如何确认这是一个扇区大小问题以及如何使用 gparted 纠正它?
- 三星 USB 32Gb 驱动器在 Raspberry Pi4 上运行 Ubuntu Mate 21.10
- 关闭 Pi,然后将它带到运行任何 Ubuntu 20x 的 i386 机器上
fdisk -l
Disk /dev/sdb: 29.88 GiB, 32080200192 bytes, 62656641 sectors
Disk model: Flash Drive FIT
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc0f11707
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 524287 522240 255M c W95 FAT32 (LBA)
/dev/sdb2 524288 62656607 62132320 29.6G 83 Linux
****************************************************************
sudo dd if=/dev/sdb of=server.img iflag=direct bs=16k status=progress
6248251392 bytes (6.2 GB, 5.8 GiB) copied, 363 s, 17.2 MB/s
dd: error reading '/dev/sdb': Input/output error
382013+0 records in
382013+0 records out
6258900992 bytes (6.3 GB, 5.8 GiB) copied, 416.203 s, 15.0 MB/s
****************************************************************
tester@OptiPlex-390:~/Downloads$ sudo ddrescue -d -f -r3 /dev/sdb test.img
test.logfile
GNU ddrescue 1.23
Press Ctrl-C to interrupt
ipos: 6259 MB, non-trimmed: 65536 B, current rate: 0 B/s
opos: 6259 MB, non-scraped: 0 B, average rate: 18408 kB/s
non-tried: 25821 MB, bad-sector: 0 B, error rate: 0 B/s
rescued: 6258 MB, bad areas: 0, run time: 5m 39s
pct rescued: 19.51%, read errors: 1, remaining time: 19m
time since last successful read: 0s
Copying non-tried blocks... Pass 1 (forwards)
Unaligned read error. Is sector size correct?