Applies to Platform: Mini ARM All
This lesson explains how to verify whether your micro SD card is corrupted.
Preliminaries
Connect via console to the Endian Mini ARM. If you don't know how to connect via console follow this guide.
Checking the SD card
You should use the command badblocks for this purpose, using the options -n (to specify that the check is carried out in read-write, non-destructive mode) and -v (verbose mode).
After establishing a connection via console, you see a screen like the one below. Type your root password, then press Enter. Right after, login to the bash console by typing the login command and providing again the root password.
e2fsck 1.42 (29-Nov-2011)
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
VAR: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
e2fsck: unable to set superblock flags on VAR
*** An error occurred during the file system check. *** Dropping you to a shell; the system will reboot *** when you leave the shell. Give root password for maintenance (or type Control-D to continue): (Repair filesystem) 1 # login login: root Password:
Make sure that the partitions you want to check are NOT mounted:
root@endian:~# mount
Warning
You can now check the partition on the SD card using the badblocks utility. During the test, if you see an output like the one shown below, then the micro SD is corrupt and you can stop the test with "CTRL+C". At the end of test you know how many badblocks there are in your micro SD. If you didn't see anyhing on the screen, then your micro SD card is in good condition!
root@endian:~# badblocks -n -v /dev/mmcblk0
Checking for bad blocks in non-destructive read-write mode
From block 0 to 3872255
Testing with random pattern: 0
1
2
3
4
5
6
7
Pass completed, 2756608 bad blocks found. (0/0/2756608 errors)
Ottima spiegazione step-by-step!