Accessing /dev/block/dm-2 with write access - Android Q&A, Help & Troubleshooting

I'm using a Xiaomi Redmi Note 9S with MIUI 11.0.10 which is Android 10. There seems to be some bug with root that can soft-brick your phone. When you boot into TWRP, it can no longer mount the System partition - pressing it, will do nothing.
So I connect via adb to the phone. It's root adb and I am root according to "whoami".
cat /proc/partitions output:
Code:
~ # cat /proc/partitions
major minor #blocks name
1 0 8192 ram0
1 1 8192 ram1
1 2 8192 ram2
1 3 8192 ram3
1 4 8192 ram4
1 5 8192 ram5
1 6 8192 ram6
1 7 8192 ram7
1 8 8192 ram8
1 9 8192 ram9
1 10 8192 ram10
1 11 8192 ram11
1 12 8192 ram12
1 13 8192 ram13
1 14 8192 ram14
1 15 8192 ram15
8 0 120479744 sda
8 1 8 sda1
8 2 32768 sda2
8 3 1024 sda3
8 4 512 sda4
8 5 512 sda5
8 6 131072 sda6
8 7 1048576 sda7
8 8 131072 sda8
8 9 131072 sda9
8 10 64 sda10
8 11 64 sda11
8 12 16384 sda12
8 13 393216 sda13
8 14 393216 sda14
8 15 16384 sda15
259 0 8192 sda16
259 1 8388608 sda17
259 2 109786956 sda18
8 16 8192 sdb
8 17 7168 sdb1
8 18 128 sdb2
8 64 4194304 sde
8 65 512 sde1
8 66 4096 sde2
8 67 512 sde3
8 68 262144 sde4
8 69 1024 sde5
8 70 4096 sde6
8 71 32768 sde7
8 72 8192 sde8
8 73 32768 sde9
8 74 512 sde10
8 75 512 sde11
8 76 512 sde12
8 77 128 sde13
8 78 64 sde14
8 79 2048 sde15
259 3 2048 sde16
259 4 512 sde17
259 5 4096 sde18
259 6 512 sde19
259 7 262144 sde20
259 8 1024 sde21
259 9 4096 sde22
259 10 32768 sde23
259 11 8192 sde24
259 12 32768 sde25
259 13 512 sde26
259 14 512 sde27
259 15 512 sde28
259 16 128 sde29
259 17 64 sde30
259 18 2048 sde31
259 19 2048 sde32
259 20 4 sde33
259 21 1024 sde34
259 22 256 sde35
259 23 8192 sde36
259 24 33424 sde37
259 25 4 sde38
259 26 1024 sde39
259 27 8192 sde40
259 28 2048 sde41
259 29 65536 sde42
259 30 128 sde43
259 31 32 sde44
259 32 32 sde45
259 33 512 sde46
259 34 28 sde47
259 35 512 sde48
259 36 1024 sde49
259 37 64 sde50
259 38 131072 sde51
259 39 24576 sde52
259 40 64 sde53
259 41 24576 sde54
259 42 131072 sde55
8 32 8192 sdc
8 33 7168 sdc1
8 34 128 sdc2
8 80 131072 sdf
8 81 104 sdf1
8 82 2048 sdf2
8 83 2048 sdf3
8 84 10240 sdf4
8 85 128 sdf5
8 48 131072 sdd
8 49 104 sdd1
8 50 128 sdd2
8 51 1024 sdd3
253 0 934804 dm-0
253 1 1403780 dm-1
253 2 2356452 dm-2
df -h output after flashing new .EU ROM - this is how it should look like:
Code:
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 2.7G 752.0K 2.7G 0% /dev
tmpfs 2.7G 0 2.7G 0% /mnt
tmpfs 2.7G 0 2.7G 0% /apex
tmpfs 2.7G 6.4M 2.7G 0% /tmp
/dev/block/sda18 104.7G 14.5G 90.2G 14% /data
/dev/block/sda18 104.7G 14.5G 90.2G 14% /sdcard
/dev/block/dm-1 1.3G 1.2G 33.4M 97% /vendor
/dev/block/sda13 356.0M 428.0K 328.7M 0% /cache
/dev/block/dm-2 2.2G 2.1G 109.5M 95% /system_root
/dev/block/dm-2 2.2G 2.1G 109.5M 95% /system
df -h output - what it actually looks like after soft-brick:
Code:
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 2.7G 752.0K 2.7G 0% /dev
tmpfs 2.7G 0 2.7G 0% /mnt
tmpfs 2.7G 0 2.7G 0% /apex
tmpfs 2.7G 2.6M 2.7G 0% /tmp
/dev/block/sda13 356.0M 1.1M 328.0M 0% /cache
/dev/block/sda18 104.7G 15.3G 89.4G 15% /data
/dev/block/sda18 104.7G 15.3G 89.4G 15% /sdcard
Trying to mount the "dm" devices, you can mount dm-0 and dm-1, but dm-2 (which should be system) fails:
Code:
~ # mount -r /dev/block/dm-2 /fufu/ -v -t ext4
mount: mounting /dev/block/dm-2 on /fufu/ failed: Read-only file system
DM-verity is disabled:
Code:
adb enable-verity
verity not enabled - ENG build
e2fsck fails because it claims to have no write access:
Code:
~ # e2fsck /dev/block/dm-2
e2fsck 1.44.4 (18-Aug-2018)
e2fsck: Operation not permitted while trying to open /dev/block/dm-2
You must have r/w access to the filesystem or be root
~ # whoami
root
File system is still intact. You can "dd" the dm-2 partition to some other place and access it via Linux or an ext4 viewer on Windows (https://www.diskinternals.com/linux-reader/ for example). You can also do it via adb: "adb pull /dev/block/dm-2"
When mounting (see above) and then looking in the log (dmesg):
Code:
<6>[ 1057.614782] EXT4-fs (dm-2): INFO: recovery required on readonly filesystem
<3>[ 1057.614797] EXT4-fs (dm-2): write access unavailable, cannot proceed
tune2fs for dm-1 and dm-2:
Code:
~ # tune2fs -l /dev/block/dm-1
tune2fs 1.44.4 (18-Aug-2018)
Filesystem volume name: vendor
Last mounted on: <not available>
Filesystem UUID: 6d16bab1-58d9-3c5d-8f14-f608f924affd
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode filetype extent sparse_super large_file uninit_bg
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Remount read-only
Filesystem OS type: Linux
Inode count: 87824
Block count: 350944
Reserved block count: 0
Free blocks: 12643
Free inodes: 84860
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 87
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 7984
Inode blocks per group: 499
Last mount time: n/a
Last write time: Thu Jan 1 08:00:00 1970
Mount count: 0
Maximum mount count: -1
Last checked: Thu Jan 1 08:00:00 1970
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: tea
Journal backup: inode blocks
~ # tune2fs -l /dev/block/dm-2
tune2fs 1.44.4 (18-Aug-2018)
Filesystem volume name: /
Last mounted on: /
Filesystem UUID: bbcb9ad2-245d-035f-a549-7d500312efe1
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode filetype needs_recovery extent sparse_super large_file uninit_bg
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Remount read-only
Filesystem OS type: Linux
Inode count: 147456
Block count: 589113
Reserved block count: 0
Free blocks: 32124
Free inodes: 142168
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 143
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Last mount time: Sun Aug 2 03:07:27 2020
Last write time: Thu Jan 1 08:00:00 1970
Mount count: 4
Maximum mount count: -1
Last checked: Thu Jan 1 08:00:00 1970
Check interval: 0 (<none>)
Lifetime writes: 692 kB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: tea
Journal backup: inode blocks
-> dm-2 has a flag called "needs_recovery" set.
- I can run e2fsck on the dd exported image of dm-2 which recovers it fine, but I cannot dd it back to dm-2 - again no write access:
Code:
~ # dd if=/sdcard/systemfile.img of=/dev/block/dm-2
dd: writing '/dev/block/dm-2': Operation not permitted
1+0 records in
0+0 records out
0 bytes (0B) copied, 0.000131 seconds, 0B/s
Ideas how I can write anything to /dev/block/dm-2 (I also cannot change anything via tune2fs to the other dm devices).
Thank you

@herlgl You should take a look at this or this. Good luck!

have you solved? how?

Related

[Q] need help partitioning Huawei Ascend G330 U8825-1

the ascend G330 waste 2GB for an internal SD-card, which nobody needs, but /data is just 655 MB, small, if you
like to have lots of apps.
researching on the phone - where partions are mounted i found in /init.rc these lines:
Code:
#/*resize data system cust cache partitions to max size*/
exec /sbin/e2fsck_s -p /dev/block/mmcblk0p15
exec /sbin/resize2fs_s /dev/block/mmcblk0p15
exec /sbin/e2fsck_s -p /dev/block/mmcblk0p16
exec /sbin/resize2fs_s /dev/block/mmcblk0p16
exec /sbin/e2fsck_s -p /dev/block/mmcblk0p17
exec /sbin/resize2fs_s /dev/block/mmcblk0p17
exec /sbin/e2fsck_s -p /dev/block/mmcblk0p18
exec /sbin/resize2fs_s /dev/block/mmcblk0p18
As i understand, if you change the size of a partition and reboot, the filesystem will be adapted!
So someone has just to delete part 18, 19 and recreate 18 and 19 with the desired size, give data up to 2,6 GB!
It would be take just 10 mins!
this is the layout (18 is /data, 19 is internal SD-Card):
Code:
Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 3 20 4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 3 41 300 45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 41 16681 133120 c Win95 FAT32 (LBA)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 16681 477184 3684031+ 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 16897 18432 12288 6a Unknown
/dev/block/mmcblk0p6 18433 18944 4096 46 Unknown
/dev/block/mmcblk0p7 18945 19456 4096 63 GNU HURD or SysV
/dev/block/mmcblk0p8 19457 19840 3072 58 Unknown
/dev/block/mmcblk0p9 19969 20352 3072 4a Unknown
/dev/block/mmcblk0p10 20481 20864 3072 4b Unknown
/dev/block/mmcblk0p11 20993 21504 4096 47 Unknown
/dev/block/mmcblk0p12 21505 22528 8192 48 Unknown
/dev/block/mmcblk0p13 22529 25088 20480 60 Unknown
/dev/block/mmcblk0p14 25089 25600 4096 6c Unknown
/dev/block/mmcblk0p15 25601 50176 196608 83 Linux
/dev/block/mmcblk0p16 50177 60416 81920 83 Linux
/dev/block/mmcblk0p17 60417 125952 524288 83 Linux
/dev/block/mmcblk0p18 125953 207872 655360 83 Linux
/dev/block/mmcblk0p19 207873 477184 2154496 6b Unknown
expert mode:
...
10 00 0 0 0 0 0 0 60794 6144 4b
11 00 0 0 0 0 0 0 68985 8192 47
12 00 0 0 0 0 0 0 77176 16384 48
13 00 0 0 0 0 0 0 93559 40960 60
14 00 0 0 0 0 0 0 134518 8192 6c
15 00 0 0 0 0 0 0 142709 393216 83
16 00 0 0 0 0 0 0 535924 163840 83
17 00 0 0 0 0 0 0 699763 1048576 83
18 00 0 0 0 0 0 0 1748338 1310720 83
19 00 0 0 0 0 0 0 3059057 4308992 6b
so i tried:
Code:
Command (m for help): d
Partition number (1-19): 19
Command (m for help): d
Partition number (1-18): 18
Command (m for help): p
Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 3 20 4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 3 41 300 45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 41 16681 133120 c Win95 FAT32 (LBA)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 16681 477184 3684031+ 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 16897 18432 12288 6a Unknown
/dev/block/mmcblk0p6 18433 18944 4096 46 Unknown
/dev/block/mmcblk0p7 18945 19456 4096 63 GNU HURD or SysV
/dev/block/mmcblk0p8 19457 19840 3072 58 Unknown
/dev/block/mmcblk0p9 19969 20352 3072 4a Unknown
/dev/block/mmcblk0p10 20481 20864 3072 4b Unknown
/dev/block/mmcblk0p11 20993 21504 4096 47 Unknown
/dev/block/mmcblk0p12 21505 22528 8192 48 Unknown
/dev/block/mmcblk0p13 22529 25088 20480 60 Unknown
/dev/block/mmcblk0p14 25089 25600 4096 6c Unknown
/dev/block/mmcblk0p15 25601 50176 196608 83 Linux
/dev/block/mmcblk0p16 50177 60416 81920 83 Linux
/dev/block/mmcblk0p17 60417 125952 524288 83 Linux
Command (m for help): n
First cylinder (16682-477184, default 16682): 125953
[COLOR="Red"]Sector 2015232 is already allocated[/COLOR]
First cylinder (125954-477184, default 125954): 125953
[COLOR="red"]Value is out of range[/COLOR]
First cylinder (125954-477184, default 125954): 125953
[COLOR="red"]Value is out of range[/COLOR]
First cylinder (125954-477184, default 125954):
so I could not recreate part18 with same starting offset - i would loose data.
Any idea why? fdisk is from busybox 1.19. What can i do to archieve my goal?
P.S. when i look to the expert output and recalculate, partitions seem to overlap one block:
expr 699763 + 1048576
1748339
expr 1748338 + 1310720
3059058

[Q] Why are there so many partitions?

When I look inside /dev/block, I see a lot of partitions on mmcblk0 (and I have confirmed, just to be certain, the combined size of all partitions almost exactly equals the size of mmcblk0 on its own):
Code:
~ # ls mmcblk0*
mmcblk0
mmcblk0p1
mmcblk0p10
mmcblk0p11
mmcblk0p12
mmcblk0p13
mmcblk0p14
mmcblk0p15
mmcblk0p16
mmcblk0p17
mmcblk0p18
mmcblk0p19
mmcblk0p2
mmcblk0p20
mmcblk0p21
mmcblk0p22
mmcblk0p23
mmcblk0p24
mmcblk0p25
mmcblk0p26
mmcblk0p27
mmcblk0p28
mmcblk0p29
mmcblk0p3
mmcblk0p30
mmcblk0p31
mmcblk0p32
mmcblk0p33
mmcblk0p4
mmcblk0p5
mmcblk0p6
mmcblk0p7
mmcblk0p8
mmcblk0p9
What is even more bizarre is I get even more partitions listed when I use fdisk:
Code:
~ # fdisk -l -u /dev/block/mmcblk0
Warning: deleting partitions after 60
Disk /dev/block/mmcblk0: 2432 MB, 2432696320 bytes
1 heads, 16 sectors/track, 296960 cylinders, total 4751360 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 1000 500 4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 1001 1128 64 45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 1129 10128 4500 46 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 10129 4751358 2370615 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 10130 70129 30000 49 Unknown
/dev/block/mmcblk0p6 70131 95130 12500 50 Unknown
/dev/block/mmcblk0p7 95132 99227 2048 51 Unknown
/dev/block/mmcblk0p8 99229 105372 3072 52 Unknown
/dev/block/mmcblk0p9 105374 109469 2048 53 Unknown
/dev/block/mmcblk0p10 109471 111518 1024 54 Unknown
/dev/block/mmcblk0p11 111520 113567 1024 56 Unknown
/dev/block/mmcblk0p12 113569 131071 8751+ 55 Unknown
/dev/block/mmcblk0p13 131073 139264 4096 4a Unknown
/dev/block/mmcblk0p14 139266 147457 4096 4b Unknown
/dev/block/mmcblk0p15 147459 149506 1024 74 Unknown
/dev/block/mmcblk0p16 149508 163326 6909+ 75 Unknown
/dev/block/mmcblk0p17 163328 163839 256 76 Unknown
/dev/block/mmcblk0p18 163841 165888 1024 47 Unknown
/dev/block/mmcblk0p19 165890 167937 1024 34 Unknown
/dev/block/mmcblk0p20 167939 170498 1280 36 Unknown
/dev/block/mmcblk0p21 170500 187901 8701 71 Unknown
/dev/block/mmcblk0p22 187903 196094 4096 48 Unknown
/dev/block/mmcblk0p23 196096 196607 256 73 Unknown
/dev/block/mmcblk0p24 196609 200702 2047 26 Unknown
/dev/block/mmcblk0p25 200704 1835006 817151+ 83 Linux
/dev/block/mmcblk0p26 1835008 3833854 999423+ 83 Linux
/dev/block/mmcblk0p27 3833856 4095998 131071+ 83 Linux
/dev/block/mmcblk0p28 4096000 4452350 178175+ 83 Linux
/dev/block/mmcblk0p29 4452352 4456446 2047+ 33 Unknown
/dev/block/mmcblk0p30 4456448 4504942 24247+ 19 Unknown
/dev/block/mmcblk0p31 4504944 4505085 71 90 Unknown
/dev/block/mmcblk0p32 4505087 4505598 256 23 Unknown
/dev/block/mmcblk0p33 4505600 4702191 98296 c Win95 FAT32 (LBA)
/dev/block/mmcblk0p34 10130 70129 30000 49 Unknown
/dev/block/mmcblk0p35 70131 95130 12500 50 Unknown
/dev/block/mmcblk0p36 95132 99227 2048 51 Unknown
/dev/block/mmcblk0p37 99229 105372 3072 52 Unknown
/dev/block/mmcblk0p38 105374 109469 2048 53 Unknown
/dev/block/mmcblk0p39 109471 111518 1024 54 Unknown
/dev/block/mmcblk0p40 111520 113567 1024 56 Unknown
/dev/block/mmcblk0p41 113569 131071 8751+ 55 Unknown
/dev/block/mmcblk0p42 131073 139264 4096 4a Unknown
/dev/block/mmcblk0p43 139266 147457 4096 4b Unknown
/dev/block/mmcblk0p44 147459 149506 1024 74 Unknown
/dev/block/mmcblk0p45 149508 163326 6909+ 75 Unknown
/dev/block/mmcblk0p46 163328 163839 256 76 Unknown
/dev/block/mmcblk0p47 163841 165888 1024 47 Unknown
/dev/block/mmcblk0p48 165890 167937 1024 34 Unknown
/dev/block/mmcblk0p49 167939 170498 1280 36 Unknown
/dev/block/mmcblk0p50 170500 187901 8701 71 Unknown
/dev/block/mmcblk0p51 187903 196094 4096 48 Unknown
/dev/block/mmcblk0p52 196096 196607 256 73 Unknown
/dev/block/mmcblk0p53 196609 200702 2047 26 Unknown
/dev/block/mmcblk0p54 200704 1835006 817151+ 83 Linux
/dev/block/mmcblk0p55 1835008 3833854 999423+ 83 Linux
/dev/block/mmcblk0p56 3833856 4095998 131071+ 83 Linux
/dev/block/mmcblk0p57 4096000 4452350 178175+ 83 Linux
/dev/block/mmcblk0p58 4452352 4456446 2047+ 33 Unknown
/dev/block/mmcblk0p59 4456448 4504942 24247+ 19 Unknown
/dev/block/mmcblk0p60 4504944 4505085 71 90 Unknown
Partition table entries are not in disk order
The thing is, those extra partitions don't seem to be in use. Running mount only lists the following partitions as mounted somewhere (irrelevant mounts excluded from the output)
Code:
/dev/block/mmcblk0p25 /system ext4 ro,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p26 /data ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered,noauto_da_alloc 0 0
/dev/block/mmcblk0p28 /cache ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p30 /devlog ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0
What are all these extra partitions for?
Is this specific to my particular device (HTC One V, with firmware for Cricket Wireless), or do all Android devices have this sheer number partitions?

Can't Boot after repartition internal memory using fdisk on Motorola Droid Razr

i was trying to flash lineageOS 13.0 on driod razr xt912 using safestrap 3.75 right after that flash open gapp but couldn't due to low storage error of system partition so i decided to increase system memory . After googling found two way of doing , 1st parted , 2nd fdisk. After getting in error in parted so i switch to fdisk . Below are the steps i did please correct me
1) connected phone in safetrap 3.75 recovery to pc. CONNECTION WAS SUCCESSFUL . took backup of /system and /data from safetrap 3.75.
adb root
adb shell
# cat /etc/fstab
/dev/block/mmcblk1p25 /sdcard vfat rw
/sdcard-ext vfat rw
/dev/block/mmcblk1p24-orig /data ext3 rw
/dev/block/mmcblk1p21-orig /cache ext3 rw
/dev/block/mmcblk1p20-orig /system ext3 rw
/dev/block/mmcblk1p23 /osh ext3 rw
/dev/block/mmcblk1p20-orig /systemorig ext3 rw
/dev/block/mmcblk1p25 /ss vfat rw
# cat /proc/partitions
179 0 15564800 mmcblk1
179 1 128 mmcblk1p1
179 2 512 mmcblk1p2
179 3 512 mmcblk1p3
179 4 1 mmcblk1p4
179 5 512 mmcblk1p5
179 6 128 mmcblk1p6
179 7 4096 mmcblk1p7 pds
179 8 512 mmcblk1p8 utags
179 9 1024 mmcblk1p9
179 10 2048 mmcblk1p10
179 11 512 mmcblk1p11
179 12 512 mmcblk1p12
179 13 4096 mmcblk1p13
179 14 8192 mmcblk1p14 boot
179 15 9216 mmcblk1p15 recovery
179 16 217088 mmcblk1p16 cdrom
179 17 512 mmcblk1p17 misc
179 18 512 mmcblk1p18 cid
179 19 4096 mmcblk1p19 kpanic
179 20 655360 mmcblk1p20 system
179 21 1048576 mmcblk1p21 cache
179 22 622592 mmcblk1p22 preinstall
179 23 1364992 mmcblk1p23 webtop
179 24 3203072 mmcblk1p24 userdata
179 25 8401792 mmcblk1p25 emstorage
179 26 128 mmcblk1p26
179 64 2048 mmcblk1boot1
179 32 2048 mmcblk1boot0
# /sbin/fdisk /dev/block/mmcblk1
Disk /dev/block/mmcblk1: 15.9 GB, 15938355200 bytes
16 heads, 16 sectors/track, 121600 cylinders, total 31129600 sectors
Units = sectors of 1 * 512 = 512 bytes
u (unit to sector )
p
Device Boot Start End Blocks Id System
block/mmcblk1p1 * 256 511 128 83 Linux
block/mmcblk1p2 1024 2047 512 83 Linux
block/mmcblk1p3 2048 3071 512 83 Linux
block/mmcblk1p4 3072 31105023 15550976 5 Extended
block/mmcblk1p5 4096 5119 512 83 Linux
block/mmcblk1p6 5120 5375 128 83 Linux
block/mmcblk1p7 6144 14335 4096 83 Linux
block/mmcblk1p8 14336 15359 512 83 Linux
block/mmcblk1p9 16384 18431 1024 83 Linux
block/mmcblk1p10 18432 22527 2048 83 Linux
block/mmcblk1p11 22528 23551 512 83 Linux
block/mmcblk1p12 23552 24575 512 83 Linux
block/mmcblk1p13 24576 32767 4096 83 Linux
block/mmcblk1p14 32768 49151 8192 83 Linux
block/mmcblk1p15 49152 67583 9216 83 Linux
block/mmcblk1p16 67584 501759 217088 83 Linux
block/mmcblk1p17 501760 502783 512 83 Linux
block/mmcblk1p18 502784 503807 512 83 Linux
block/mmcblk1p19 503808 511999 4096 83 Linux
block/mmcblk1p20 512000 1822719 655360 83 Linux
block/mmcblk1p21 1822720 3919871 1048576 83 Linux
block/mmcblk1p22 3919872 5165055 622592 83 Linux
block/mmcblk1p23 5165056 7895039 1364992 83 Linux
block/mmcblk1p24 7895040 14301183 3203072 83 Linux
block/mmcblk1p25 14301184 31104767 8401792 83 Linux
block/mmcblk1p26 31104768 31105023 128 83 Linux
2) i decide to make changes in (20-25)'s partition ( system to +3072M, cache to +1024M, preinstall to +1S, webtop to +1S, userdata to +3072M, emstorage to +8102M). But in order to make changes in (20-25)'s i had to delete 26's partitions but after creating new table starting and ending sector of 26's partitions remains the same . Also after i knew that safetrap 3.75 does not use preinstall, webtop for stock slot so i change them to +1S SECTORE.
d 26
d 25
d 24
d 23
d 22
d 21
d 20
3) after creating the new partitions. Table as follows
P
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 * 256 511 128 83 Linux
/dev/block/mmcblk1p2 1024 2047 512 83 Linux
/dev/block/mmcblk1p3 2048 3071 512 83 Linux
/dev/block/mmcblk1p4 3072 31105023 15550976 5 Extended
/dev/block/mmcblk1p5 4096 5119 512 83 Linux
/dev/block/mmcblk1p6 5120 5375 128 83 Linux
/dev/block/mmcblk1p7 6144 14335 4096 83 Linux
/dev/block/mmcblk1p8 14336 15359 512 83 Linux
/dev/block/mmcblk1p9 16384 18431 1024 83 Linux
/dev/block/mmcblk1p10 18432 22527 2048 83 Linux
/dev/block/mmcblk1p11 22528 23551 512 83 Linux
/dev/block/mmcblk1p12 23552 24575 512 83 Linux
/dev/block/mmcblk1p13 24576 32767 4096 83 Linux
/dev/block/mmcblk1p14 32768 49151 8192 83 Linux
/dev/block/mmcblk1p15 49152 67583 9216 83 Linux
/dev/block/mmcblk1p16 67584 501759 217088 83 Linux
/dev/block/mmcblk1p17 501760 502783 512 83 Linux
/dev/block/mmcblk1p18 502784 503807 512 83 Linux
/dev/block/mmcblk1p19 503808 511999 4096 83 Linux
/dev/block/mmcblk1p20 512016 6512016 3000000+ 83 Linux
/dev/block/mmcblk1p21 6512033 8512033 1000000+ 83 Linux
/dev/block/mmcblk1p22 8512050 8512052 1+ 83 Linux
/dev/block/mmcblk1p23 8512069 8512071 1+ 83 Linux
/dev/block/mmcblk1p24 8512088 14512088 3000000+ 83 Linux
/dev/block/mmcblk1p25 14512105 31104751 8296323+ 83 Linux
/dev/block/mmcblk1p26 31104768 31105023 128 83 Linux
w (writing)
recreating table successful
q (quit)
# mke2fs -t ext3 /dev/block/mmcblk1p20
# mke2fs -t ext3 /dev/block/mmcblk1p21
# mke2fs -t ext3 /dev/block/mmcblk1p22
# mke2fs -t ext3 /dev/block/mmcblk1p23
# mke2fs -t ext3 /dev/block/mmcblk1p24
# mkdosfs /dev/block/mmcblk1p25
#mount /dev/block/mmcblk1p20 /system/
#mount /dev/block/mmcblk1p21 /cache/
#mount /dev/block/mmcblk1p24 /data/
#mount /dev/block/mmcblk1p25 /sdcard/
# mount /dev/block/mmcblk1p25 /ss/
# mount /dev/block/mmcblk1p25 /and-sec/
4) after that wiped cache, data , andriod secure, data, webtop, system.
5) restored backup of /system and /data /
6) reboot the system
7) after Motorola logo "M" got error
ap fastboot flash mode [boot failure]
0A.77
eMMC Info: Size 16g
to return to normal mode - first press power key to power down
device is LOCKED, Status Code:0
battery ok
ok to program
Connect USB
Data cable
Invalid CG OTV [CG: system]: Invalid SP Data
Invalid CG HAB [CG: system, status: 0X004E]
Invalid CG OTV [CG: system]
8) i had to use RSD LITE to flash VRZ_XT912_9.8.2O-72_VZW-16-5_1FF.xml to boot normally.
9) after booting i check for changes i made , f**k system returns back to default partition table.
QUESTIONS
1) where do i go wrong
2) does i have to also make change in "ebr" or "mbr" after changing partitions size
4) does it relate to preinstall and webtop which i left to +1S SECTOR
5)does lineageOS 13.0 need /osh (webtop partitions) because i was flashing saw it searching for /osh for mount
6)does to safe to left the preinstall and webtop to +1S SECTOR

