We have moved to a new Sailfish OS Forum. Please start new discussions there.

Badblocks test

asked 2017-06-29 21:02:36 +0300

4dmonster gravatar image

My Jolla C has broken some regions of flash memory that is 'mmcblk0p28' . How can i test and mark bad blocks as there is no 'badblocks' program build in ?

edit retag flag offensive close delete


@4dmonster, you can use recovery mode for checking memory (option 4).

Info: for booting Jolla C into Recovery shutdown the phone, press&hold volume up key, turn on the phone and see "bla-bla-bla". Now connect the phone to USB-port of notebook (or computer) with Linux (it's the simplest way), open Terminal and type "telnet", press Enter.

Asmir ( 2017-06-29 22:50:57 +0300 )edit

that checking doesn't help. It totally fails if bad blocks were used by files or do nothing useful as there is no errors unless bad blocks touched.

4dmonster ( 2017-06-29 22:56:28 +0300 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-06-29 21:38:02 +0300

Maus gravatar image

updated 2017-06-30 20:12:30 +0300

On JP1301 /dev/mmcblk0p28 ist formatted with btrfs, on Jolla C probably ext4. Both filesystems aren't designed specifically for use on flash storage. Bad blocks management is nowadays a matter of the medium itself (hard disks re-map bad blocks without user interaction, flash storage does wear leveling in its firmware). While the badblocks program (that usually comes with Ted T'so's extXfs) made sense a couple of decades ago, and would theoretically be usable on a Jolla C, it is no longer advisable to use it in these days.

If you encounter read/write errors on modern media, replace them. In case of a phone's flash memory this unfortunately means you've got to replace the phone (unless you're really good at soldering or have too much money left). Those errors mean that internal mechanisms that cope with read/write errors don't work any more because there are just too many of those errors on the device.

edit flag offensive delete publish link more


On JollaC /dev/mmcblk0p28 is not ext4 or btrfs. It is lvm2. My phone has damaged internal flash memory. And some regions work fine. i wish Jolla to avoid using problem block.

4dmonster ( 2017-06-29 21:52:07 +0300 )edit

If only a single partition is exhibiting such behavior it might be possible to free up some space in the LVM volume group (by shrinking the EXT4 filesystems and then the logical volumes) and then removing the physical volume residing on the problematic partition.

MartinK ( 2017-06-30 00:02:42 +0300 )edit

You are right. My first problem is to locate bad areas. And i want to find something more useful than just create dummy files and wait when device fails into recovery.

4dmonster ( 2017-06-30 08:33:21 +0300 )edit

@4dmonster If storage on your Jolla C does not do flash cell wear leveling, you may have a chance with a badblocks-like method. With automatic wear leveling, there are no good blocks left for re-mapping and problems will get worse over time. One way or other, your device will be unreliable and you should backup your data and replace the phone.

There's a chance that your Jolla C firmware has lvm-tools installed. With tools like lvs, pvs and vgs you can look up on which LV /dev/mmcblk0p28 is used, and find out whether a badblocks-like strategy may work there. Good luck.

Maus ( 2017-06-30 10:22:44 +0300 )edit

@Maus, Jolla C firmware has installed lvm-tools. The good example of using this tools you can find HERE. It really works.

Asmir ( 2017-06-30 21:48:16 +0300 )edit
Login/Signup to Answer

Question tools

1 follower


Asked: 2017-06-29 21:02:36 +0300

Seen: 337 times

Last updated: Jun 30 '17