Update:
Performing the same process on a Raspberry Pi 4 - 4g, returns the same results:
Viz:
Using a USB to microSD adapter dongle:
- (copying Raspbian Bullseye using ddrescue)
root@rsync:/home/pi/Downloads/Test_Images# ddrescue -vv --force -c 4096 ./2021-10-30-raspios-bullseye-armhf.img /dev/sda
GNU ddrescue 1.23
About to copy 3972 MBytes from './2021-10-30-raspios-bullseye-armhf.img' (3972005888) to '/dev/sda' [UNKNOWN] (63864569856)
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 4096 sectors Initial skip size: 128 sectors
Sector size: 512 Bytes
Direct in: no Direct out: no Sparse: no Truncate: no
Trim: yes Scrape: yes Max retry passes: 0
Press Ctrl-C to interrupt
ipos: 3969 MB, non-trimmed: 0 B, current rate: 2097 kB/s
opos: 3969 MB, non-scraped: 0 B, average rate: 11580 kB/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 3972 MB, bad areas: 0, run time: 5m 42s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: n/a
Finished
- (checking Raspbian Bullseye using e2fsck)
root@rsync:/home/pi/Downloads/Test_Images# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
111295 inodes used (49.29%, out of 225792)
145 non-contiguous files (0.1%)
120 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 93246/2
758303 blocks used (83.96%, out of 903168)
0 bad blocks
1 large file
84051 regular files
9002 directories
8 character device files
0 block device files
0 fifos
1363 links
18225 symbolic links (18031 fast symbolic links)
0 sockets
------------
112649 files
- (copying GoPiGo O/S 3.0.1 using ddrescue)
root@rsync:/home/pi/Downloads/Test_Images# ddrescue -vv --force -c 4096 ./GoPiGo_OS_3.0.1_.img /dev/sda
GNU ddrescue 1.23
About to copy 10968 MBytes from './GoPiGo_OS_3.0.1_.img' (10968104960) to '/dev/sda' [UNKNOWN] (63864569856)
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 4096 sectors Initial skip size: 256 sectors
Sector size: 512 Bytes
Direct in: no Direct out: no Sparse: no Truncate: no
Trim: yes Scrape: yes Max retry passes: 0
Press Ctrl-C to interrupt
ipos: 10966 MB, non-trimmed: 0 B, current rate: 6291 kB/s
opos: 10966 MB, non-scraped: 0 B, average rate: 11330 kB/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 10968 MB, bad areas: 0, run time: 16m 7s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: n/a
Finished
- (checking GoPiGo O/S 3.0.1 using e2fsck)
root@rsync:/home/pi/Downloads/Test_Images# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
rootfs: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Directory inode 411067, block #0, offset 0: directory corrupted
Salvage<y>? no
e2fsck: aborted
rootfs: ********** WARNING: Filesystem still has errors **********
root@rsync:/home/pi/Downloads/Test_Images#
Using a multi-card reader:
- (copying Raspbian Bullseye using ddrescue)
root@rsync:/home/pi/Downloads/Test_Images# ddrescue -vv --force -c 4096 ./2021-10-30-raspios-bullseye-armhf.img /dev/sda
GNU ddrescue 1.23
About to copy 3972 MBytes from './2021-10-30-raspios-bullseye-armhf.img' (3972005888) to '/dev/sda' [UNKNOWN] (63864569856)
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 4096 sectors Initial skip size: 128 sectors
Sector size: 512 Bytes
Direct in: no Direct out: no Sparse: no Truncate: no
Trim: yes Scrape: yes Max retry passes: 0
Press Ctrl-C to interrupt
ipos: 3969 MB, non-trimmed: 0 B, current rate: 16777 kB/s
opos: 3969 MB, non-scraped: 0 B, average rate: 14035 kB/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 3972 MB, bad areas: 0, run time: 4m 43s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: 0s
Finished
- (checking Raspbian Bullseye using e2fsck)
root@rsync:/home/pi/Downloads/Test_Images# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
111295 inodes used (49.29%, out of 225792)
145 non-contiguous files (0.1%)
120 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 93246/2
758303 blocks used (83.96%, out of 903168)
0 bad blocks
1 large file
84051 regular files
9002 directories
8 character device files
0 block device files
0 fifos
1363 links
18225 symbolic links (18031 fast symbolic links)
0 sockets
------------
112649 files
root@rsync:/home/pi/Downloads/Test_Images#
- (copying GoPiGo O/S 3.0.1 using ddrescue)
root@rsync:/home/pi/Downloads/Test_Images# ddrescue -vv --force -c 4096 ./GoPiGo_OS_3.0.1_.img /dev/sda
GNU ddrescue 1.23
About to copy 10968 MBytes from './GoPiGo_OS_3.0.1_.img' (10968104960) to '/dev/sda' [UNKNOWN] (63864569856)
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 4096 sectors Initial skip size: 256 sectors
Sector size: 512 Bytes
Direct in: no Direct out: no Sparse: no Truncate: no
Trim: yes Scrape: yes Max retry passes: 0
Press Ctrl-C to interrupt
ipos: 10966 MB, non-trimmed: 0 B, current rate: 6291 kB/s
opos: 10966 MB, non-scraped: 0 B, average rate: 13557 kB/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 10968 MB, bad areas: 0, run time: 13m 28s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: n/a
Finished
root@rsync:/home/pi/Downloads/Test_Images#
- (checking GoPiGo O/S 3.0.1 using e2fsck)
root@rsync:/home/pi/Downloads/Test_Images# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
rootfs: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Inode 16322 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 32238 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 32477 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 48436 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 132283 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 141808 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 158505 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 389571 extent tree (at level 1) could be shorter. Optimize<y>? no
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
318514 inodes used (49.47%, out of 643840)
1266 non-contiguous files (0.4%)
232 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 298299/376
2318995 blocks used (88.81%, out of 2611200)
0 bad blocks
1 large file
253229 regular files
45247 directories
7 character device files
0 block device files
0 fifos
1214 links
20021 symbolic links (19823 fast symbolic links)
1 socket
------------
319719 files
root@rsync:/home/pi/Downloads/Test_Images#
I have not done an exhaustive test as the results are already exactly the same.
-
Final test:
I am going to re-copy GoPiGo O/S 3.0.1 to the SD card and then use tune2fs to force a fsck on reboot, (by setting a maximum mount count and then setting the current mount count to a larger value. After rebooting and initializing, I will retest as above.
-
(Copying GoPiGo O/S 3.0.1 using ddrescue)
root@rsync:/home/pi/Downloads/Test_Images# ddrescue -vv --force -c 4096 ./GoPiGo_OS_3.0.1_.img /dev/sda
GNU ddrescue 1.23
About to copy 10968 MBytes from './GoPiGo_OS_3.0.1_.img' (10968104960) to '/dev/sda' [UNKNOWN] (63864569856)
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 4096 sectors Initial skip size: 256 sectors
Sector size: 512 Bytes
Direct in: no Direct out: no Sparse: no Truncate: no
Trim: yes Scrape: yes Max retry passes: 0
Press Ctrl-C to interrupt
ipos: 10966 MB, non-trimmed: 0 B, current rate: 12582 kB/s
opos: 10966 MB, non-scraped: 0 B, average rate: 13744 kB/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 10968 MB, bad areas: 0, run time: 13m 18s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: 0s
Finished
root@rsync:/home/pi/Downloads/Test_Images#
- (Forcing a fsck on reboot using tune2fs - “c” sets max mounts before fsck is forced and “C” sets the current mount count.)
root@rsync:/home/pi/Downloads/Test_Images# tune2fs -c 5 -C 6 /dev/sda2
tune2fs 1.44.5 (15-Dec-2018)
Recovering journal.
Setting maximal mount count to 5
Setting current mount count to 6
root@rsync:/home/pi/Downloads/Test_Images#
(Notice it “recovered the journal”.)
- (Rebooting in a Pi-4 and then re-testing with a USB to microSD dongle)
root@rsync:/home/pi# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Directory inode 411067, block #0, offset 0: directory corrupted
Salvage<y>? no
e2fsck: aborted
rootfs: ********** WARNING: Filesystem still has errors **********
root@rsync:/home/pi#
- (Retesting with a multi-card reader)
root@rsync:/home/pi# e2fsck -fDv /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Inode 16322 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 32238 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 32477 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 48436 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 132283 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 141808 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 158505 extent tree (at level 1) could be shorter. Optimize<y>? no
Inode 389571 extent tree (at level 1) could be shorter. Optimize<y>? no
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
318509 inodes used (8.35%, out of 3814752)
1266 non-contiguous files (0.4%)
232 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 298295/376
2518949 blocks used (16.22%, out of 15525376)
0 bad blocks
1 large file
253230 regular files
45242 directories
7 character device files
0 block device files
0 fifos
1214 links
20020 symbolic links (19822 fast symbolic links)
1 socket
------------
319714 files
root@rsync:/home/pi#
Short of disassembling my card readers and dongles to look up the chips used, (and see what limitations they might have), I do not understand the significance of this difference. I have also searched the various Fountains of Wisdom on the Web with no joy. (Possibly because it appears to be limited to these particular operating systems.)
I also doubt I would find anything interesting because everything else has no difficulties whatsoever.
Obviously when the card is booted from the SD slot the system “passes” fsck, otherwise it would panic and halt.
I am at a loss here. . . .
Since I don’t know what this means, I have no choice but to assume a worst-case scenario and avoid the GoPiGo O/S releases until I know otherwise.
What say ye?
P.S.
Before anyone asks, I have tried this with several different microSD cards of varying sizes, and the results are always the same.
P.P.S.
Cleaning up the inode lengths does not affect subsequent retests on a USB dongle.
Attempting to “salvage” the corrupted directory inode results in the entire image being magically transformed into a quivering lump of GAGH!