Using the 21.10 Mate Pi image we created a 32Gb USB device to boot and run Ubuntu on our test station using balenaEtcher. Everything works extremely well.
Shutting down the Pi we remove the USB stick to make a backup image of the test station using a i386 PC running Ubuntu Mate. During the process we receive an error reading the device. This also happens trying to use dd in a virtual machine running the latest Ubuntu. Tried running ddrescue on the USB device to create an image thinking there was an actual read error but this also failed with a Unaligned read error.
Then resorted to using gparted to examine the device. Looking at the USB drive with gparted the sectors seemed aligned as they are divisible by eight.
Is there something special that needs to be done when creating a Mate Pi USB drive so that we can back up the system? We posted this question over in Ask Ubuntu but have gotten no responses. Any help resolving this would be appreciated.
Update: Using Ubuntu Disk Image Writer we took the Ubuntu Mate Pi image and wrote it to a different Samsung 32Gb USB drive. Brought up the Pi and loaded necessary packages to run the test station. We were able to back up that drive using dd on a VMWare virtual machine(Standard Ubuntu i386.) After running the Pi test station for a day we attempted to back it up. dd is failing with Input/output error again but in a different spot. The original USB failed @ the 6.3 GB mark but the new USB drive is consistently failing @ the 9.3 GB mark. The second USB shows no errors running a file system check.
sudo dd if=/dev/sdb of=/mnt/hgfs/temp_2/generic_test_station_25_Feb_2022.img bs=32k status=progress
9334231040 bytes (9.3 GB, 8.7 GiB) copied, 266 s, 35.1 MB/s
dd: error reading '/dev/sdb': Input/output error
284858+1 records in
284858+1 records out
9334231040 bytes (9.3 GB, 8.7 GiB) copied, 265.78 s, 35.1 MB/s
Is using dd a necessity? I ask because when I think of "disk imaging and restoring" I turn to Disks which MATE comes with. Even if dd is necessary you might want to try Disks to see if it will work or not and provide more info.
We were using dd as a standardized way to back up the test stations. We back the station up using dd and then take the output image and shrink it using using the pishrink shell. This leaves us with a complete backup image that is only about 8Gb in size.
You are seeing the system Pi running. When you shut down the Pi and bring the USB stick over to the Ubuntu VM, once it's mounted it becomes /dev/sdb. If you wanted to see the lsblk command when it is not the running drive I can do that.
John, I don't see any fault with what you're doing. I understand that when system is running disk is sda, when offline and usb inserted, disk becomes sdb. The generic error dd: error reading '/dev/sdb': Input/output error implies something wrong with the usb stick.
I would agree that initially it looks like a disk error but this has happened on two different USB sticks where one had no issues at all at first. Disk checks find no errors on the USB drives and using ddrescue kicks out a "Unaligned read error. Is sector size correct?".
I was hoping that some other type of disk utility could explain why dd is having issues with this as we have used dd in the past two years without issue.