text:
how to extend support for EXT4 file system for microSD cards in stock or non lineage / CyanogenMod ROMS
As  I am aware after Android 4.4 or some sort your storage card is no longer eXposed directly and needs to be carefully interfaced through specific Mount points that need to be aware through vold  system

My question is given this situation and the fact that ext4 is very complicated in terms of of access and especially with now SeLinux sitting on top of it
it is somehow still possible to render ext4 support when it did not exist initialy as has been the case for lineage and previous similar OS's
that would be the case if the mount points  are created at boot time and then vold is made aware of them

what I did
since I am rooted ( magisk ) I use su mount master and mounted these manually but trying to then use vold failed because it was too late
I found some articles about how how this was achieved in earlier Android versions upto 5.
after 7.6 Android world has become even more paranoid on security and seLINUX couldn't have been more fussier
from 7.x onwards Android versions I would like to know if there is a definitive guide about how this can be done .I do not mind recompiling this feature in the kernel. this is a far more rewarding investment then trying to look for custom ROMs and moving away from stock just because you want EXT4support

so how do I I add
EXT4support on stock  and similar ROMs
for Android versions > 7.x and do this the right way where all apps can access my partitions. all my partitions are
EXT4 this is quite in contrast to the the second partition app2sd approach that is used to save space. of course I have that as well but I have two more partitions used for extSD ( main external data storage partition ) and one devoted to to another app. totally 3
EXT4 partitions . first one is the main data partition ,2nd is app2sd and third is a special partition devoted to one app.
if it matters I am rooted on a Samsung device running stock nougat 7.x.
another thing that I observed and I will update the question accordingly is all of a sudden out of nowhere  partitions mounted under /storage are now read only earlier they were not so. I can still read write to them through /mnt/media_rw I wonder what went wrong because lot of apps depend on accessing my partitions through /storage Mount point.
So just to summarise here  are the questions:

Mount multi ext4 partitioned external card at boot time, as against manual mounting which I can do.
Mount it the correct way with the right group ID, so that vold gets to know it has been mounted and all apps and process can freely access the partition.
All external partitions under /storage suddenly became read only (internal memory partition is of course read write always). tune2fs confirmed that all partitions are clean. Why does this happen and how can it be fixed?

thanks for response. I put this question that sounded like a narrative since I did not have screenshots or logs at hand if that is what you meant in your opening comment in answer. So here's what I am trying to achieve but run into all kinds of errors.
 1) Mount mmck1p2 to /data/sdext2 and I keep getting error failed to mount ...mmcblk1p2 on .....invalid argument  & another similar line  failed..... /dev/block/vold/public on .... invalid args. that is via app2sd and my magisk has global option turned on
the same partition is already  mounted  at boot under media_rw and storage

Bind mounting  camera DCIM and many other folders in internal storage  fails  when   target  is /storage/part# & it  earlier worked well. My partitions are clean as per tune2fs report . What happened ?
Thanks again. Answering  your Q's here :
1) What are currently mounted filesystems (output of mount)?

o/p is too big to fit in here. PFA
2) Output of /system/bin/id?
for  normal user
uid=10112(u0_a112) gid=10112(u0_a112) groups=10112(u0_a112),1015(sdcard_rw),1023(media_rw),1028(sdcard_r),3003(inet),9997(everybody),50112(all_a112) context=u:r:untrusted_app:s0:c512,c768

3) What command exactly did you use to mount mmck1p2 to /data/sdext2? 4) What command exactly did you use to bind mount DCIM folder?

1   mount -o,rw /dev/block/mmcblk1p1 /storage/extsd
2   lp=/sdcard/logger.txt
4   ls./mnt/media_rw
5   ls /mnt/media_rw
6   mkdir -p $_/extsd
7   mount --bind /storage/extsd  $_
8   ls $_

with above run from terminal I am able to see files from terminal only. if run from adb I get the same situation . Thought adb would be persistent but ain't the case.
after that I tried to invoke vold with the hope it would make my mount persistent and visible but no  luck there either
dreameltemtr:/ # /system/bin/vold
/system/bin/vold
Aborted
134|dreameltemtr:/ # /system/bin/vold --blkid_context=u:r:blkid:s0 --blkid_untrusted_context=u:r:blkid_untrusted:s0 --fsck_context=u:r:fsck:s0 --fsck_untrusted_context=u:
r:fsck_untrusted:s0
ntext=u:r:fsck:s0 --fsck_untrusted_context=u:r:fsck_untrusted:s0              <
SELinux selinux_android_compute_policy_index : Policy Index[2],  Con:u:r:magisk:s0 RAM:SEPF_SECMOBILE_7.1.1_0003, [-1 -1 -1 -1 0 1]

also to mount partition # 2 via app2sd  there is a mount script that  the app writes to /system/bin/etc or /data/app2sd dir's depending on the opts you choose. It uses the similar approach except that
-- I used its own binary for the bind mount functionality
-- I will do periodic tests to see if certain partitions get mounted
-- It will run these periodically ( kind of patched many scripts together  ) hoping that one will work
-- I attempts to mount via block device  ( /dev/block/mmcxxx) as well as vold ( /dev/block/vold/nnn)

Here is that script & you will see what I just said  . Again PFA since there is a ceiling to max chars on a post.
4) What are exact error messages? –
 exact messsages are 2 lines  from app2sd gui attention box
- Failed to mount /dev/block/ mmcblk1p2 to /data/sdext2 invalid argument

- Failed to mount /dev/block/vold/public/179:34 to /data/sdext2 invalid argument

On the last part where I cant write to external partitions mounted under /storage
That instance of ROM install was abortive . It caused repeated boot-loops after 10 mins so I just restored my Nandroid backup. So I cant dig out more details .

You can format external SD card as ext4 and mount it manually wherever you want. ext4 support is present on every ROM - stock or custom - since the first release of Android. What exactly your question is?

Thank you for responding Irfan I can found it manually as I have written so

Thank you for responding Irfan I can found it manually as I have written so . There are 3 questions sorry if it was not clear 1 ) it needs to mount at boot time and read write 2 ) the mounting information needs to be transferred so as to say to v o l d process so all other processes and apps can access that external data storage partition

3 ) another thing that I observed and I will update the question accordingly is all of a sudden out of nowhere  partitions mounted under /storage are now read only earlier they were not so. I can still read write to them through /mnt/media_rw I wonder what went wrong because lot of apps depend on accessing my partitions through /storage Mount point.

please clarify if you looking for non-rooted solution. i guess your problem isn't the file system it is more related to app permissions. have a look at https://android.stackexchange.com/search?q=WRITE_EXTERNAL_STORAGE

@user1874594 1) What are currently mounted filesystems (output of mount)? 2) Output of /system/bin/id? 3) What command exactly did you use to mount mmck1p2 to /data/sdext2? 4) What command exactly did you use to bind mount DCIM folder? 5) What are exact error messages?

THanks again Irfan Theres a mount script that I will put out in the question. and also o/p of mount

added more details you asked for Irfan- Thanks !

@ALex thank you again. This ROM is permissive right out of the box

thanks  folks for your help. I finally got the mounting  to happen using

thanks  folks for your help. I finally got the mounting  to happen using fbind magisk module but it would not happen straight away. had to open the the script which was full of functions and one of the functions looked for Mount media read write  as a mountaing pt In /proc /partitions.  & it never came out to be true with a time out of 1800 s.this function had to be to tweaked so that the result will be true when ,/mnt was mounted  and then the Mounting would happen.  hopefully the time I have invested in all this will pay off with this same module being used every time I  face this !

I don't think I understand your question fully. It's not clear what and how you have tried so far and faced what constraints or limitations in achieving what you want to. But precisely answering your questions:

Mount multi ext4 partitioned external card at boot time, as against manual mounting which I can do

Mounting external SD card is handled by vold. You can disable that in fstab and define an init service or put an init.d script to mount the partitions on boot the way you want.

Mount it the correct way with the right group ID, so that vold gets to know it has been mounted and all apps and process can freely access the partition

Since Android 6, in Portable Storage mode, vold mounts external SD card at /mnt/media_rw/[UUID] and then emulates that to /storage/[UUID]. Apps with WRITE_MEDIA_STORAGE permission (which is mapped to GID media_rw (1023)) have filesystem level write access to external SD card. But third party apps cannot write to SD card because the said permission has signature|privileged protection level. Emulation makes it possible for apps to read whole SD card but write only to their private directories. Also apps may use Android APIs (like SAF) to save files on SD card. See details in How to move files to external SD card?
This whole phenomenon is deeply integrated in Android framework - Java and native. So if you want to change this behavior, you need to modify Android source and rebuild ROM. Or don't rely on vold and mount partitions yourself with correct permissions as I mentioned earlier.

All external partitions under /storage suddenly became read only

There can be multiple possible reasons, you can check kernel log or Android log to see what exactly happens when you do mount -o rw,remount. Mounting read-only can be a sign of errors due to flash chip degradation. Or may be the partition(s) simply reached their maximum mount count, so you need to run fsck.

THanks for replying. I gave these details you asked for much as I could  dig em out.  What I want to get from all this is on a ROM  that does not support ext4  for  sdcard  like CM or Lineage , how can I have this functionality so that every time I dont have to flash a new Lineage ROM & then deal with its other short comings. Hope i am clear by now. Now for this instance I dont see /etc/init.d folder there is a init folder & even if I remount rw. Reboot will del scripts . i can put them in xbin but not sure if they will be executed.


text:
/data's data is garbled in TWRP. How to decrypt
So  this is quite another android story but I promise to keep is as short n dry as poss.
The issue was some of my Apps weren't able to access  /extsd folders with non root & so I deicided to give magisk module app systematizer a shot. With that also installed Pixel3fy  ( or whatever heck its called ) & & Viper4Android
 I dunno if that has any bearing. Removed Pixel after I booted on a blank screen and data got encrypted ( due to that Pixel Mod ? No sure. I can mount /data but all file names under L1 folders are encrypted aka garbled  ) . I am running  Q Havoc on top of TWRP  on Qualcomm chip mobile . Earlier , TWRP would ask me my pattern and decrypt /data and /system and I had access to these via TWRP. Now ( related to Mod installation ? ), it does NOT ask me for pattern and I can mount these partitions but they remain encrypted. I want my internal data . So Format /data is not an op.
What I did:
-- reinstalled this TWRP + Vmeta via Fastboot.( hoping that the pattern will come back again but went futile ) After that no OS load. Just reboots to TWRP
-- Followed this by installing boot.img + magisk zip again and Disable_Dm-Verity_ForceEncrypt zip

after all this it could BOOT TO LOGO and then HANGS ON LOGO
Questions :
-- How do I get TWRP to decrypt /data ( esp int. storage ) .After that I dont mind doing a fresh install after /data format . I want my int data.
--alternatively how can I successfully boot any way so I can backup my internal data
-- take a look at this, where he says you can  decrypt data by backup --> format --> restore. But /data is encrypted so backup and restore ...isn't it futile ? if I backup this data some form. My understanding is that its useless cos its encrypted and  restore will be fruitless since the data is encrypted with Unlock pin + key stored in Meta partition. I dont have any more backup. My last Nandroid was of stock rom. The /recovery /vendor  are same /system and /data are not. I in fact tried /recovery Nandroid restore - no use

