[Redmi 7A Guides, News, & Discussion] hydroponics_1:
I have unlocked my redmi 7A using unlock tool provided by Xiomi.

I can boot TWRP by:

adb reboot-bootloader
fastboot flash recovery 'TWRP-3.3.1-1003-REDMI7A-CN-wzsx150.img'
fastboot reboot

and holding volume key. ( up or down I don't remember)

I also flashed vbmeta to Disable VerifiedBoot:

fastboot flash --disable-verification vbmeta vbmeta.img

because I was modifying /vendor

Now redmi 7A was running twrp and was connected to my ubuntu PC using USB cable.

On PC I typed:

adb shell

now I got root shell. I created a directory in /mnt to mount /vendor partition.

# mkdir /mnt/dirName
# mount /dev/block/mmcblk0p58 /mnt/dirName

How did I know that /dev/block/mmcblk0p58 was /vendor? Previously I had copied all of phone's emmc flash disk to PC by:

** On PC **

adb pull /dev/block/mmcblk0

I mounted mmcblk0 image file using:

root@username-My-PC:/home/username# losetup --show --nooverlap --partscan --find '/path/to/mmcblk0'

** output **

/dev/loop20

got partition table information using:

** On PC **

root@username-My-PC:/home/username# gdisk /dev/loop20

Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p

Number Start (sector) End (sector) Size Code Name

1 40 55 8.0 KiB A029 fsc

2 56 71 8.0 KiB A02C ssd

3 72 87 8.0 KiB A024 dpo

4 88 119 16.0 KiB A01D sec

5 120 183 32.0 KiB A01A DDR

6 184 247 32.0 KiB A040 limits

7 248 311 32.0 KiB FFFF config

8 312 383 36.0 KiB 8300 bk1

9 384 511 64.0 KiB 8300 bk2

10 512 639 64.0 KiB FFFF vbmeta

11 640 767 64.0 KiB 0700 vbmetabak

12 768 1023 128.0 KiB 8300 bk3

13 1024 1535 256.0 KiB FFFF devcfg

14 1536 2047 256.0 KiB FFFF devcfgbak

15 2048 2559 256.0 KiB A022 apdp

16 2560 3071 256.0 KiB A023 msadp

17 3072 4095 512.0 KiB A012 sbl1

18 4096 5119 512.0 KiB 0700 sbl1bak

19 5120 6143 512.0 KiB A018 rpm

20 6144 7167 512.0 KiB 0700 rpmbak

21 7168 8191 512.0 KiB 0700 mota

22 8192 9215 512.0 KiB A02D keystore

23 9216 10239 512.0 KiB A018 syscfg

24 10240 12287 1024.0 KiB FFFF cmnlib

25 12288 14335 1024.0 KiB FFFF cmnlibbak

26 14336 16383 1024.0 KiB FFFF cmnlib64

27 16384 18431 1024.0 KiB FFFF cmnlib64bak

28 18432 20479 1024.0 KiB FFFF keymaster

29 20480 22527 1024.0 KiB FFFF keymasterbak

30 22528 24575 1024.0 KiB A01F misc

31 24576 26623 1024.0 KiB A015 aboot

32 26624 28671 1024.0 KiB 0700 abootbak

33 28672 30719 1024.0 KiB FFFF dip

34 30720 32767 1024.0 KiB 8300 bk4

35 32768 36863 2.0 MiB A016 tz

36 36864 40959 2.0 MiB 0700 tzbak

37 40960 49151 4.0 MiB 0700 mcfg

38 49152 65535 8.0 MiB A03A devinfo

39 65536 81919 8.0 MiB FFFF dtbo

40 81920 98303 8.0 MiB 0700 dtbobak

41 98304 114687 8.0 MiB A027 modemst1

42 114688 131071 8.0 MiB A028 modemst2

43 131072 147455 8.0 MiB A02A fsg

44 147456 163839 8.0 MiB 8300 bk5

45 163840 196607 16.0 MiB A036 splash

46 196608 229375 16.0 MiB 0700 dsp

47 229376 262143 16.0 MiB 0700 dspbak

48 262144 327679 32.0 MiB A026 persist

49 327680 393215 32.0 MiB A026 persistbak

50 393216 458751 32.0 MiB FFFF mdtp

51 458752 524287 32.0 MiB FFFF mdtpbak

52 524288 655359 64.0 MiB A036 boot

53 655360 786431 64.0 MiB A025 recovery

54 786432 917503 64.0 MiB FFFF logdump

55 917504 1441791 256.0 MiB A039 cache

56 1441792 1703935 128.0 MiB 0700 modem

57 1703936 7995391 3.0 GiB A038 system

58 7995392 10092543 1024.0 MiB A038 vendor

59 10092544 11141119 512.0 MiB A03A cust

60 11141120 11272191 64.0 MiB 8300 userdata

Command (? for help): q

root@username-My-PC:/home/username#

you may observe that size of userdata is 64MB that is because I resized the image to reduce it's size.

from above we can see that /vendor is partition 58 that is /dev/block/mmcblk0p58

after mounting I edited /vendor/etc/fstab.qcom using nano

** On redmi 7A:

# nano /mnt/dirName/etc/fstab.qcom

I changed

/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,fileencryption=ice,quota,reservedsize=128M

to

# /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,fileencryption=ice,quota,reservedsize=128M

/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,quota,reservedsize=128M

notice that I have also removed fileencryption=ice mount option to disable encryption.

I also changed

/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

to

# /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

to disable mountng of fat32 partition on sdcard as external sdcard

I inserted 128gb microSD card ( class 10 ) into USB card reader and connected the card reader to Ubuntu PC. created GPT patition table on microSD. left 16 GB space at begining of microSD empty so that ext4 fs is aligned with flash storage blocks. created 1 fat32 partition and 1 ext4 partition on sdcard.

after editing fstab I unmounted /vendor and turned off the phone using:

# poweroff

Inserted microSD into phone and turned on. It took few minutes on first boot.

On setup screen do not enter lockscreen password or pattern. because Phone shows incorrect password even if password is correct. I was locked out of my phone because of password error. I had to delete some file/ files ( I don't remember filename ) from /data by connecting microSDcard to pc to remove screen lock.

Microsd card is slightly slower that emmc nand. I have noticed that the phone took slightly longer to start a game after moving /data to microSD. I am on stock rom and haven't updated after fstab modification. Sometimes there is "Updater has stopped" error 1 or 2 minutes after boot.

Pros:

prevents damage to EMMC NAND caused by writes as most reads/writes are from microSD.

easly increase storage by using larger sdcard.

Cons:

cannot use screen lock. phone will be unlocked always.

Phone may have issues after OS update. Or can't update at all. (I have not updated so cann't say)

stock fstab file:

###################################################################################################

# 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 / ext4 ro,barrier=1,discard wait,avb

/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,fileencryption=ice,quota,reservedsize=128M

/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 /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:eek:bject_r:firmware_file:s0 wait

/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait

/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait

###################################################################################################

Modified fstab file:

###################################################################################################

# 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 / ext4 ro,barrier=1,discard wait,avb

# /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,fileencryption=ice,quota,reservedsize=128M

/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,quota,reservedsize=128M

# /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 /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:eek:bject_r:firmware_file:s0 wait

/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait

/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait

###################################################################################################

View attachment 5187549