Project

General

Profile

FixCorruptedUserDataPartition » History » Version 6

Denis 'GNUtoo' Carikli, 04/27/2021 01:36 PM
start adding commands to fix it (TODO: actually test the commands)

1 1 Denis 'GNUtoo' Carikli
h1. FixCorruptedUserDataPartition
2
3
h2. Warnings
4
5
This tutorial is a work in progress. Remove this warning when it will be tested (and somehow indicate on which devices it was tested on).
6
7
h2. Tutorial
8
9
h3. Compatible devices
10
11
Only the following devices that are supported by Replicant are supported by this tutorial:
12
* [[GalaxyS2I9100|Galaxy S II (GT-I9100)]]
13
14
h3. Setup ADB
15
16
Follow the instructions for [[ADB|setting up ADB on your computer]] so that you can access a root shell on your device.
17
18
*NOTE*: when prompted on your Replicant device, make sure that you check the box that says *Always allow from this computer* when you grant your computer USB debugging permissions. Otherwise, you will be unable to obtain root shell access on your Replicant device when you reboot it into the recovery OS to actually perform the backup.
19
20
*NOTE*: for security reasons, you may want to [[ADB#Revoking-all-computers-USB-debugging-permissions|revoke these non-expiring permissions]] once the backup is complete.
21
22
h3. Reboot into the recovery
23
24
To reboot in the recovery, you can follow the instructions in the [[RebootIntoTheRecovery]] wiki page.
25
26
h3. Get the user data partition
27
28 2 Denis 'GNUtoo' Carikli
First we need to find the real path of the partition. On the Galaxy SII (GT-I9100) we can use the following command:
29
<pre>
30 3 Denis 'GNUtoo' Carikli
adb shell "realpath /dev/block/platform/dw_mmc/by-name/UMS"
31 2 Denis 'GNUtoo' Carikli
</pre>
32
33
On my device it gave me the following result: @/dev/block/mmcblk0p11@
34
35 4 Denis 'GNUtoo' Carikli
To download it you can use the following command:
36
<pre>
37
adb pull /dev/block/mmcblk0p11 ./mmcblk0p11.img
38
</pre>
39
40 5 Denis 'GNUtoo' Carikli
Note that this can take hours as the partition is usually quite big. You will also need to have the space to store it.
41
42
As it takes most of the space in the internal storage already, make sure to have at least as much space as the device internal storage size. For instance if the internal storage size is 16G, you will need at least 16G of free space (computers tend to slowly use space with things like logs and so on so it's a good idea to have a bit more space than needed).
43
44 1 Denis 'GNUtoo' Carikli
h3. Fix it
45
46 6 Denis 'GNUtoo' Carikli
First verify which filesystem you have:
47
<pre>
48
file mmcblk0p11.img
49
</pre>
50
51
If the filesystem is a vfat filesystem and that it is damaged, you can try to repair it with the following command:
52
<pre>
53
fsck.vfat -a -w mmcblk0p11.img
54
</pre>
55
56
If you want to recreate it from scratch (your data will be lost) you can do the following:
57
<pre>
58
fsck.vfat -a -w mmcblk0p11.img
59
</pre>
60
61
62 1 Denis 'GNUtoo' Carikli
h3. Put it back
63
64
h3. Reboot