After that I  can do a 'format' and get my OS working.

A subtle clarification. Once I removed the Pix3ly module I could boot the phone. TWRP  would not decrypt data after I tried command line
adb decrypt twrp <pattern>

I  thoughtlessly shot myself in the foot by not backing up  my partitions via TWRP and ended up doing a TWRP reinstall, which is when I got stuck-> will only boot to recovery --> ( flashboot boot.img + Magisk ) --> Now it will not reboot to recovery but stuck at Logo. Thats where I am now.
So yes any potentially offending module was removed  and that got me to boot but TWRP re-installation hosed everything. Desperate not to loose data I installed orange fox recovery to see if that can decrypt ( of course never had hi Hopes ) and still no light .  stock recovery cant handle Havoc. Stock ROM is Pie and this is Q so that wont match and even then issue is /data is not getting decrypted so any ROM wont boot is my humble , nimble  understanding but do let me know if there's something that can work
    Starting TWRP 3.3.1-milankragujevic_9.0_v1-8c0bcc8b on Sun May 31 06:29:22 1970
 (pid 406)
I:=> product model: 'Redmi (A'
I:=> using device id: 'Redmi_A'
BOARD_HAS_NO_REAL_SDCARD := true
RECOVERY_SDCARD_ON_DATA := true
I:Lun file '/sys/class/android_usb/android0/f_mass_storage/lun0/file' does not exist, USB storage mode disabled
TW_INCLUDE_CRYPTO := true
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Got max brightness 2047 from '/sys/class/leds/lcd-backlight/max_brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 2047
I:LANG: en
Starting the UI...
setting DRM_FORMAT_RGBX8888 and GGL_PIXEL_FORMAT_RGBX_8888
cannot find/open a drm device: No such file or directory
fb0 reports (possibly inaccurate):
  vi.bits_per_pixel = 32
  vi.red.offset   =   0   .length =   8
  vi.green.offset =   8   .length =   8
  vi.blue.offset  =  16   .length =   8
setting GGL_PIXEL_FORMAT_RGBA_8888
double buffered
framebuffer: 0 (720 x 1520)
Using fbdev graphics.
I:TWFunc::Set_Brightness: Setting brightness control to 2047
I:Loading package: splash (/twres/splash.xml)
I:Load XML directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/splash.xml' directly
I:Checking resolution...
I:Scaling theme width 0.666667x and height 0.791667x, offsets x: 0 y: 0 w: 0 h: 0
I:Loading resources...
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Loading page splash
I:Switching packages (splash)
=> Linking mtab
=> Processing /etc/recovery.fstab
I:Reading /etc/recovery.fstab
I:Processing '/boot'
I:Processing '/recovery'
I:Processing '/system_root'
I:Created '/system_root' folder.
I:Processing '/system_image'
I:Processing '/vendor'
I:Processing '/vendor_image'
I:Processing '/data'
I:Processing '/cache'
I:Processing '/cust'
I:Created '/cust' folder.
I:Processing '/misc'
I:Processing '/external_sd'
I:Created '/external_sd' folder.
I:Done processing fstab files
I:Setting up '/data' as data/media emulated storage.
I:mount -o bind '/data/media' '/sdcard' process ended with RC=0
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:File Based Encryption is present
e4crypt_initialize_global_de
Determining wrapped-key support for /data
fbe.data.wrappedkey = false
calling retrieveAndInstallKey
Key exists, using: /data/unencrypted/key
Using Keymaster HAL: 4 from QTI for encryption.  Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@4.0::IKeymasterDevice/default
begin failed, code -62
Upgrading key in memory only: /data/unencrypted/key
upgrade_key failed, code -38
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de
Determining wrapped-key support for /data
fbe.data.wrappedkey = false
calling retrieveAndInstallKey
Key exists, using: /data/unencrypted/key
Using Keymaster HAL: 4 from QTI for encryption.  Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@4.0::IKeymasterDevice/default
begin failed, code -62
Upgrading key in memory only: /data/unencrypted/key
upgrade_key failed, code -38
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de
Determining wrapped-key support for /data
fbe.data.wrappedkey = false
calling retrieveAndInstallKey
Key exists, using: /data/unencrypted/key
Using Keymaster HAL: 4 from QTI for encryption.  Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@4.0::IKeymasterDevice/default
begin failed, code -62
Upgrading key in memory only: /data/unencrypted/key
upgrade_key failed, code -38
e4crypt_initialize_global_de returned fail
I:Setting up '/data' as data/media emulated storage.
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/Redmi_A'
I:Settings storage is '/data/media/0'
I:Decrypt adopted storage starting
I:PageManager::LoadFileToBuffer loading filename: '/data/system/storage.xml' directly
I:No /data/system/storage.xml for adopted storage
Updating partition details...
I:App found at '/system_root/system/priv-app/twrpapp'
I:Data backup size is 9887MB, free: 9730MB.
...done
I:Unmounting main partitions...

Partition Logs:
/boot | /dev/block/mmcblk0p52 | Size: 64MB
   Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
   Primary_Block_Device: /dev/block/mmcblk0p52
   Display_Name: Boot
   Storage_Name: boot
   Backup_Path: /boot
   Backup_Name: boot
   Backup_Display_Name: Boot
   Storage_Path: /boot
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/recovery | /dev/block/mmcblk0p53 | Size: 64MB
   Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
   Primary_Block_Device: /dev/block/mmcblk0p53
   Display_Name: Recovery
   Storage_Name: recovery
   Backup_Path: /recovery
   Backup_Name: recovery
   Backup_Display_Name: Recovery
   Storage_Path: /recovery
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/system_root | /dev/block/mmcblk0p59 | Size: 4092MB Used: 1453MB Free: 2638MB Backup Size: 1453MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent Mount_Read_Only
   Primary_Block_Device: /dev/block/mmcblk0p59
   Display_Name: System
   Storage_Name: System
   Backup_Path: /system_root
   Backup_Name: system_root
   Backup_Display_Name: System
   Storage_Path: /system_root
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files

/system_image | /dev/block/mmcblk0p59 | Size: 4096MB
   Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
   Primary_Block_Device: /dev/block/mmcblk0p59
   Display_Name: System Image
   Storage_Name: System Image
   Backup_Path: /system_image
   Backup_Name: system_image
   Backup_Display_Name: System Image
   Storage_Path: /system_image
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/vendor | /dev/block/mmcblk0p60 | Size: 975MB Used: 672MB Free: 303MB Backup Size: 672MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent Mount_Read_Only
   Primary_Block_Device: /dev/block/mmcblk0p60
   Display_Name: Vendor
   Storage_Name: Vendor
   Backup_Path: /vendor
   Backup_Name: vendor
   Backup_Display_Name: Vendor
   Storage_Path: /vendor
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files

/vendor_image | /dev/block/mmcblk0p60 | Size: 1024MB
   Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
   Primary_Block_Device: /dev/block/mmcblk0p60
   Display_Name: Vendor Image
   Storage_Name: Vendor Image
   Backup_Path: /vendor_image
   Backup_Name: vendor_image
   Backup_Display_Name: Vendor Image
   Storage_Path: /vendor_image
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/data | /dev/block/mmcblk0p62 | Size: 21916MB Used: 9887MB Free: 9730MB Backup Size: 9887MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage
   Symlink_Path: /data/media/0
   Symlink_Mount_Point: /sdcard
   Primary_Block_Device: /dev/block/mmcblk0p62
   Crypto_Key_Location: footer
   Display_Name: Data
   Storage_Name: Internal Storage
   Backup_Path: /data
   Backup_Name: data
   Backup_Display_Name: Data
   Storage_Path: /data/media/0
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files
   MTP_Storage_ID: 65537

/cache | /dev/block/mmcblk0p57 | Size: 355MB Used: 0MB Free: 355MB Backup Size: 0MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent
   Primary_Block_Device: /dev/block/mmcblk0p57
   Display_Name: Cache
   Storage_Name: Cache
   Backup_Path: /cache
   Backup_Name: cache
   Backup_Display_Name: Cache
   Storage_Path: /cache
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files

/cust | /dev/block/mmcblk0p61 | Size: 802MB Used: 298MB Free: 503MB Backup Size: 298MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent
   Primary_Block_Device: /dev/block/mmcblk0p61
   Display_Name: Custom
   Storage_Name: Custom
   Backup_Path: /cust
   Backup_Name: cust
   Backup_Display_Name: Custom
   Storage_Path: /cust
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files

/misc | /dev/block/mmcblk0p30 | Size: 1MB
   Flags: IsPresent
   Primary_Block_Device: /dev/block/mmcblk0p30
   Display_Name: misc
   Storage_Name: misc
   Backup_Path: /misc
   Backup_Name: misc
   Backup_Display_Name: misc
   Storage_Path: /misc
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/external_sd | /dev/block/mmcblk1p1 | Size: 30161MB Used: 11029MB Free: 19131MB Backup Size: 11029MB
   Flags: Can_Be_Mounted Can_Be_Wiped Wipe_Available_in_GUI Removable IsPresent Is_Storage
   Primary_Block_Device: /dev/block/mmcblk1p1
   Display_Name: External SD
   Storage_Name: External SD
   Backup_Path: /external_sd
   Backup_Name: external_sd
   Backup_Display_Name: External SD
   Storage_Path: /external_sd
   Current_File_System: f2fs
   Fstab_File_System: vfat
   Backup_Method: files
   MTP_Storage_ID: 65538

