We are trying to make backup images of our Raspberry Pi test stations using the standard dd command but can not get past an IO error. dd has an IO error and ddrescue has a unaligned error but gparted does not see any issues with the USB drive. The system boots and runs normally so I'm thinking it has something to do with sector size definitions as suggested by this thread.
Misaligned partition
How can confirm this a sector size issue and how would I correct it with gparted?
- Samsung USB 32Gb drive running Ubuntu Mate 21.10 on a Raspberry Pi4
- Shut down the Pi and bring the stick over to a i386 machine running any Ubuntu 20x
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?