A little help

Can someone with rooted device run this command and let me known if mmcblk0 partition exists in note 9 pro
Here is the procedure to check:-
Code:
1) Open a terminal in your linux.
2) adb devices (This step assumes that adb and fastboot are in linux system path)
3) adb shell
4) su -
5) You are in root shell now.
6) cat /proc/partitions.
7) check if mmcblk0 partition available
Please let me know if this partitions exists, since it could help others to unbrick they device. Thanks in advance ?.
Anyone? please help me to know if the partitions exists, it could help us to recover the bricked device. Maybe in future you will use the unbrick method to unbrick your device.
On Evolution X ROM, that partition refers to the external SD card on my phone. The main phone partitions are showing on sda.
Apple Pi said:
On Evolution X ROM, that partition refers to the external SD card on my phone. The main phone partitions are showing on sda.
Click to expand...
Click to collapse
Thanks for reply, it will be appear like this, you can try termux to see the partition.
Code:
su
Cat /proc/partitions
It will list out all partitions, there the mmcblk0 partition should exist. And can you help me creat a image of it for recovering device?
Like this
riyan65 said:
Like this
Click to expand...
Click to collapse
Code:
curtana:/ # cat /proc/partitions
major minor #blocks name
1 0 8192 ram0
1 1 8192 ram1
1 2 8192 ram2
1 3 8192 ram3
1 4 8192 ram4
1 5 8192 ram5
1 6 8192 ram6
1 7 8192 ram7
1 8 8192 ram8
1 9 8192 ram9
1 10 8192 ram10
1 11 8192 ram11
1 12 8192 ram12
1 13 8192 ram13
1 14 8192 ram14
1 15 8192 ram15
7 0 97048 loop0
7 8 880 loop1
7 16 1660 loop2
7 24 264 loop3
7 32 22540 loop4
7 40 97048 loop5
7 48 880 loop6
7 56 5664 loop7
7 64 5164 loop8
254 0 3145728 zram0
8 48 131072 sdd
8 49 104 sdd1
8 50 128 sdd2
8 51 1024 sdd3
8 64 4194304 sde
8 65 512 sde1
8 66 4096 sde2
8 67 512 sde3
8 68 262144 sde4
8 69 1024 sde5
8 70 4096 sde6
8 71 32768 sde7
8 72 8192 sde8
8 73 32768 sde9
8 74 512 sde10
8 75 512 sde11
8 76 512 sde12
8 77 128 sde13
8 78 64 sde14
8 79 2048 sde15
259 0 2048 sde16
259 1 512 sde17
259 2 4096 sde18
259 3 512 sde19
259 4 262144 sde20
259 5 1024 sde21
259 6 4096 sde22
259 7 32768 sde23
259 8 8192 sde24
259 9 32768 sde25
259 10 512 sde26
259 11 512 sde27
259 12 512 sde28
259 13 128 sde29
259 14 64 sde30
259 15 2048 sde31
259 16 2048 sde32
259 17 4 sde33
259 18 1024 sde34
259 19 256 sde35
259 20 8192 sde36
259 21 33424 sde37
259 22 4 sde38
259 23 1024 sde39
259 24 8192 sde40
259 25 2048 sde41
259 26 65536 sde42
259 27 128 sde43
259 28 32 sde44
259 29 32 sde45
259 30 512 sde46
259 31 28 sde47
259 32 512 sde48
259 33 1024 sde49
259 34 64 sde50
259 35 131072 sde51
259 36 24576 sde52
259 37 64 sde53
259 38 24576 sde54
259 39 131072 sde55
8 16 8192 sdb
8 17 7168 sdb1
8 18 128 sdb2
8 32 8192 sdc
8 33 7168 sdc1
8 34 128 sdc2
8 0 120479744 sda
8 1 8 sda1
8 2 32768 sda2
8 3 1024 sda3
8 4 512 sda4
8 5 512 sda5
8 6 131072 sda6
8 7 1048576 sda7
8 8 131072 sda8
8 9 131072 sda9
8 10 64 sda10
8 11 64 sda11
8 12 16384 sda12
8 13 393216 sda13
8 14 393216 sda14
8 15 16384 sda15
259 40 8192 sda16
259 41 8388608 sda17
259 42 109786956 sda18
8 80 131072 sdf
8 81 104 sdf1
8 82 2048 sdf2
8 83 2048 sdf3
8 84 10240 sdf4
8 85 128 sdf5
179 0 125042688 mmcblk0
179 1 125041647 mmcblk0p1
253 0 1518988 dm-0
253 1 1398808 dm-1
253 2 2097152 dm-2
Yes, the partition exists, now there are high chance of recovery of hard brick device. Will you help me to create one. Please PM me if you are interested
That partition only exists due to external storage being mounted to the system via the microSD card slot.
Apple Pi said:
That partition only exists due to external storage being mounted to the system via the microSD card slot.
Click to expand...
Click to collapse
No, it a system partition which contains you firmware, fastboot, and gpt table and much more. It will be the size of your device memory but get compress to 2-3gb.
riyan65 said:
No, it a system partition which contains you firmware, fastboot, and gpt table and much more. It will be the size of your device memory but get compress to 2-3gb.
Click to expand...
Click to collapse
The Partition is 125,042,688 KBytes which is the size of my 128GB MicroSD Card.
Apple Pi said:
The Partition is 125,042,688 KBytes which is the size of my 128GB MicroSD Card.
Click to expand...
Click to collapse
Could you try the same with remove sd card?