I:Loading package: TWRP (/data/media/0/TWRP/theme/ui.zip)
I:Loading zip theme
I:Loading package: TWRP (/twres/ui.xml)
I:Load XML directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/cz.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/de.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/el.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/es.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/fr.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/hu.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/it.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/nl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/pl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/pt_BR.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/pt_PT.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/ru.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sk.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sv.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/tr.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/uk.xml' directlyparsing languageFileparsing languageFile done
I:PageManager::LoadFileToBuffer loading filename: '/twres/ui.xml' directly
I:Checking resolution...
I:Scaling theme width 0.666667x and height 0.791667x, offsets x: 0 y: 0 w: 0 h: 0
I:Loading resources...
I:Failed to load image from indeterminate013, error -1
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Including file: /twres/portrait.xml...
I:PageManager::LoadFileToBuffer loading filename: '/twres/portrait.xml' directly
I:Loading resources...
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Loading page main
I:Loading page main2
I:Loading page install
I:Loading page flash_confirm
I:Loading page flash_zip
I:Loading page flash_done
I:Loading page flash_sleep_and_reboot
I:Loading page flashimage_confirm
I:Loading page clear_vars
I:Loading page reboot_system_routine
I:Loading page confirm_action
I:Loading page action_page
I:Loading page singleaction_page
I:Loading page action_complete
I:Loading page filecheck
I:Loading page rebootcheck
I:Loading page appcheck
I:Loading page wipe
I:Loading page advancedwipe
I:Loading page formatdata
I:Loading page formatdata_confirm
I:Loading page checkpartitionlist
I:Loading page partitionoptions
I:Loading page refreshfilesystem
I:Loading page selectfilesystem
I:Loading page backup
I:Loading page backup_options
I:Loading page backupname1
I:Loading page backupname2
I:Loading page backupencryption
I:Loading page backupencryption2
I:Loading page checkbackuppassword
I:Loading page backup_run
I:Loading page restore
I:Unable to open '/data/media/0/TWRP/BACKUPS/Redmi_A'
I:Loading page restore_read
I:Loading page restore_decrypt
I:Loading page try_restore_decrypt
I:Loading page restore_select
I:Loading page renamebackup
I:Loading page restore_run
I:Loading page mount
I:Loading page usb_mount
I:Loading page usb_umount
I:Loading page system_readonly_check
I:Loading page reboot
I:Loading page rebootapp
I:Loading page system_readonly
I:Loading page settings
I:Loading page settings_timezone
I:Loading page settings_screen
I:Loading page settings_vibration
I:Loading page settings_language
I:Loading page copylog
I:Loading page advanced
I:Loading page partsdcardsel
I:Loading page partsdcardcheck
I:Loading page partsdcard
I:Loading page htcdumlock
I:Loading page repackselect
I:Loading page repackconfirm
I:Loading page lock
I:Loading page filemanagerlist
I:Loading page filemanageroptions
I:Loading page choosedestinationfolder
I:Loading page filemanagerrenamefile
I:Loading page filemanagerrenamefolder
I:Loading page filemanagerchmod
I:Loading page filemanagerconfirm
I:Loading page filemanageraction
I:Loading page decrypt
I:Loading page decrypt_pattern
I:Loading page trydecrypt
I:Loading page terminalcommand
I:Loading page sideload
I:Loading page fixcontexts
I:Loading page slideout
I:Loading page select_storage
I:Loading page select_language
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Switching packages (TWRP)
Startup Commands:
ro.boottime.adbd=3507457029
ro.boottime.init=3078
ro.boottime.init.selinux=111
ro.boottime.init.cold_boot_wait=181
ro.boottime.logd=3484639790
ro.boottime.ueventd=3290798384
ro.boottime.qseecomd=3514871769
ro.boottime.recovery=3488612394
ro.boottime.keymaster-4-0=3581855571
ro.boottime.gatekeeper-1-0=3582846248
ro.boottime.servicemanager=3583835988
ro.boottime.set_permissive=3487782759
ro.boottime.hwservicemanager=3476452186
ro.config.ringtone=omni_ringtone1.ogg,omni_ringtone1.ogg
ro.config.alarm_alert=omni_alarm1.ogg
ro.config.notification_sound=omni_notification1.ogg
dalvik.vm.isa.arm.variant=cortex-a15
dalvik.vm.isa.arm.features=default
dalvik.vm.dexopt.secondary=true
dalvik.vm.usejit=true
dalvik.vm.lockprof.threshold=500
dalvik.vm.dex2oat-Xms=64m
dalvik.vm.dex2oat-Xmx=512m
dalvik.vm.appimageformat=lz4
dalvik.vm.usejitprofiles=true
dalvik.vm.stack-trace-dir=/data/anr
dalvik.vm.image-dex2oat-Xms=64m
dalvik.vm.image-dex2oat-Xmx=64m
dalvik.vm.image-dex2oat-filter=verify-at-runtime
dalvik.vm.dex2oat-minidebuginfo=true
debug.atrace.tags.enableflags=0
ro.art.hiddenapi.warning=1
ro.com.google.clientidbase=android-google
ro.com.android.wifi-watchlist=GoogleGuest
ro.opa.eligible_device=true
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.boot.dp=0x0
ro.boot.emmc=true
ro.boot.efuse=1
ro.boot.console=ttyMSM0
ro.boot.selinux=permissive
ro.boot.baseband=msm
ro.boot.configfs=true
ro.boot.dtbo_idx=6
ro.boot.hardware=qcom
ro.boot.keymaster=1
ro.boot.bootdevice=7824900.sdhci
ro.boot.secureboot=1
ro.boot.avb_version=1.1
ro.boot.usbconfigfs=true
ro.boot.verifiedbootstate=orange
ro.omni.device=olivelite
ro.omni.version=9-20191120-olivelite-HOMEMADE
ro.omni.version.security_patch=
ro.twrp.boot=1
ro.twrp.version=3.3.1-milankragujevic_9.0_v1
ro.vndk.lite=true
ro.vndk.version=28
ro.wifi.channels=
ro.allow.mock.location=1
ro.build.id=PQ3B.190801.002
ro.build.date=Wed Nov 20 16:49:01 CET 2019
ro.build.date.utc=1574264941
ro.build.host=milan-laptop
ro.build.tags=test-keys
ro.build.type=eng
ro.build.user=milan
ro.build.flavor=omni_olivelite-eng
ro.build.display.id=omni_olivelite-eng 9 PQ3B.190801.002 eng.milan.20191120.164901 test-keys
ro.build.product=olivelite
ro.build.selinux=1
ro.build.version.sdk=28
ro.build.version.base_os=
ro.build.version.release=9
ro.build.version.codename=REL
ro.build.version.incremental=eng.milan.20191120.164901
ro.build.version.preview_sdk=0
ro.build.version.all_codenames=REL
ro.build.version.security_patch=2099-12-31
ro.build.version.min_supported_target_sdk=17
ro.build.description=omni_olivelite-eng 9 PQ3B.190801.002 eng.milan.20191120.164901 test-keys
ro.build.characteristics=default
ro.bionic.ld.warning=1
ro.kernel.android.checkjni=1
ro.secure=0
ro.treble.enabled=true
ro.zygote=zygote32
ro.product.cpu.abi=armeabi
ro.product.cpu.abilist=armeabi
ro.product.cpu.abilist32=armeabi
ro.product.cpu.abilist64=
ro.product.name=omni_olivelite
ro.product.brand=Xiaomi
ro.product.model=Redmi (A
ro.product.device=olivelite
ro.product.locale=en-US
ro.product.manufacturer=Xiaomi
ro.baseband=msm
ro.bootmode=unknown
ro.hardware=qcom
ro.revision=0
ro.services.whitelist.packagelist=com.google.android.gms
ro.bootimage.build.date=Wed Nov 20 16:49:01 CET 2019
ro.bootimage.build.date.utc=1574264941
ro.bootimage.build.fingerprint=Xiaomi/omni_olivelite/olivelite:9/PQ3B.190801.002/milan11201649:eng/test-keys
ro.bootloader=unknown
ro.debuggable=1
ro.modversion=OmniROM-9-20191120-olivelite-HOMEMADE
ro.setupwizard.enterprise_mode=1
ro.property_service.version=2
ro.control_privapp_permissions=enforce
ro.actionable_compatible_property.enabled=false
init.svc.adbd=running
init.svc.logd=running
init.svc.ueventd=running
init.svc.qseecomd=running
init.svc.recovery=running
init.svc.keymaster-4-0=running
init.svc.gatekeeper-1-0=running
init.svc.servicemanager=running
init.svc.set_permissive=stopped
init.svc.hwservicemanager=running
twrp.crash_counter=0
twrp.action_complete=0
crypto.ready=1
tombstoned.max_tombstone_count=50
sys.usb.ffs.ready=1
ro.build.fingerprint=Xiaomi/omni_olivelite/olivelite:9/PQ3B.190801.002/milan11201649:eng/test-keys
hwservicemanager.ready=true
log.tag.stats_log=I
ro.logd.size.stats=64K
ro.persistent_properties.ready=true
pm.dexopt.boot=extract
pm.dexopt.ab-ota=speed-profile
pm.dexopt.shared=speed
pm.dexopt.install=speed-profile
pm.dexopt.inactive=verify
pm.dexopt.bg-dexopt=speed-profile
pm.dexopt.first-boot=extract
ro.boot.serialno=39b2a4210606
ro.serialno=39b2a4210606
service.adb.root=1
net.bt.name=Android
net.tethering.noprovisioning=true
sys.usb.state=mtp,adb
sys.usb.controller=msm_hsusb
persist.sys.usb.config=adb
persist.sys.dalvik.vm.lib.2=libart.so
persist.sys.disable_rescue=true
sys.usb.config=mtp,adb
ro.vendor.build.security_patch=2099-12-31
vendor.sys.listeners.registered=true
ro.crypto.type=file
ro.crypto.state=encrypted

SELinux contexts loaded from /file_contexts
Full SELinux support is present.
tw_get_context got selinux context: u:object_r:media_rw_data_file:s0
I:Got default contexts and file mode for storage files.
I:TWFunc::Fixup_Time: Pre-fix date and time: 1970-05-31--06-29-29
I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch
I:TWFunc::Fixup_Time: will attempt to use the ats files now.
I:TWFunc::Fixup_Time: no ats files found, leaving untouched!
I:Copied file /cache/recovery/log.gz to /cache/recovery/last_log.gz
I:Attempt to load settings from settings file...
I:InfoManager file '/data/media/0/TWRP/.twrps' not found.
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/Redmi_A'
I:Mount: Unable to find partition for path '/etc'
I:Copied file /etc/recovery.fstab to /cache/recovery/recovery.fstab
I:Version number saved to '/cache/recovery/.version'
I:TWFunc::Set_Brightness: Setting brightness control to 2047
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
parsing languageFile
parsing languageFile done
I:Translating partition display names
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/Redmi_A'
I:Starting MTP
I:sending message to add 65537 '/data/media/0' 'Internal Storage'
I:Message sent, add storage ID: 65537 '/data/media/0'
I:sending message to add 65538 '/external_sd' 'Micro SD card'
I:Message sent, add storage ID: 65538 '/external_sd'
MTP Enabled
I:[MTP] Starting MTP
I:Switching packages (TWRP)
I:Set page: 'system_readonly'
I:[MTP] created new mtpserver object
I:[MTP] mtppipe add storage 65537 '/data/media/0'
E:[MTP] Failed to start usb driver!I:[MTP] mtppipe add storage 65538 '/external_sd'
I:operation_start: 'Toggle System Mount'
I:operation_end - status=0
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Switching packages (TWRP)
I:Starting Adb Backup FIFO
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 2047
I:Set page: 'advanced'
I:Set page: 'filemanagerlist'
I:Set page: 'filemanageroptions'
I:Set page: 'filemanagerlist'
I:Set page: 'advanced'
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
E:[MTP] request read returned -1, errno: 5I:Set page: 'install'
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0
I:TWFunc::Set_Brightness: Setting brightness control to 2047
I:Set overlay: ''
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0

decryption relies on rom and firmware, in your case FBE uses login credentials from /data/misc/keystore and /data/system/locksettings.db you must restore and flash the matching system vendor modem etc

The syntax for decrypting TWRP from a command prompt is from a root shell or with TWRP a shell in general. Like: decrypt password :
 # decrypt /data with provided password Specific pattern decrypt note
Use the table bellow to determine what your password will be: pattern logic here: https://twrp.me/faq/openrecoveryscript.html
Example: if your pattern is a "U" shape in the middle of the 5x5, enter twrp decrypt '7<ABC>9' in the terminal or ADB shell. Note that characters ;<>? are special to the shell and require backslash escaping or single quotes around the string.

Heyya thanks again.  I have /vendor /recovery  etc backed up from stock because even for custom rom they wont change ( backed up stock after TWRP Nandroid backup ) . I did restore /recovery /boot from  previous Nandroid and the phone will still hang on boot logo. I dont have /system and /data backed up for this custom ROM.But TWRP is concerned with recovery so if I re-installed TWRP how do did that put me in a  boot logo freeze. Also of course I tried the TWRP decrypt command line thing using TWRP's guide nothing worked.

That'd had needed PIN + Key and something ran amuck on the key after TWRP reinstall Anyway a DD copy is of no use unless the data is decrypted and it wont backup via Nandroid either. Had to let it go

I was in a similar issue on a Nokia running a stock ROM. Basically Magisk module killed my phone and the TWRP won't allow decryption.
I was able to boot successfully to system again by.. Removing Magisk, because in the absence of Magisk, the Magisk modules shouldn't load and hence the system should boot just fine. I did that by flashing my stock boot image. Then I took a backup and did a reset.
You didn't specify which device you're using. But on an A/B device you can flash your original boot image from Havoc (from the exact same build you're currently on -- in case you installed any updates) on the active boot slot (double check that the boot slot didn't change while phone was trying to boot and fell back to the other slot when the active couldn't boot.
For the boot image, it is important for it to be from the exact same build, except the mismatched "Android OS level and OS version" can cause the phone to not boot.

Thanks for wanting to help @Singh. Just updated my Q w comments I am on Redmi 8a

@user1874594 I couldn't figure out if the Redmi 8A is a project treble device and if it supports A/B partitions. Google is a tough place to find such info. You should still try booting your boot image from Havoc (matching the exact version that is currently installed on your phone) using - fastboot boot . If the boot image matches and the system is still capable of booting, it should go into Android system.

Redmi 8A is a project treble device yes. ' booting your boot image from Havoc' do you mean installation of Havoc again . I have a system image of havoc. that will sit in /system. I can install that via Recovrey. Oh and yes my previous Nandroid stock rom back up. I installed  /recovery from there. I didnt try /boot - would that help ?

@singhnsk Magisk will destroy FBE because there is no way to disable forceencrypt. unfortunately topjohnwu decided to destroy FDE also, if you want to disable forceencrypt for FDE you must use Magisk Manager v7.3.4. same bug is true for Zackptg5's Disable_Dm-Verity_ForceEncrypt

Howdy 'gain Alecxs. . To take home something - can I get access to decrypted  data ? ..should I Nandroid /data  ? and format proceed with rest OR there's nothing that can be done and I should save the sweat ---> format /data and do a fresh OS ?

how about this link https://forum.xda-developers.com/oneplus-3/how-to/unencrypt-oxygenos-loosing-data-t3412228  how could this be done when your backup itself is  encrypted

the backup itself is of course unencrypted. you can't create backup on encrypted undecrypted device. Your only chance left is to restore all necessary partitions like it was before

ok then its a dead horse - clean slate. Wish I had nandroided everytime I thought on going on an adventure. The only thing between non booting ( stuck logo) OS and booting OS was that TWRP re-install. What Happened ? does TWRP  reinstall  mess with the meta partition that stores the encrypted key. I am posting the recovery log if that helps tell a story for anyone whom this may help .

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How are apps installed on Android ? context - symbolic links of only some apps disappear after reboot
I am using Apps2sd to move some apps to ext4 partition mmcblk1p2. It successfully moved 1 app ( see code below ) but after linking  another , the symblink for app gets deleted but data folder's symblink preserved so after boot the apk ( 'disappears' ) . Everything is the same in terms of ownership and security context ( SeLinux ).  I cant dig up anything  of interest from dmesg. Why does this happen ?  Both apps are User Apps . Both apps have everything possible linked. One App remains 'alive' & the other 'disappears' after boot . SeLinux is Permissive . This is an Android Q Project Treble ROM I am not using App2sdnative mount script, ( though my ROM has addon.sh support and I tossed App2sdnative mount script in there ) but, Partition mmcblk1p2 which is sdext2 is mounted  through my own script . 1 line of thinking ruled out was Partition mmcblk1p2 which is sdext2 is being mounted  late enough & before that itself the symlink is considered invalid & gets deleted but that wont explain why the other app survives ?
In the below 'camscanner' is the app that persists after boot and 'BofA' which is bank Of America disappears.

Apk directories
PrKr:/data/sdext2/apk # ls -al /data/app/com.intsig.camscanner-WRx5fzxsezoqL6Gc53H5qg==
total 21760
drwxrwxr-x   3 system system      4096 2020-04-02 10:42 .
drwxrwx--x 114 system system     20480 2020-04-15 08:24 ..
lrwxrwxrwx   1 root   root          72 2020-03-29 17:43 base.apk -> /data/sdext2/apk/com.intsig.camscanner-WRx5fzxsezoqL6Gc53H5qg==/base.apk
lrwxrwxrwx   1 root   root          71 2020-03-29 17:43 lib -> /data/sdext2/app-lib/com.intsig.camscanner-WRx5fzxsezoqL6Gc53H5qg==/lib
drwxrwx--x   3 system install     4096 2020-03-29 17:43 oat
-rw-r--r--   1 system system  22239154 2020-03-29 17:43 split_config.armeabi.apk

PrKr:/data/sdext2/apk # ls -alZ $_
total 21760
drwxrwxr-x   3 system system  u:object_r:apk_data_file:s0             4096 2020-04-02 10:42 .
drwxrwx--x 114 system system  u:object_r:apk_data_file:s0            20480 2020-04-15 08:24 ..
lrwxrwxrwx   1 root   root    u:object_r:mnt_user_file:s0               72 2020-03-29 17:43 base.apk -> /data/sdext2/apk/com.intsig.camscanner-WRx5fzxsezoqL6Gc53H5qg==/ba
se.apk
lrwxrwxrwx   1 root   root    u:object_r:mnt_user_file:s0               71 2020-03-29 17:43 lib -> /data/sdext2/app-lib/com.intsig.camscanner-WRx5fzxsezoqL6Gc53H5qg==/lib

drwxrwx--x   3 system install u:object_r:dalvikcache_data_file:s0     4096 2020-03-29 17:43 oat
-rw-r--r--   1 system system  u:object_r:apk_data_file:s0         22239154 2020-03-29 17:43 split_config.armeabi.apk

and BofAm. This is before reboot. the below link gets deleted after reboot. I am posting the pre-boot scenario for comparison. Nothing to post , after reboot as the link is deleted
130|PrKr:/data/sdext2/apk # ls -al /data/app/com.infonow.bofa-N_WOiCdzw7ZF21E7EtehGQ==
total 40
drwxrwxr-x   3 system system   4096 2020-04-15 08:26 .
drwxrwx--x 114 system system  20480 2020-04-15 08:24 ..
lrwxrwxrwx   1 root   root       67 2020-04-15 08:24 base.apk -> /data/sdext2/apk/com.infonow.bofa-N_WOiCdzw7ZF21E7EtehGQ==/base.apk
lrwxrwxrwx   1 root   root       66 2020-04-15 08:24 lib -> /data/sdext2/app-lib/com.infonow.bofa-N_WOiCdzw7ZF21E7EtehGQ==/lib
drwxrwx--x   3 system install  4096 2020-04-15 08:24 oat

PrKr:/data/sdext2/apk # ls -alZ $_
total 40
drwxrwxr-x   3 system system  u:object_r:apk_data_file:s0          4096 2020-04-15 08:26 .
drwxrwx--x 114 system system  u:object_r:apk_data_file:s0         20480 2020-04-15 08:24 ..
lrwxrwxrwx   1 root   root    u:object_r:mnt_user_file:s0            67 2020-04-15 08:24 base.apk -> /data/sdext2/apk/com.infonow.bofa-N_WOiCdzw7ZF21E7EtehGQ==/base.apk
lrwxrwxrwx   1 root   root    u:object_r:mnt_user_file:s0            66 2020-04-15 08:24 lib -> /data/sdext2/app-lib/com.infonow.bofa-N_WOiCdzw7ZF21E7EtehGQ==/lib
drwxrwx--x   3 system install u:object_r:dalvikcache_data_file:s0  4096 2020-04-15 08:24 oat

Questions
How can  I get this to work ?
Also SeLinux being permissive avc denials are just FYI or they are in force ? restorcon and other selinux commands are regardless or matter ?
What I did so far :
--tinkered with various options including putting magisk in global mount space

-- ran a umask command before link re-creation after deleting the original link as mentioned here to make that link RO . Link octals remain the same viz 777
-- restorecon though i dunno why that'd matter if I am running in permissive mode ?

I manage to get some more information from log cat and here it is on  pastebin
Update :

Heyya thanks. I put mount scripts in  pastebin_2_with_MountScipts with relevant notes on top ``  and the earlier pastebin_1_with_logCat has some more info from logcat it sounds like something deleted /data/app/com.infonow.bofa-jnpc8sttz4BVPzQsPK5zw==/base.apk  the symblink. What process was it ? after that I can see package manager is complaining  and doing clean ups . One thing still unclear. Does SeLinux Context matter in permissive mode ?. TYVM

i think you have answered question yourself already. sdext2 is mounted too late, that's a common reason for such behavior (some apps dissapear, some not)

Howdy that seemingly convinces had it not been 1) Another App getting mounted just fine. Everything is the same as I mentioned how come the other one mounts fine  ? 2 ) if I link everything except the apk  . The other components /data/app/<name>/lib --> /data/sdext2/app-lib/ mounts just fine, which tells me something else is going on. What possibly can explain this differential behavior ?

