[Android Q&A, Help & Troubleshooting] footbook:
Hello everyone!

I'd like to better understand my smartphone's Partitions Layout...

At the moment

I'm inside TWRP

and I managed to enter into Shell as root:

\platform-tools>adb.exe shell
~ #

So... I'm gathering these infos:

~ # fdisk /dev/block/mmcblk0

Found valid GPT with protective MBR; using GPT

Command (m for help): p
Disk /dev/block/mmcblk0: 30535680 sectors, 2622M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 52 entries
First usable sector is 34, last usable sector is 30535646

Number Start (sector) End (sector) Size Code Name
1 131072 303103 84.0M 0700 modem
2 393216 393217 1024 0700 fsc
3 393218 393233 8192 0700 ssd
4 393234 394257 512K 0700 sbl1
5 394258 395281 512K 0700 sbl1bak
6 395282 396305 512K 0700 rpm
7 396306 397329 512K 0700 rpmbak
8 397330 401425 2048K 0700 tz
9 401426 405521 2048K 0700 tzbak
10 405522 406033 256K 0700 devcfg
11 406034 406545 256K 0700 devcfgbak
12 406546 439313 16.0M 0700 dsp
13 439314 442385 1536K 0700 modemst1
14 442386 445457 1536K 0700 modemst2
15 524288 524351 32768 0700 DDR
16 524352 527423 1536K 0700 fsg
17 527424 527455 16384 0700 sec
18 655360 677887 11.0M 0700 splash
19 786432 788479 1024K 0700 aboot
20 788480 790527 1024K 0700 abootbak
21 790528 921599 64.0M 0700 boot
22 921600 1052671 64.0M 0700 recovery
23 1052672 1054719 1024K 0700 devinfo
24 1054720 7346175 3072M 0700 system
25 7471104 7995391 256M 0700 cache
26 7995392 8060927 32.0M 0700 persist
27 8060928 8062975 1024K 0700 misc
28 8062976 8063999 512K 0700 keystore
29 8064000 8064063 32768 0700 config
30 8064064 8588351 256M 0700 oem
31 8650752 8650815 32768 0700 limits
32 8781824 8782847 512K 0700 mota
33 8782848 8784895 1024K 0700 dip
34 8784896 8850431 32.0M 0700 mdtp
35 8850432 8851455 512K 0700 syscfg
36 8851456 8859647 4096K 0700 mcfg
37 8912896 8913151 128K 0700 lksecapp
38 8913152 8913407 128K 0700 lksecappbak
39 8913408 8913919 256K 0700 cmnlib
40 8913920 8914431 256K 0700 cmnlibbak
41 8914432 8914943 256K 0700 cmnlib64
42 8914944 8915455 256K 0700 cmnlib64bak
43 8915456 8915967 256K 0700 keymaster
44 8915968 8916479 256K 0700 keymasterbak
45 9043968 9044479 256K 0700 apdp
46 9044480 9044991 256K 0700 msadp
47 9044992 9045007 8192 0700 dpo
48 9045008 9176079 64.0M 0700 logdump
49 9176080 30535646 10.1G 0700 userdata

~ # mount

rootfs on / type rootfs (rw,seclabel,size=853376k,nr_inodes=134849)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=936796k,nr_inodes=138672,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=936796k,nr_inodes=138672)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/mmcblk0p25 on /cache type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/mmcblk1p1 on /external_sd type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/block/mmcblk0p24 on /system type ext4 (rw,seclabel,relatime,data=ordered)

~ # ls -lh /dev/block/platform/soc/7824900.sdhci/ | sort -g

