I currently use a raspberry-pi that I connect over with SSH, since it`s physical location is >100km far away. After running 1.5 years, it has now some I/O-errors when writing into the database. In the syslog, I found the following entries:
Jan 28 12:24:33 raspberrypi kernel: [ 1573.144567] print_req_error: I/O error, dev mmcblk0, sector 12371948
Jan 28 12:24:41 raspberrypi kernel: [ 1581.336573] print_req_error: I/O error, dev mmcblk0, sector 12371949
Jan 28 12:24:49 raspberrypi kernel: [ 1589.528572] print_req_error: I/O error, dev mmcblk0, sector 12371950
These entries are also listed in dmesg
.
The command df -l
gives:
Filesystem 1GB-blocks Used Available Use% Mounted on
/dev/root 32GB 6GB 25GB 18% /
devtmpfs 2GB 0GB 2GB 0% /dev
tmpfs 3GB 0GB 3GB 0% /dev/shm
tmpfs 3GB 1GB 3GB 1% /run
tmpfs 1GB 1GB 1GB 1% /run/lock
tmpfs 3GB 0GB 3GB 0% /sys/fs/cgroup
/dev/mmcblk0p1 1GB 1GB 1GB 21% /boot
tmpfs 1GB 0GB 1GB 0% /run/user/1001
So I guess, that mmcblk0p1
is my SD-card. However when listing dev
, I can see the following devices:mmcblk0 mmcblk0p1 mmcblk0p2
So:
- Is my SD-card really bricked? How can I doublecheck that?
- What exactly is
mmblk0
,mmcblk0p1
andmmcblk0p2
?
Raspi Info: Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
Edit: Logging fsck
at startup gives:
Jan 28 18:18:32 raspberrypi systemd-fsck[126]: e2fsck 1.44.5 (15-Dec-2018)
Jan 28 18:18:32 raspberrypi systemd-fsck[126]: Pass 1: Checking inodes, blocks, and sizes
Jan 28 18:18:44 raspberrypi systemd-fsck[126]: Pass 2: Checking directory structure
Jan 28 18:18:45 raspberrypi systemd-fsck[126]: Pass 3: Checking directory connectivity
Jan 28 18:18:46 raspberrypi systemd-fsck[126]: Pass 4: Checking reference counts
Jan 28 18:18:46 raspberrypi systemd-fsck[126]: Pass 5: Checking group summary information
Jan 28 18:18:46 raspberrypi systemd-fsck[126]: rootfs: 68411/1895552 files (0.5% non-contiguous), 1383640/7725184 blocks
Jan 28 18:18:46 raspberrypi systemd[1]: Started File System Check on Root Device.
Jan 28 18:18:48 raspberrypi systemd[1]: Starting File System Check on /dev/disk/by-partuuid/738a4d67-01...
Jan 28 18:18:49 raspberrypi systemd-fsck[253]: fsck.fat 4.1 (2017-01-24)
Jan 28 18:18:49 raspberrypi systemd-fsck[253]: /dev/mmcblk0p1: 232 files, 106929/516190 clusters
Jan 28 18:18:49 raspberrypi systemd[1]: Started File System Check on /dev/disk/by-partuuid/738a4d67-01.
Jan 28 18:19:19 raspberrypi systemd[1]: systemd-fsckd.service: Succeeded.
fsck
. Beyond that, you might check the SanDisk website for proprietary solutions. – Seamus Jan 28 '22 at 16:13fsck
is a test for filesystems. If the card is physically damaged and that corrupts the filesystem, fsck may fix the filesystem, but it cannot fix the card. Also, if the card is physically damaged but the filesystem is not corrupted (eg., because you just ranfsck
on it successfully),fsck
will tell you everything is 100% fine, because "everything" just refers to a filesystem (hence the OP's check did not reveal any problems). – goldilocks Jan 28 '22 at 20:14badblocks
on it may (or may not) mask the problem it will likely not last long. – goldilocks Jan 28 '22 at 20:14fsck
use addresses but these are offsets using filesystem based units). You can search the kernel source for bits of the error text when in doubt. I didn't, but I've been looking at these kinds of things for years and will call it 99.999% sure here == I'd bet a case of Islay magic elixir on this ;) – goldilocks Jan 28 '22 at 22:26