also if SeLinux  is permissive avc denials   ( from dmesg ) are just FYI or they are in force ?

Updated the question with this info

...in  permissive mode does  context matter. From  that lil drop I know of the 'sea' called selinux. If   permissive those  avc denials are just FYI or contextmatters  ? Yes the app does move  when it links and  the owner & everything  is ditto  for the app that  survives a reboot Vs that whose link is lost.. I will do some more use case testing and revert back and I will also give your  loop a try. Thanks AlecXS

i don't know but i guess avc denials always matters, otherwise it would not named denials. but that is no explanation because you did same with other symlinks. maybe the app itself checks for symlink because it's s banking app

This is example mount script /data/adb/service.d/40sdext2
#!/system/bin/sh
[ -d /data/sdext2 ] && \
until grep -qw /data/sdext2 /proc/mounts
  do
    mount -t ext4 -o rw,nosuid,nodev,noatime /dev/block/mmcblk1p2 /data/sdext2
done &

can be placed in /data/adb/post-fs-data.d or /data/adb/service.d should work in both cases

downvote if not solves your symlink problem

nah... never ever downvote someone's best efforts after all....  w/out efforts there will not be results. tend  to avoid using loops in in Su level scripts since they can cause boot loops. I have no complain about my script not being able to mount. does mount but I am not sure if the problem is the  mount timing or there is another issue