drwxr-xr-x 2 root root 1020 Feb 17 19:54 by-name
drwxr-xr-x 2 root root 1020 Feb 17 19:54 by-num
lrwxrwxrwx 1 root root 18 Feb 17 19:54 mmcblk0 -> /dev/block/mmcblk0
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p1 -> /dev/block/mmcblk0p1
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p2 -> /dev/block/mmcblk0p2
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p3 -> /dev/block/mmcblk0p3
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p4 -> /dev/block/mmcblk0p4
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p5 -> /dev/block/mmcblk0p5
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p6 -> /dev/block/mmcblk0p6
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p7 -> /dev/block/mmcblk0p7
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p8 -> /dev/block/mmcblk0p8
lrwxrwxrwx 1 root root 20 Feb 17 19:54 mmcblk0p9 -> /dev/block/mmcblk0p9
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p10 -> /dev/block/mmcblk0p10
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p11 -> /dev/block/mmcblk0p11
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p12 -> /dev/block/mmcblk0p12
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p13 -> /dev/block/mmcblk0p13
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p14 -> /dev/block/mmcblk0p14
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p15 -> /dev/block/mmcblk0p15
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p16 -> /dev/block/mmcblk0p16
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p17 -> /dev/block/mmcblk0p17
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p18 -> /dev/block/mmcblk0p18
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p19 -> /dev/block/mmcblk0p19
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p20 -> /dev/block/mmcblk0p20
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p21 -> /dev/block/mmcblk0p21
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p22 -> /dev/block/mmcblk0p22
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p23 -> /dev/block/mmcblk0p23
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p24 -> /dev/block/mmcblk0p24
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p25 -> /dev/block/mmcblk0p25
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p26 -> /dev/block/mmcblk0p26
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p27 -> /dev/block/mmcblk0p27
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p28 -> /dev/block/mmcblk0p28
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p29 -> /dev/block/mmcblk0p29
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p30 -> /dev/block/mmcblk0p30
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p31 -> /dev/block/mmcblk0p31
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p32 -> /dev/block/mmcblk0p32
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p33 -> /dev/block/mmcblk0p33
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p34 -> /dev/block/mmcblk0p34
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p35 -> /dev/block/mmcblk0p35
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p36 -> /dev/block/mmcblk0p36
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p37 -> /dev/block/mmcblk0p37
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p38 -> /dev/block/mmcblk0p38
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p39 -> /dev/block/mmcblk0p39
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p40 -> /dev/block/mmcblk0p40
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p41 -> /dev/block/mmcblk0p41
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p42 -> /dev/block/mmcblk0p42
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p43 -> /dev/block/mmcblk0p43
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p44 -> /dev/block/mmcblk0p44
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p45 -> /dev/block/mmcblk0p45
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p46 -> /dev/block/mmcblk0p46
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p47 -> /dev/block/mmcblk0p47
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p48 -> /dev/block/mmcblk0p48
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mmcblk0p49 -> /dev/block/mmcblk0p49
lrwxrwxrwx 1 root root 22 Feb 17 19:54 mmcblk0rpmb -> /dev/block/mmcblk0rpmb

~ # ls -lh /dev/block/platform/soc/7824900.sdhci/by-name | sort -f -k6