Backup help: TWRP what's the path of sda ?

Background Information
My phone is stuck in a boot loop. Fortunately my phone is rooted and I have TWRP installed.
Original Plan
So my original plan was to just restore the data with TWRP.
However when trying to access the data I found out that the "data" partition can't be mounted in TWRP.
It apparently has to do something with it being encrypted. However I don't understand why I can't just decrypt it since I know my password! ??
New Plan
So my new plan was:
1. Create a disk clone with dd
2. Save it on my pc
3. Flash my phone and use it again
4. Wait (Maybe one day in the future I'll be able to decrypt my data and access it again)
So I listed all partitions in order to find the appropriate "hard drive" or in this case the appropriate flash drive (UFS)
p3s:/ # cat /proc/partitions
major minor #blocks name
1 0 8192 ram0
1 1 8192 ram1
1 2 8192 ram2
1 3 8192 ram3
1 4 8192 ram4
1 5 8192 ram5
1 6 8192 ram6
1 7 8192 ram7
1 8 8192 ram8
1 9 8192 ram9
1 10 8192 ram10
1 11 8192 ram11
1 12 8192 ram12
1 13 8192 ram13
1 14 8192 ram14
1 15 8192 ram15
7 0 264 loop0
7 8 888 loop1
7 16 98312 loop2
7 24 18604 loop3
8 0 499814400 sda
8 1 20480 sda1
8 2 20480 sda2
8 3 4096 sda3
8 4 8192 sda4
8 5 8192 sda5
8 6 512 sda6
8 7 40960 sda7
8 8 3072 sda8
8 9 2048 sda9
8 10 4096 sda10
8 11 8192 sda11
8 12 64 sda12
8 13 65536 sda13
8 14 65536 sda14
8 15 65536 sda15
259 0 71680 sda16
259 1 7680 sda17
259 2 1024 sda18
259 3 512 sda19
259 4 1024 sda20
259 5 53248 sda21
259 6 16384 sda22
259 7 64 sda23
259 8 64 sda24
259 9 32768 sda25
259 10 4 sda26
259 11 316 sda27
259 12 11468800 sda28
259 13 1433600 sda29
259 14 30720 sda30
259 15 614400 sda31
259 16 51200 sda32
259 17 51200 sda33
259 18 485654528 sda34
8 16 4096 sdb
8 32 4096 sdc
8 48 8192 sdd
8 49 6144 sdd1
8 64 20480 sde
253 0 6601340 dm-0
253 1 1764892 dm-1
253 2 845048 dm-2
253 3 4248 dm-3
Click to expand...
Click to collapse
So sda seems to be the main storage as it's the biggest one. I then wanted to know what's the path of sda . Like in normal linux on normal pcs it's always /dev/sda and one can just do dd if=/dev/sda .... .
I tried listing it via:
ls -l /sys/class/block/sda
Click to expand...
Click to collapse
/sys/devices/platform/13100000.ufs/host0/target0:0:0/0:0:0:0/block/sda
p3s:/sys/dev/block # dd if=/sys/devices/platform/13100000.ufs/host0/target0\:0\:0/0\:0\:0\:0/block/sda bs=512 count=1
dd: /sys/devices/platform/13100000.ufs/host0/target0:0:0/0:0:0:0/block/sda: read error: Is a directory
Click to expand...
Click to collapse
However when i try this, dd complains, that sda is a directory
Does anyone know the correct path ? Or how I can find out what the correct path is ?
Oh I think i found it :
I think it's
/dev/block/sda
Click to expand...
Click to collapse
when i now try to execute dd it works
p3s:/ # dd if=/dev/block/sda bs=512 count=1
☺�☺��rU�1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.004320 s, 116 K/s
Click to expand...
Click to collapse

Categories

Resources