I am less inclined to think about the Mount timing because the same app will link without any issues if I link the data lib  odex  everything except apk  ... the minute I link just apk  it will refuse   to show up after a reboot

Ok I got it to work w/ the following modifications.  I was running my mount script from /data/adb/modules/<name>/script.sh which actually came from my old phone that I did not bother to change. I took your cue and tossed it in /data/adb/service.d  giving it the right chmod's it needed  after that I suspected the davik cache must be telling the older location before the move, though, if there's a symblink in there then  it should feel nothing changed..so cleared dalvik cache & the apps would reappear with links in place. So Alec - TYVM

bad thing that  happened after dalvik cache was cleared.. it deleted the msgstore.db file in /data/sdext2/data/com.whatsapp  & similar files. I dunno why cant follow but I had a 12 hr ago backup.Likely because that file was cached being write prone ..still wonder how just that 1gb+ file was del & other files present ? Though apps2sd for some might be antique ( it hasnt updated recently).-. When it works as it shd I dont need titanium.Prev2Prev phone shorted & bricked  in my jacket -snow from my jacket but bcos of linked app & data I minimized data loss.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
SD card had bad sectors after chkdsk. Is that Logical or physical ?and path from here
This is about data corruption on android . The primary issue relates to bad blocks / clusters and it happens to be android platform. So this is a super user and NOT android enthusiast question. answers to this question will apply to ANY corrupt card whether PC or android. So its thoughtless to tag this is android
This is a Sandisk 128gb  ( leave this link  - its not an ad .Specific card indicates other paras like memory channels , write speed etc card I am using on an Android Nougat device.
This is the 2nd time the card had corruption issues. 1st one I bought got Write Locked . Present Replacement was provided
The card has a lot of bad clusters. 2 things got me to sniff this :

whatsApp directory ( which had a bind to whatsapp dir on internal ) : the image directory can no longer be written to
Phone randomly reboots and next time  exFat partition is not mounted ( I used app2sd and partitioned the card to ext4 10gb  to link my apps and rest if exfat )

ran a chkdksk on windows 7 and it would autoterminate on initial run & persisting on running gave me repeated message "# cluster moved for file " ( cant recollect exact verbiage ). It could Never complete it but aborted with the message . "corruption found in card "
questions :

How do I know if there is logical  or physical bad cluster. Any tool / test ?
 Here's something I did - that made me think logical. I removed the images directory ( which was  write locked and so as long as the binding was on , whatsapp images could not be downloaded. Once I  switched off folder mount tool that enforced this, it would work ) after moving the contents to dir2 and renamed dir2 to original dir. after del the original dir. Now for sometime  whatsapp binding would work and the same problem came again . So I tend to think but need confirmation.
I am thinking of salvaging the contents of exfat partition and then format partition and instead create 2 ext4 partitions ( or FF2S. Tell me which is better) . One is for less write apps. My photos etc here and other smaller one just for whatsapp and then copy back contents to relevant partitions.

If I do this. There is no  out of box support for ext4 partitions for android ( isn't ,pl confirm) ? how do I auto mount without 3rd party utils ( fstab ? )
How do I auto mount the extra ext4 - fstab ?
Will this help avoid the above problem ?

While I still have the corrupt block partition  is there ANY other tool that will run  till the end and identify all bad blocks so they can be  kept aside .I tried aparted for android which runs fsck ( exFat sub ) and the report came normal in < 1 min .

Some errors are marginal, not hard or foreseeable, so you cannot assume anything. Our advice on SD card errors have always been the same : Get a new one, nobody can fix a bad card.

Are you sure the SDcard is genuine? I strongly recommend you to test it before using it. For example using the Windows tool H2Testw it uses the full sdcard and checks it it really has the size it claims to have.

I am aware of fakes. Yep this is tested by H2testW - before I used it I ran the brute test

Sometimes the specific card ( usually depending on price ) will have extremely fine wiring, this is the case with many large storage device's on small physical devices like USB Memory Sticks & SD Cards... The card actually has an overheating protection to stop the wires from becoming damaged, This will stop Read & Write access to the device temporarily to allow cooling... This seems to cause a R/W Error for a computer... Instead of waiting for access, it immediately registers the current sector it was scanning as unusable... You need to follow the manufacturer instructions carefully... 5mb p/w

Have you tried BadBlocks on an Android... @Unknown:/ $ badblocks Usage: badblocks [-b block_size] [-i input_file] [-o output_file] [-svwnf] [-c blocks_at_once] [-d delay_factor_between_reads] [-e max_bad_blocks] [-p num_passes] [-t test_pattern [-t test_pattern [...]]] device [last_block [first_block]]....... OR FIX THE DRIVE WITH CHECK DISK ... chkdsk -Drive -f .... If a nondestructive -f won't fix it... try a destructive fix with -r (it implies -f ) chkdsk -r

As a Side comment to the "Nobody can fix a bad card" ... You can fix a bad storage device... Bad sectors & clusters have always been a part of digital storage, HDD's used to come with detailed formatting instructions to format around the bad sectors from building it... It is impossible not to get a bad sector every now and again... The fix & the reason we don't need to format around bad sectors anymore is because computers do it automatically, they have a reserved amount of usable sectors that are only ever used as replacements if and when a sector becomes unusable... ....

You hypothetically just need to force the device to use the reserved sectors.... However... If you run out of reserved sectors, you need to do an Old School low level format... Around the bad sectors per-say

Yes I ran chkdsk with /r /x  options & thats when it  puked with all these errors .  My questions are 1) How to successfully run some file system utiility that will make  bad sectors .chkdsk aborts 2) if I back up data and format all partitions will those bad sectors  be again available for use ( logical bad sector ) or they will cause the same issues again

system utility that will mark bad sectors


text:
mounting multiple ext4 partitions in Android 7+
I am doing away with exFat for my Microsd card after  all my pictures  decayed ,  corrupted and the directory was locked. I cant seem to write into a specific directory. chkdsk will just plain abort saying :
The disk does not have enough space to replace bad clusters
detected in file \WhatsApp\.Shared of name 1.
Corruption was found while examining files in directory \WhatsApp\ (6).

 so I 'd like give a shot to Ext4 partitioning that cheap micro sd card , not just 2 ( the standard app2sd and sdcard1 design ) but 3. One for apps  and other 2 depending on the write activity , I  tweaked the block parameters etc. for each
I am able to mount the partitions &   a rooted Total Commander can see them all
BUT  other apps cannot see the partitions I created.As I understand vold helps other apps be aware of this. So How do I go about getting this 'formally' with sounding 'hackish'

what I did :
mkdir /storage/<my dir>
mount -t ext4 -o noatime,rw /dev/block/mmcblk(x)p(y) /storage/<my dir>
where x and y are variables from partitions file in the proc dir.

I read  about a fstab.<phonename> file out there that can be modified but it would be overwritten every boot.
even the 2nd partition that app2sd  ( or link2sd) creates can ONLY be approached as root. So prolly those apps that ask for root can see this stuff but other apps can write to it
Ext4 is linux .  Sounds like Android seems to ignore its own 'biological' kid ext4 and instead recognize a stepson 'exfat / FAT '

I am sure I am missing something here. Any ideas ?
I am rooted with Magisk  on a Galaxy j7 with of course TWRP ( 3.x) installed
Print env o/p

BUT other apps cannot see the partitions. Even with root access? Make sure this isn't because of Mount Namespace: https://android.stackexchange.com/a/200449/218526. Vold exposes only first partition on sdcard to apps. Try vold-posix if yours doesn't support Ext4. Directly writing to SD cards is restricted since KK or even before. Access you get is through SAF. Also may use bindfs (FUSE) to modify permissions of mountpoints so that apps can read the partitions, even from within /sdcard possibly (never tested though).

Ok just to clarify. app2sd Mount script puts script in magsik folder. On my phone magisk is at /sbin/magisk  folder  and I modified that manually to add the same logic now 2X more times for each additional partition. Strangely after I modified the script . After boot 2nd part & apps never showed up. I ran it manually and they all showed up . Also under TC I could see the additonal mount pts under /storage showing up as drives. Nothing changed AFAIK but now TC looks weird - all those Drives disappeared. After running script these pts under /storage will still be seen & su - TC can see it.

Coming to 2 other Q's from Irfan .Lot of common apps wont request root  access. I cant force em & they cant see these even if I invoke TC. By going to TC I can see all of them under /storage but invoking TC via System share - everything disappears. Your other Q Magisk is get to global namespace yes. That was the setting hitherto . HTH

Also my partitions are like these mmcblk1p1--> App2sd second partition

Also my partitions are like these mmcblk1p1--> App2sd second partition mmcblk1p2  user data part # 1 , p3 user data part # 2 ,- all Ext4. If vold exposes just  1st Part, how do I go about getting the other 2 "exposed" ?. How do I get vold-posix working. How do I use FUSE . My parts are under /storage and earlier like I mentioned they got 'picked up' & could be seen as separate drives .in TC . Now they show as folders ( mounted ) under /storage .  When the former situation existed I am not sure if apps could not access those ( prolly could .. my gallery app did ,

not   sure what caused the change of mind from separate drives .in TC to folders ( mounted ) under /storage. I know at that time app2sd use to give some alerts some of the apps are not mounted correctly should - use  the advanced op to recreate mount script  -->  click Y --> reboot. I wonder if at that time it moved the mount script location /

post the output of mount and printenv somewhere (pastebin) after mountscript

I dont see any place where I can paste the full o/p due to restrictions in #chars so I attached screenshots. Need to see that mount @ 300% I was able to read some - the file gets toned down in size & quality even if < 2mb  ( max allowed )

see pics attached

from mount what i can see your first partition is mounted twice. from printenv i can see you have knox?

Knox is disabled or removed. Prolly 1st


text:
app2sd link2sd nightmare ..all Fully Linked apps disppear
One advantage in using app2sd ( or link2sd ) was that if all your apps are totally linked
when you swap out phones you would hope to 'carry' your apps with you and of course space savings to /Data
I know how linking works but my question is about how app2sd and link2sd "remember' how apps are linked.
I am facing a constant problem  where my ext4 partition # 2 does not automatically mount. I have to do soft-reboot  or use "Mount 2nd partition" after the boot. It does not want to do this on runtime and after this only partially linked apps will show up. I am rooted via Magisk with Global Namespace turned on .

One of the consequence of this  is if an app is 100% linked it Just disappears ...WTF ..whoa  ! what a waste of time linking. Why does is do that . What's happening under the covers ?
Both these are clone apps but I have been using app2sd for sometime after Link2sd dev. wont reply to emails ( I had the paid version )