lrwxrwxrwx 1 root root 21 Feb 17 19:54 aboot -> /dev/block/mmcblk0p19
lrwxrwxrwx 1 root root 21 Feb 17 19:54 abootbak -> /dev/block/mmcblk0p20
lrwxrwxrwx 1 root root 21 Feb 17 19:54 apdp -> /dev/block/mmcblk0p45
lrwxrwxrwx 1 root root 21 Feb 17 19:54 boot -> /dev/block/mmcblk0p21
lrwxrwxrwx 1 root root 21 Feb 17 19:54 cache -> /dev/block/mmcblk0p25
lrwxrwxrwx 1 root root 21 Feb 17 19:54 cmnlib -> /dev/block/mmcblk0p39
lrwxrwxrwx 1 root root 21 Feb 17 19:54 cmnlib64 -> /dev/block/mmcblk0p41
lrwxrwxrwx 1 root root 21 Feb 17 19:54 cmnlib64bak -> /dev/block/mmcblk0p42
lrwxrwxrwx 1 root root 21 Feb 17 19:54 cmnlibbak -> /dev/block/mmcblk0p40
lrwxrwxrwx 1 root root 21 Feb 17 19:54 config -> /dev/block/mmcblk0p29
lrwxrwxrwx 1 root root 21 Feb 17 19:54 DDR -> /dev/block/mmcblk0p15
lrwxrwxrwx 1 root root 21 Feb 17 19:54 devcfg -> /dev/block/mmcblk0p10
lrwxrwxrwx 1 root root 21 Feb 17 19:54 devcfgbak -> /dev/block/mmcblk0p11
lrwxrwxrwx 1 root root 21 Feb 17 19:54 devinfo -> /dev/block/mmcblk0p23
lrwxrwxrwx 1 root root 21 Feb 17 19:54 dip -> /dev/block/mmcblk0p33
lrwxrwxrwx 1 root root 21 Feb 17 19:54 dpo -> /dev/block/mmcblk0p47
lrwxrwxrwx 1 root root 21 Feb 17 19:54 dsp -> /dev/block/mmcblk0p12
lrwxrwxrwx 1 root root 20 Feb 17 19:54 fsc -> /dev/block/mmcblk0p2
lrwxrwxrwx 1 root root 21 Feb 17 19:54 fsg -> /dev/block/mmcblk0p16
lrwxrwxrwx 1 root root 21 Feb 17 19:54 keymaster -> /dev/block/mmcblk0p43
lrwxrwxrwx 1 root root 21 Feb 17 19:54 keymasterbak -> /dev/block/mmcblk0p44
lrwxrwxrwx 1 root root 21 Feb 17 19:54 keystore -> /dev/block/mmcblk0p28
lrwxrwxrwx 1 root root 21 Feb 17 19:54 limits -> /dev/block/mmcblk0p31
lrwxrwxrwx 1 root root 21 Feb 17 19:54 lksecapp -> /dev/block/mmcblk0p37
lrwxrwxrwx 1 root root 21 Feb 17 19:54 lksecappbak -> /dev/block/mmcblk0p38
lrwxrwxrwx 1 root root 21 Feb 17 19:54 logdump -> /dev/block/mmcblk0p48
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mcfg -> /dev/block/mmcblk0p36
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mdtp -> /dev/block/mmcblk0p34
lrwxrwxrwx 1 root root 21 Feb 17 19:54 misc -> /dev/block/mmcblk0p27
lrwxrwxrwx 1 root root 20 Feb 17 19:54 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx 1 root root 21 Feb 17 19:54 modemst1 -> /dev/block/mmcblk0p13
lrwxrwxrwx 1 root root 21 Feb 17 19:54 modemst2 -> /dev/block/mmcblk0p14
lrwxrwxrwx 1 root root 21 Feb 17 19:54 mota -> /dev/block/mmcblk0p32
lrwxrwxrwx 1 root root 21 Feb 17 19:54 msadp -> /dev/block/mmcblk0p46
lrwxrwxrwx 1 root root 21 Feb 17 19:54 oem -> /dev/block/mmcblk0p30
lrwxrwxrwx 1 root root 21 Feb 17 19:54 persist -> /dev/block/mmcblk0p26
lrwxrwxrwx 1 root root 21 Feb 17 19:54 recovery -> /dev/block/mmcblk0p22
lrwxrwxrwx 1 root root 20 Feb 17 19:54 rpm -> /dev/block/mmcblk0p6
lrwxrwxrwx 1 root root 20 Feb 17 19:54 rpmbak -> /dev/block/mmcblk0p7
lrwxrwxrwx 1 root root 20 Feb 17 19:54 sbl1 -> /dev/block/mmcblk0p4
lrwxrwxrwx 1 root root 20 Feb 17 19:54 sbl1bak -> /dev/block/mmcblk0p5
lrwxrwxrwx 1 root root 21 Feb 17 19:54 sec -> /dev/block/mmcblk0p17
lrwxrwxrwx 1 root root 21 Feb 17 19:54 splash -> /dev/block/mmcblk0p18
lrwxrwxrwx 1 root root 20 Feb 17 19:54 ssd -> /dev/block/mmcblk0p3
lrwxrwxrwx 1 root root 21 Feb 17 19:54 syscfg -> /dev/block/mmcblk0p35
lrwxrwxrwx 1 root root 21 Feb 17 19:54 system -> /dev/block/mmcblk0p24
lrwxrwxrwx 1 root root 20 Feb 17 19:54 tz -> /dev/block/mmcblk0p8
lrwxrwxrwx 1 root root 20 Feb 17 19:54 tzbak -> /dev/block/mmcblk0p9
lrwxrwxrwx 1 root root 21 Feb 17 19:54 userdata -> /dev/block/mmcblk0p49

