1

/dev/sdf is a 32G SD. As far as I can tell, I had performed the following, but upon attempting to perform the final step and write to a SD, my file image appears to be one byte to large for the SD. Is there any change the compression image somehow increased the size of the original image?

#inserted first SD in SD Reader and successfully wrote image to file
sudo dd bs=4M if=/dev/sdf of=pibackup.img

#inserted second SD in SD Reader and successfully wrote image to SD
sudo dd bs=4M if=pibackup.img of=/dev/sdf

gzip pibackup.img
//Might have been moved back and forth between servers using `scp`
gzip -d pibackup.img.gz

#inserted third SD in SD Reader but am unsuccessful writing image to SD
sudo dd bs=4M if=pibackup.img of=/dev/sdf

By unsuccessful, I mean the following: [Michael@devserver ~]$ sudo mount /dev/sdf7 /mnt mount: wrong fs type, bad option, bad superblock on /dev/sdf7, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

[Michael@devserver ~]$ dmesg | tail

DROP: IN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:78:24:af:ed:b7:58:08:00 SRC=192.168.1.1 DST=255.255.255.255 LEN=343 TOS=0x00 PREC=0x00 TTL=64 ID=63614 PROTO=UDP SPT=67 DPT=68 LEN=323
DROP: IN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:b4:b5:2f:12:aa:fa:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=70 PROTO=UDP SPT=68 DPT=67 LEN=308
DROP: IN=wlan0 OUT= MAC=b8:76:3f:69:31:95:78:24:af:ed:b7:58:08:00 SRC=192.168.1.1 DST=192.168.1.140 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=12658 PROTO=UDP SPT=67 DPT=68 LEN=308
EXT4-fs (sdf5): mounted filesystem with ordered data mode. Opts:
SELinux: initialized (dev sdf5, type ext4), uses xattr
EXT4-fs (sdf7): bad geometry: block count 7453824 exceeds size of device (7256064 blocks)
SELinux: initialized (dev sdf6, type vfat), uses genfs_contexts
SELinux: initialized (dev sdf1, type vfat), uses genfs_contexts
EXT4-fs (sdf7): bad geometry: block count 7453824 exceeds size of device (7256064 blocks)
EXT4-fs (sdf7): bad geometry: block count 7453824 exceeds size of device (7256064 blocks)
[Michael@devserver ~]$
  • Can't you just run the first command again to fetch the image again from the first SD card and then compare? Normally I would consider it a severe bug if gzip is not able to recreate the original file as an identical copy. Are you sure the third SD card is big enough? – Harald Jan 1 '18 at 16:55
  • If not for any fault from outside, gzip followed by gunzip delivers exactly the original contents. The only thing I can think of, aside from hardware faults is an automatically added file terminator. – Gyro Gearloose Jan 1 '18 at 16:58
  • @Harald The first SD is installed on a customer site. The 3rd SD card is the same type that previously worked. I think it is time for me to learn about shrinking partitions! – user1032531 Jan 1 '18 at 17:04
  • What do you mean by unsuccessful writing image to SD? What error messages do you see? – Andrew Henle Jan 1 '18 at 17:35
  • @AndrewHenle Please see edited initial post. – user1032531 Jan 1 '18 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.