These apps store linking info into an app2sd database ...why then cant this info be preserved. All my apps that are 100% linked ( well to be precise those apps that have apk , and Libraries ( lib ) linked as against data and ext_data and cache . So an app with apk linked and data , ext_data & cache on internal would still fall in the 'disappear' category  )
keep disappearing Those that are part linked will appear .

apps are still there, maybe just the links are gone. you can manually link again with ln -s it will be recognized from Link2SD. besides this you can place mount script in /data/adb/post-fs-data.d or /data/adb/service.d just mount your ext4 partition to /data/sdext2 on earlier stage. remember these apps are outdated and developed for low memory devices with android 2.3.6, you have a native ext4 partition meanwhile called adoptable storage

Hi Thx for revert. /data/adb is not there on 7. Also for my SD card which has ext4 partitions it will not recognize this and wants  to format it. For adoptable storage , It should have asked me if I want to use the card partition as adaptable storage. So I dont think ext4 is respected for adoptable storage ( else If you know how I can  get Android to recog. this  & convert it to adoptable storage do let me know)

the other Q is .. yes for a handful apps I can manually link how can I do this for a ton of them . Apparently link2sd ( in my case app2sd ) has a DB that stores all this info. so in case links are broken , the DB can help  ( ? I 'd assume so but Need confirmation) .. why then do all 100% linked apps disappear ?

post-fs-data.d is folder from magisk, sure you have it. why then do all 100% linked apps disappear? Probably sdcard mounted too late
https://android.stackexchange.com/questions/214233 adoptable storage can make your sdcard 50:50 (for example) one is vfat other is encrypted ext4 partition

problem with adoptable storage is that ext4  is not supported since I i n rooted I can use the ADB method and give any kind of mix I want... but the second partition it will create is a fat32..so coming back to my concern .. I would like to devote a separate third partition for all apps that are extremely write sensitive such as a WhatsApp. and and isolate it from my main partition. Idea behind this also has to do with wear leveling algorithm which I read is active in micro SD card - if file system is based on FAT cf ext4 which is not based on any file allocation table  & so does

not support .this is an inference I drew but I am not sure if it can be assumed true
so now coming back to main Q  how do I get 3 ext4's mounted and all of them should be available to all apps for RW

i believe you can mount with correct uid/gid then it should be accessible without root. regarding Link2SD see my first comment. or checkout the vold stuff as suggested here https://android.stackexchange.com/questions/214684/mounting-multiple-ext4-partitions-in-android-7#comment275059_214684

look in the output of mount how a fat32 partition is mounted from android, use the same uid/gid for your mount replacements. for apps they 'disappear' check /data/system/uiderrors.txt

seems the uid/gid mount parameters only work for vfat partitions


text:
How to delete a file (e.g. malware app) that cannot be even removed with root access?
I have root access in my device, but there is a malware in /system/app/ that I can't delete. This malware installs TimeService, MonkeyTest, and also some other apps like DR battery and privacy guard, and also shows ads.
I'm  using ADB shell & I have tried Root Explorer in Android. Dr.Web also  can't delete it. When I tried to delete without root access, it gives the following error message:

rm failed for <filename>, Permission denied

With root access, I got the following error:

rm failed for <filename>, Operation not permitted

Is there a Linux command to delete this kind of files? Should I install BusyBox first?

An alternative is to boot into  custom Recovery and then delete it. It would work. Though how did you find out that OEM shipped app is a malware causing all the other malware installation?

it's package name is android.backdoor183 oO

i can remove all system files except this file

Most likely this files attribute is set to "immutable". Which means nobody will be able to edit, rename, move or delete it. (Not even root)
You can check this in linux with the command: lsattr file
If this output shows an "i" my assumption is right.
The immutable attribute can be removed by chattr -i file. After doing this you should be able to delete this file as root again.
As far as I know the android toolbox does not include these binaries. You need to cross compile(your device is ARM based?) busybox for your device and take care that both binaries are included or take a prebuilt busybox binary from a trusted source which includes them.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Prevent WhatsApp from automatically backing up messages
I noticed recently that WhatsApp automatically backups messages. I get a popup every now and then when I am using WhatsApp which says "Backing up messages". I don't want WhatsApp to backup my messages. I went into the WhatsApp settings and clicked 'Chats and calls -> Chat backup' and it says:
Local: 3:00am
Google Drive: Never

Google Drive settings shows that my settings are set to 'Never back up to Google Drive'.
With that said, how do I prevent it from backing up locally?

Quoting from WhatsApp FAQ How do I restore my chat history

If your device is plugged into your computer at night, low on storage space or is set to sleep with no background data; WhatsApp will not be able to backup your chat history.

I presume freeing up storage space is your reason for not wanting to back up. To do that

How do I delete WhatsApp back up? says

Your Chat History Backup files are saved in the /sdcard/WhatsApp/Databases/ folder.- You cannot open these folders outside of WhatsApp.- Make sure you have a file manager to be able to delete these files...

Launch your File Manager.
Tap on the WhatsApp folder, a list of all WhatsApp sub-folders will appear.
Tap and hold the Databases file.
Select Delete.

Wcleaner for WA. App description amongst other features claims (not tested by me )

Now you can delete or save WhatsApp backups (It is highly recommended not to delete latest backup)

There's no way to do that. WhatsApp updates its backup at 4 am(for me, can vary) everyday locally for easy recovery of chats.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Bought a new battery, do I need to calibrate it?
My original battery is bloated and is dying quickly after a full charge so I now bought a replacement. Do I need to calibrate this new battery using a calibration app?

No
Calibration of batteries (Li Ion or Li Po, used in almost all mobile devices) is a myth
You can start using it straight away and charge as you normally did with earlier batteries
This post will help you understand more:
Looking for a consistent answer about battery calibration
Using calibration apps doesn't really help as the battery files in system (to which these apps write) are renewed and previous data erased when you charge / reboot
As explained in this article

It [Batterystats.bin file which stores calibration information] has no impact on the current battery level shown to you.
  It has no impact on your battery life.......it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point)...

Explanation in Italics mine from the same article

Related Myth : Charging a new battery for X hours
Charging a new battery for x hours before use is a "legacy hangover" from the days when Nickel Cadmium batteries were used. Those batteries had a "memory effect". As a result, over a period of time, they "remembered" lesser battery capacity than rated capacity. To prevent this, it was advised to always fully charge these batteries

This is not the case with Lithium Ion or Lithium polymer batteries. There is no logic to charge fully or x hours before use. Just use the battery normally, as suggested by others in comments
Table 1 corroborates with additional information

You don't need a calibration app for that. Just fully charge the battery to 100% (in one run), let it run down to below the 20% mark, the recharge it to 100% (again in one run without interception) – battery calibrated.
And as that describes a "normal day" with recent devices (take it from the charger at 100% in the morning, put it back almost depleted in the evening): No calibration needed at all, you calibrate it as a side-effect :)
All those calibration apps do in addition is removing the batterystats.bin file – which doesn't do anything to calibrate the battery (an old myth in fact).


text:
How do I change temperature units in Android Wear's Weather app?
Just got a Fossil Q Founder smartwatch. Currently, it is showing Fahrenheit. How do I change the default weather app to use Celsius?
I've changed literally every single setting I can think of. I have used the Fossil app to change the watch faces to show the temperature in Celsius. I have Google Now cards configured to show in Celsius. I even tried downloading the Google News and Weather app and changing the temperature units used there. I checked every settings menu I could find in both the Android Wear app and the Fossil app. Nothing.
Rocking a Nexus 6P. Everything is the latest.
Multiple Google search results have pointed to Google Now weather card settings as the place to change the units in the Android Wear app, but as I mentioned above, I already have those set since before I even had the watch. I tried changing to Fahrenheit and back to Celsius, but still no luck. I've tried restarting the watch and my phone a million times, but also had no luck getting the settings to take on my watch.
Can someone please help? It doesn't help that Google has the worst support imaginable. I would bet my life savings that if I called them for support, they would tell me to do a factory reset without even attempting to understand that actual issue.

Nothing was working as a lot of things are updated now. I followed the following video it did the trick for me. CHANGE TO FAHRENHEIT or CELSIUS in Accuweather App

I contacted Fossil who said that the temperature units on the watch are based on the language setting you select when you set up the watch. If you select US English, then it will be Fahrenheit (probably the only language setting that uses Fahrenheit).
I am Canadian and there is not usually a Canadian English option, and UK English has caused strange anomalies for me in the past. Plus I live in the USA, I just want Celsius and I don't think I'm the only one. I informed them that their solution for units is not adequate.
I am using the AccuWeather app which I paid for years ago and I like it. But their Android Wear app is broken right now on my watch and they are aware of the issue and working on it, but it has been some time (plus their latest material design update took ALL of their flexibility out of unit selection so that is quickly becoming an issue).

I can always tell when google has a regression and re-introduces this bug because it suddenly starts getting upvoted again. Maybe someone should tell google about regression testing, either way can't say I'm surprised to see google is still not doing a good job at anything.

It's because your phone language is set to US English.
Just change your handphone language to another type of English, such as English (United Kingdom), then the weather on your watch will change to Celsius.

Doesn't work for me

I had the same issue with my Fossil Sport watch. I live in Canada and it showed as Fahrenheit. When I set up the phone, it did not give an English (Canada) option, so I picked English (United States).
I found a solution though. I updated my language setting on my phone through Settings, System, Languages and inputs, Languages. I had English (United States) as my default language and English (Canada) as my second language. I deleted English (United States) and that changed English (Canada) to my default. Once I did that, my phone immediately updated with Celsius.
Reference: Wareable - How to change the language on Wear OS

Here is how you change it:

Log in to your Google account on your computer
Go to https://myaccount.google.com/u/1/language
Change your language preference default to English and then choose Canada.
Make sure you use the same account for Google Wear OS.
If you are using the same account, after this change, restart your Fossil watch and you should be good to go.

I have tested this on Fossil Gen 5 and it works.

Tried this with a Fossil Sport, still kept displaying Fahrenheit and miles per hour for wind speed. Only after changing the preferred language in the linked phone's settings, the units used in the weather app on the watch were changed as well.

If you're using a face control app (WatchMaker, Facer, etc.) you may have to go into the settings for that and change it.
I use a ton of WatchMaker's faces and I was losing my mind changing languages and Google Now settings, until I saw the settings in the app.

I just bought a Fossil Q Founder watch.
If you go to watch setting, then change watch face, scroll to classic, tap the setting bar below the displayed face, then it will allow you to scroll down to weather unit. Tap it and it will allow you to change between Celsius and Fahrenheit.

That is correct, but only changes it for the watch face. I was trying to adjust it for the built in weather application. Unfortunately I just arranged for a return and refund on my fossil Q founder. Turns out if the watch is exposed to any moisture, dust, or sand, the warranty is voided, which kind of makes the whole IP67 rating completely useless. I recommend others do the same to be honest.