~ # find / -iname "*fstab*"

/cache/recovery/recovery.fstab
/cache/recovery/storage.fstab
/system/etc/vold.fstab
/system/vendor/etc/fstab.qcom
find: /sys/kernel/slab/L2TP/IPv6: No such file or directory
find: /sys/kernel/slab/L2TP/IP: No such file or directory
/etc/fstab
/etc/twrp.fstab

Contents of ~ # find / -iname "*fstab*"

/cache/recovery/recovery.fstab
### EMPTY FILE ###

\\\

/cache/recovery/storage.fstab
/data/media;Internal Storage;
/external_sd;External SD;
/usb-otg;USB OTG;

\\\

/system/etc/vold.fstab
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dev_mount sdcard /storage/sdcard1 auto /devices/msm_sdcc.2/mmc_host

# MTP
#dev_mount sdcard2 /mnt/sdcard/external_sd auto /devices/platform/msm_sdcc.3/mmc_host

\\\

/system/vendor/etc/fstab.qcom
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
#/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait, verify
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,resize,forceencrypt=footer,quota
/devices/platform/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer
/devices/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer
/devices/platform/soc/78db000.usb/msm_hsusb_host* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/devices/soc/78db000.usb/msm_hsusb_host* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/config /frp emmc defaults defaults
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev,barrier=1 wait

\\\

/etc/fstab
/dev/block/mmcblk0p25 /cache ext4 rw 0 0
/dev/block/mmcblk0p24 /system ext4 rw 0 0
/dev/block/dm-0 /data ext4 rw 0 0
/dev/block/mmcblk1p1 /external_sd vfat rw 0 0
/usb-otg vfat rw 0 0

\\\

/etc/twrp.fstab
/cache ext4 /dev/block/bootdevice/by-name/cache
/system ext4 /dev/block/bootdevice/by-name/system
/system_image emmc /dev/block/bootdevice/by-name/system
/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;length=-16384
/boot emmc /dev/block/bootdevice/by-name/boot
/recovery emmc /dev/block/bootdevice/by-name/recovery
/misc emmc /dev/block/bootdevice/by-name/misc
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="External SD";storage;wipeingui;removable
/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB OTG";storage;wipeingui;removable

And now... Questions time! :p

Which fstab should I trust? Why there are so many different ones?

Why my smartphone has the by-name/ directory inside this path: /dev/block/platform/soc/7824900.sdhci/ ?

In case I would use ddto backup or restore or reflash partitions, can i use dd within ADB Shell while I'm into Recovery (TWRP)?

Will dd be capable of reflashing .bin and .img and .mbn partitions even if I am OEM locked-out from Fastboot?

Why I cannot mount /datawhile inside TWRP?

~ # mount -o noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard,wait,resize,forceencrypt=footer,quota /dev/block/bootdevice/by-name/userdata /data \\\ mount: mounting /dev/block/bootdevice/by-name/userdata on /data failed: Device or resource busy

Many thanks guys!! :)