The units used are derived from the language setting selected upon pairing the watch. They cannot be set separately from the language selection, but fortunately it is possible to change them later on.
On the phone paired to the watch, go to Settings -> System -> Languages & Input -> Languages.
There you will be able to set English as your preferred language, and in a second step whatever country you prefer to derive units and regional typing conventions from (date format, decimal point/comma, etc), no matter wether english is actually spoken in that country officially.

Go to your Android Wear app > Your feed > Weather > change the temperature to Celcius.

Maybe you can add screenshots or provide more detailed steps to change the temperature units. Currently the answer is very short and too generic.

authors: Σιδέρης Ραχμανίδης


text:
While on call, typing a digit on dial pad doesn't make any sound
Since my Samsung Duos phone was upgraded to Android 5.0.2, during a call, when I dial some digits on the numeric pad, there is no keypad tone heard. As a consequence, when an answering machine asks my choice like "press one", "press two", I just cannot provide any choice.
I tried pretty much all settings (dialing keypad tone, touch sounds), with no luck, I can't even imagine why disabling this feature.
Any suggestions?

Device: Samsung Duos  (SM_A300H)  Android version 5.0.2. I don't think it comes from the device, I have it for a year and I have always been able to "press one"  "press two" on request

##0673##  leads to msg  "connection problem or invalid MMI code"    there is no menu except the classic 3 vertical points icon below the Contacts icon, with menus "Speed Dial" and "Settings" , that don't offer any untried setting

On my phone I can't hear the keypad tones at my end, but they still get sent to the other end, so automated menus still work. Have you definitely tried using the answering machine?

absolutely, it didn't work yesterday but today it worked??!!   I think it is definitely not a good idea to suppress this dial tone for user,   thanks for your help

It is good to know that the problem has been resolved. After my suggestions including "cheat code" did not fix the problem yesterday, I discussed this with a Samsung ROM developer. You may like to consider options based on this discussion.
Firstly, the tones which failed are DTMF tones. These are NOT

User configurable
Affected by app misbehaviour
Custom ROM developers also do not tinker with this as it is a deep feature and they don't need to tweak it for user benefit
Stock ROMs/ upgrades will NOT disable it

As to how this happened is a mystery, but there is always an annoying possibility, that this may occur again. You have three options

Do nothing: If it happens again you can try using these kind of apps (bunch of them on Play Store, Google for "DTMF") DTMF Tone Generator

Any of next two options recommended

Device not rooted

Take backup using Kies
Factory reset
Do firmware upgrade/restore using Kies
Restore data using Kies

Or see this for other ways of taking back up  Full Backup of non-rooted devices

Device rooted

Take  nandroid backup using custom recovery backup
Factory reset
Flash upgraded Stock ROM

Can be downloaded from Sammobile after registration. Make sure you download the correct version and of your region
Flash stock using Odin

Restore data from nandroid backuo

Thanks for this detailed answer, yet please say SAMSUNG dev that removing DTMF tone from caller hears is definitely misleading and not a good idea

Thanks for accepting but to clarify that the person I spoke to is a "Custom ROM developer",  not connected with OEM. It may be better to voice your concern by contacting Samsung help directly and mailing them


text:
EXT4 Mount gives this error "SELinux: mount invalid. Same superblock, different security settings"
I am trying to mount a second partition  (ext4 ) for my apps ( I guess its a bit outdated with adoptable storage but then ext4 isn't accepted FS for adoption for external card ) . I am on 9.0 ( Pie ) and all my SD partitions are mounted under /storage and some weird name .e.g.
/storage/ 6226b27a-ebc1-4fdd-b54c-096abc40c2b9

Now I need my 2nd Partition to be mounted under /data/sdext2 but O.S already mounts it.
app2sd ( link2sd) gives me Mount script argument invalid argument . No matter what .
On digging further through OS logs I get this info
[   48.820728] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[   48.941276] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts:
[   48.969786] sdcardfs: mounted on top of /mnt/media_rw/6226b27a-ebc1-4fdd-b54c-096abc40c2b9 type ext4
[   48.970918] Remount options were mask=18,gid=9997 for vfsmnt ffffffda2f7539e0.
[   48.971668] Remount options were mask=18,gid=9997 for vfsmnt ffffffda95617660.

......
[  107.476736] SELinux: mount invalid.  Same superblock, different security settings for (dev mmcblk1p2, type ext4)

What I did :
Umount partition as mount master under Terminal Emulator. Its umounted only in context but not everywhere. But in-spite of umount I cant seem to mount it under /data/sdext2

Whats happening  and how to work around .

On a side note. How do I manually assign mount point names  and prevent these weird names given by OS to the partitions
and on a 'side side' note. I am not even sure if this is the reason for invalid mount error as I read elsewhere its more of a benign FYI message.

you can handle it two ways: 1) umount /dev/block/mmcblk1p2 (with busybox) before mounting /data/sdext2. or 2) bind mount /mnt/media_rw/6226b27a-ebc1-4fdd-b54c-096abc40c2b9 to /data/sdext2

Weird name is filesystem UUID, that's how Android uniquely identity external SD cards and USB drives. And as Portable Storage, external SD card is mounted under /mnt/media_rw/, apps just see it under /storage/ through Storage Access Framework (SAF). Nothing else I get from your question what you want to achieve.

[  107.476736] SELinux: mount invalid.  Same superblock, different security settings for (dev mmcblk1p2, type ext4)  this☝ error... why do i get it and what is the fix Thank You for responding

that was long time ago, i did some tweaking Which I can't remember now but i don't see it now. But not sure what caused.it


text:
no more space on device while writing to exFAT folder on MicroSD card
    JasonR:/ $ su
JasonR:/ # cd /stor*/emu*/0/WhatsApp
JasonR:/storage/emulated/0/WhatsApp # cd Media
JasonR:/storage/emulated/0/WhatsApp/Media # ls -al *.jpg
-rwxrwx--x 1 root everybody 506827 2019-02-22 11:42 DSC_20190102_130645.jpg

## I cant' move a regular file in whatsapp Images folder
cp DSC*.jpg  "WhatsApp Images"
cp: cannot create regular file 'WhatsApp Images/DSC_20190102_130645.jpg': No space left on device

## Neither can I create a 0 byte file.
JasonR:/storage/emulated/0/WhatsApp/Media # touch 1.jpeg
JasonR:/storage/emulated/0/WhatsApp/Media # cp 1.jpeg "WhatsApp Images"
cp: cannot create regular file 'WhatsApp Images/1.jpeg': No space left on device

## du command o/p
du -sch "WhatsApp Images"
2.0G    WhatsApp Images
2.0G    total

## Df command o/p. The BindFs between internal storage and SD Card can be seen.More details in Mount o/p below
JasonR:/storage/emulated/0/WhatsApp/Media # df -h "WhatsApp Images"
Filesystem                       Size  Used Avail Use% Mounted on
/mnt/media_rw/76B2-B58E/WhatsApp 109G   65G   45G  60%

## I m listing top 5 elements in that directory
JasonR:/storage/emulated/0/WhatsApp/Media # cd "WhatsApp Images"
ls -al | head -5

   <
total 3962688
drwxrwx--x  5 root everybody  2097152 2019-07-29 14:32 .
drwxrwx--x 13 root everybody    32768 2019-07-29 14:44 ..
-rwxrwx--x  1 root everybody    95402 2019-01-13 01:50 IMG-20150526-WA0005.jpg
-rwxrwx--x  1 root everybody   161097 2019-01-13 01:55 IMG-20150711-WA0000.jpg

## I can move up and restore a file within the WhatsApp Images folder.
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150526-WA0005.jpg IMG-20150526-WA0005.jpg.old
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150526-WA0005.jpg.old IMG-20150526-WA0005.jpg
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv IMG-20150711-WA0000.jpg ../
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # mv ../IMG-20150711-WA0000.jpg .

## Just <16.5K files totally. ExFat Limit is 2,796,202 per dir
/storage/emulated/0/WhatsApp/Media/WhatsApp Images # ls -alh | wc -l
16387
JasonR:/storage/emulated/0/WhatsApp/Media/WhatsApp Images #

## MOUNT command output
mount | grep -i "Whatsapp"                                                     <
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/default/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0006)
/mnt/media_rw/76B2-B58E/WhatsApp on /storage/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0006)
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/read/emulated/0/WhatsApp type sdcardfs (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0027)
/mnt/media_rw/76B2-B58E/WhatsApp on /mnt/runtime/write/emulated/0/WhatsApp type sdcardfs

    (rw,nosuid,nodev,noexec,noatime,low_uid=1023,low_gid=1023,gid=9997,mask=0007)
    JasonR:/storage/emulated/0/WhatsApp/Media/WhatsApp Images #

    .

## Going into Images directory directly without a bindFs link  & creating a 0 byte file Fails
JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media # cd "WhatsApp Images"
    touch 1.jpg
    touch: '1.jpg': No space left on device

    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #

## Now I 'll list some jpg's
    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #
    ls -al *.jpg | head -5
    -rwxrwx--- 1 media_rw media_rw    95402 2019-01-13 01:50 IMG-20150526-WA0005.jpg
    -rwxrwx--- 1 media_rw media_rw   161097 2019-01-13 01:55 IMG-20150711-WA0000.jpg
    -rwxrwx--- 1 media_rw media_rw   183103 2019-01-13 01:53 IMG-20150711-WA0002.jpg
    -rwxrwx--- 1 media_rw media_rw   170516 2019-01-13 01:55 IMG-20150711-WA0003.jpg
    -rwxrwx--- 1 media_rw media_rw   190117 2019-01-13 01:55 IMG-20150711-WA0004.jpg

## I can move a file inside that folder 1 level up && after moving it , it WILL let me create an additional file
    mv IMG-20150526-WA0005.jpg ../
    touch 1.jpg

## Now with that additional file created I will move back the original file  It will REFUSE this unless I delete the additional file I just created
                                                                       <
    mv ../IMG-20150526-WA0005.jpg .                                                <
    mv: cannot move '../IMG-20150526-WA0005.jpg' to './IMG-20150526-WA0005.jpg': No space left on device
    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #

    JasonR:/mnt/media_rw/76B2-B58E/WhatsApp/Media/WhatsApp Images #
    rm 1.jpg
    mv ../IMG-20150526-WA0005.jpg .

##sounds like it cares about the #files . Issue is not space related
exFAT
file  system is supposed to allow more than 2 million files per folder.
so just to give you an idea of my situation.

as is well known WhatsApp will not let you specify where to store its huge volume of media and database files i.e.
WhatsApp  folder in  user internal storage. so I have to use a bind approach to link to a folder on my exFAT MicroSD card with the same name.
all was well for almost 2 years and all of a sudden out of Nowhere I had the situation where  WhatsApp images
i.e. the "WhatsApp Images" folder ( WhatsApp/Media/"WhatsApp Images")
will simply refuse to accept any more jpg from WhatsApp
if I un-bind this relationship and have everything downloaded on my internal memory the jpg's & other media are downloaded just fine.  but internal storage is crammed - I don't have space.
binding does not cause this to happen to other media i.e. video documents etc.  this only happens to images folder and presumably that is related to large number of image files already in that folder.  exFAT does not have such a low ceiling for number of files you can put in a folder.   also just to complete the picture, I can write to any other folder on that micro SD card through binding on internal storage
what I did

renamed this folder ( folder.old )and created a new folder and moved  all files into that new folder also called 'WhatsApp images' and after about a week the same issue crept up on this new folder
since most of the space is hogged by videos , I created a bind only for video folder ( WhatsApp videos) everything else could go to internal memory.
 the result was videos could not be downloaded. so I could bind only the parent  WhatsApp  folder lock stock subfolder approach fails

so my questions are:

exFAT  does not have restrictions for such a small number of files in a folder what is causing this issue.
on command line it shows up as no more space available

I have attached screenshots of my terminal emulator
why does in subfolder approach not work. I'd assume that has to do with temp files created elsewhere while you download the video and then they have to be joined some place on the same partition and so the binding does not work  . if at all this is in fact true then where does WhatsApp store temporary files before it joins them so this temp folder can also be linked through a bind relationship

In your screen shots I see mainly the path /storage/emulated/0 which is not your sd-card and therefore not an ex-fat system. Anyway your screenshots are confusing me as they are too large and show only a very small region. Please paste terminal output as text and not as image.

ok I will connect the phone on ADB shell  and then post output. BRB in a few

Ok I removed those obscure screens and added text output with explanation about whats happening at every stage. TY  .

I don't use WhatsApp but this worked for fat32 on android 7.0 with selinux permissive and disabled namespace separation, but maybe WhatsApp Version has "patched" something. do you have maybe disc quota enabled? at least try with ext4 (with Link2SD you can view the paths of cached temp files)

I believe namespace separation is already on on my magisk . there are three options isolated  inherit root from requestor namespace and global namespace. the second option is on. I am using app2sd Mount feature. what the output shows is even if the the folder is dismounted & attempt made to write to the the MicroSD card ( exFAT)  folder the same error  comes.  if I I move one file then I can add additional file and I can always rename files there is no restriction for the latter if you see the use cases above. I Wonder What is causing this because AFAIK remember

if I load that card on my PC and try to write to that folder I will be able to do that. this happens only e on Android

understand selinux has badly bitten you in the past but I do not think it is responsible for these situations because I can write to that folder if I remove files and that is is the irony. about quotas being enabled . that would be for local internal storage folders but for MicroSD card folder which is link by any bind relationship, it happens onone the less

i believe there must be something in dmesg/logcat logs, but you need some expert knowledge for analysis

ok finally some light @ the end of a dark tunnel. The whatsapp setting to make "media visible on device ' was turned on. No sooner it was turned off - the  SD card did permit writing ( but from whatsapp  app ) so I could download images  with the bind turned on. still no explanation as to why 1) it happens just with Whatsapp Images (not vids docs etc ) 2)shell still cant copy to this dir 3)su shell can RW 1 file to dir after deleting existing but no new ones allowed. Prolly all this is part of that 'selinux' sea after all. will Someone complete this last part of the jigsaw for me ?

so I could get it work with the above approach  but falling short of understanding  WTH is happening behind the scenes.So far..so good.

for testing purposes, set namespace separation to global, or set selinux permissive. it may give you a hint in which direction you have to dig in more? can't help you with this, i have no explanation for such strange behaviour

Just for a new SD card and I am using ext4 but mount namespace was already set to global


text:
File attributes on Android (Linux): Any way to make a file fully writable but not deleteable?
I tried chattr with the +a (+i is even more restrictive), but it immediately caused app panic aka "app has stopped". What I want to do is make a file & folder undeletable.
You can perform any kind of rw function (add a.k.a. append, delete some data inside, update) but rm file/folder (file deletion) is not allowed until that attribute is reset so that the app continues to run as normal.
Is that possible or asking for too much? Pardon my lack of surf searching. I'd imagine this to be in the wish list of many so it won't harm framing this languishing wish as a question.

chattr +a is what you are looking for. But then the file must always be opened with O_APPEND flag. Obviously you cannot force existing apps and programs to do so. Other options are ACLs and SELinux. The latter provides very fine-grained control (over read, write, append, unlink, rename etc.). But each option has its own pros and cons.

By the way a and i attributes are called Linux filesystem attributes, not extended attributes.

@Irfan Yes +a is what I meant. I mentioned - as in option ( - ) a. For the latter as with other situations - found out that I likely have to recompile kernel with newer rules. If its possible to  simply modify  SePolicy on Android without recompile. If so citing some e.g.'s would be helpful

You don't need to use any fancy ACLs or attributes for this. Just make the file writable and the directory that it's in read-only. This works because deleting a file only checks for write permission on the parent directory, and completely ignores permissions on the file itself.

If I do that it cannot create new files in that dir. I  am talking of an app in android


text:
com.google.android.trichromelibrary - An app that gets installs multiple times .....what's the point?
As  I understand com.google.android.trichromelibrary is supposed to be a  webview replacement in android 10+
 find /data/app -type d   -iname "*trichrome*" -exec du -hs  {} \;
70M     /data/app/com.google.android.trichromelibrary_475808733-hbwaY4KXRVEdoKq10mzzfQ==
71M     /data/app/com.google.android.trichromelibrary_484407333-96Dwrx11cIuvXstExOmMTA==
72M     /data/app/com.google.android.trichromelibrary.dev_495100733-Znh6eO5SOBu_ORYXeXI2zw==
71M     /data/app/com.google.android.trichromelibrary_484408833-7teK0Hyij0I9yq5l070LmQ==

After uninstall
# find /data/app -type d   -iname "*trichrome*" -exec ls -ald  {>
drwxrwxr-x 4 system system 3488 2022-03-23 18:10 /data/app/com.google.android.trichromelibrary_484407333-96Dwrx11cIuvXstExOmMTA==
drwxrwxr-x 4 system system 3488 2022-03-31 00:38 /data/app/com.google.android.trichromelibrary_484408833-7teK0Hyij0I9yq5l070LmQ==

4 instances ? for the same app. Why ? I manged to remove 2 of them  using pm uninstall so as to keep just 1 -  but  I get the below error, after being stuck with 2 instances remaining instead of 1.
pm uninstall com.google.android.trichromelibrary_484407333                         <
Failure [DELETE_FAILED_USED_SHARED_LIBRARY]

My Questions
-- Why 4 instances of the same app. Is it by design ?  How do I know which app tried to install the additional instance of  trichrome library and why did it do so when 1 exists
-- This happened in the past too. How do I prevent recurrence. So I dont have to clean up everytime.
-- Other than brute  rm -rf on the un-wanted folder anyway I can uninstall the unwanted instance

Related: Multiple numbered copies of com.google.android.gms inside /data/app using up all the space on a device, Can I delete old trichrome library under /data/app?. As of current, without knowing how Play Store/Services works, it's just assumed that a clean-up code to remove old, unused instances is inefficient/does not exist.

I am aware of the above. That's  the purpose of the Q . Why ? the x'ple instances and How to prevent them

https://github.com/Undefined-User/TrichromeLibrary_Remover

I don't understand anything about webview but my guess is that is unique profile for each app that uses webview (I only have two)? edit: just deleted it, now my chrome browser app data and macrodroid wigdet is gone - obviously these apps created trichrome data then..


text:
"Android Pay is unavailable" on Note 2 running CM 12.1
I have a Samsung Galaxy Note 2 running the latest nightly of CM 12.1. I've installed the correct version of Gapps using OpenGapps Aroma installer.
I have root disabled in developer settings, however, when I open Android Pay I get the following error.
Click on Image to enlarge

I looked up other ways to fix this problem on the internet but I could not find any solutions. The only other solution I found was to install the right version of Google Play store, but I also tried that to no avail.
Please let me know a way to solve this problem since I can no longer access the gift cards, loyalty cards, or credit cards I used to have on Google Wallet.

Try xposed module - RootCloak  Related subreddit

I have already tried hiding root using many different methods. RootCloak, however is not compatible with my device as there is not yet an Xposed Module released for my device. I still do not understand why disabling root using either the SuperUser app or doing it through the built in SuperUser settings inside developer options is not fixing the issue.

Android Pay checks the operating system and if it's not stock Android, it will refuse to run. Some people have reported on that they have fooled the app into working by changing the default.prop file and others install a custom APK of the older version of Google Wallet. Otherwise, there's no way to run Android Pay on CyanogenMod or any other custom ROM.


text:
How to root Bluetimes 3584F Android TV box?
I need to move the apps to SD card because the internal memory is almost full, but I can do that only if it is rooted. So, I need to root my Android TV Box, Bluetimes 3584F.
This is the firmware link to download and the guide as install it on Android TV Box: firmware_Bluetimes_3584F.zip
Upgrading guide:

Unzip the downloaded firmware file, you will get 4 files named "g18ref-ota-XXXX.zip", "factory_update_param.aml", "u-boot.bin" and
  "recovery.img".
Copy the 4 files to the root directory of your SD card.
Take off the power adapter from your media player and insert SD card to the card reader slot.
Press and hold the reset hole on the back of the media player(beside the power socket), then connect power adapter to this
  item, still holding the reset hole
When you see the upgrading process bar showed on your TV screen, you can release the reset hole.

After firmware updating finished, TV box will reboot automatically.

I appreciate any help.

Download the utoo-root-signed.zip file from XDA Forum and move it to SD card.
Download the firmware_Bluetimes_3584F.zip file in question, unzip it and move the files quoted below to SD card:

factory_update_param.aml
u-boot.bin
recovery.img

Rename the utoo-root-signed.zip inside of SD card to g18ref-ota-20131220.zip.
Do the steps 3, 4 and 5 of the "Upgrading guide" in question.

P.S.: Even with the phone rooted I needed to create a 2nd partition EXT4 on SD card to move the apps to it by Link2SD app.
Thank you very much to stane1983.


text:
Is it possible to have someone assist with Android problems via remote assistance?
I have too many problems to mention including the truth about what my phone model/details 'really' are. I've got a few programs downloaded on my laptop due to the many issues I have with my Android, but I've had various different 'specs' come back to mere my model details, etc. (I am probably classed as under novice level by the way and I really would rather not be told off for fiddling where I shouldn't as I have, sadly, learnt that already the very hard/frustrating way)
These versions are:

Alps MTK MTK6577 (e1909l_v77_gq1008_a41_v20) on Android 4.1.1 JellyBean
Samsung Galaxy Note 3 (SM N900A) on Android 4.4.2 (build KOT49H_N900aAUCUCMLG)
STAR N9770 I9220 Pad
HTC MT6577

I downloaded these prog's because my phone constantly said no memory yet the phone's internal storage was empty. Due to too much internet info making stuff sound less complicated than reality, I went down the rooting my phone path and now it's worse than before(ish).
Much more to divulge but I'd like to know the answer to my simple query before writing my thesis.

Are you asking of something like AA or Teamviewer?

The simple answer to your question is yes. You can use Teamviewer    for an example.
Just look up Android Remote Assistance on the play store and you will find multiple options.