[GUIDE] How to edit fstab.qcom if you don't have permission (or any other file)

Search This thread

ondraczsk

Member
Dec 19, 2015
31
44
Prague
I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
So, how to edit, then?
1. Turn off the phone
2. Boot into TWRP recovery
3. Mount System.
4. On PC ADB type
Code:
adb pull /vendor/etc/fstab.qcom
5. You will have fstab.qcom file in adb folder
6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
7. Push the fstab.qcom into mobile by typing this
Code:
adb push fstab.qcom /vendor/etc
8.Voila, you have rewrited fstab.qcom file!
9. Now, you can reboot the phone.

For me it worked, I hope it helps to someone. :) :)
 

mrhamed

Senior Member
Apr 19, 2014
455
43
I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
So, how to edit, then?

1. Turn off the phone
2. Boot into TWRP recovery
3. Mount System.
4. On PC ADB type
Code:
adb pull /vendor/etc/fstab.qcom
5. You will have fstab.qcom file in adb folder
6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
7. Push the fstab.qcom into mobile by typing this
Code:
adb push fstab.qcom /vendor/etc
8.Voila, you have rewrited fstab.qcom file!
9. Now, you can reboot the phone.

For me it worked, I hope it helps to someone. :) :)
I have rooted NSTV device with Android11, when I connect my external HDD (ext4 formatted) to it, the device notify me the HHD not supported.
I can mount the HDD successfully:

Code:
mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /mnt/media_rw
The root privileged file manager apps can read & write to HDD (Root-Explorer or Solid-Explorer)
But I can't open my movies through the VLC, MxPlayer... apps (logcat is: Access denied), also I tried to 'chown & chmod' but I'm not success.

Can you help me to solve my problem please?!
 
  • Like
Reactions: w0nd3r365

w0nd3r365

New member
Mar 24, 2023
1
0
@mrhamed I had a similar issue in android 11 smartphone. My sd card had ext4 fs and bind mounts to it in /sdcard were 'invisible' to apps, due to inaccessible selinux context and permission errors. From this stackexchange post, I did the following to access its files from apps.

You need bindfs cli program. I use termux, so installing bindfs is very easy. If you can't get termux on your tv, cross-compile bindfs for your tv or compile it statically from source or search for pre-compiled binaries.

Mount your external HDD as you did, but use a different directory other than /mnt/media_rw since android mounts external storage devices there, to avoid possible data loss:
Code:
# mkdir /drive
# mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /drive

Create any directory where you will bind-mount drive in /storage/emulated/0/:
Code:
$ mkdir /storage/emulated/0/HDD

The owner and group of files when bind-mounting must be root (0) and everybody (was 9997 in my case). Now bind-mount /drive to /mnt/runtime/full/emulated/0/HDD:
Code:
# bindfs --ctime-from-mtime --xattr-none --direct-io --resolve-symlinks --create-for-group=10261 --create-for-user=10261 --create-with-perms=u+rwD:go+rD:fugo-X --force-user=0 --force-group=9997 --chmod-ignore --chgrp-ignore --chown-ignore --perms=ug+rwD:fugo-X:o-rwD /drive /mnt/runtime/full/emulated/0/HDD
Bindfs options don't have to be the same though. 10261 can be any uid. The android media provider module sets up the rest of the emulated storage views like read and write for you. That's all. Write speed to HDD folder won't be the same as writing directly to /drive; was slower in my case.

Apps that use the android media API to know which media files are in your storage will not detect the files in HDD until a media scan is done. Again I used termux for the media scan: termux-media-scan, but this process of media scanning and extraction turned out to be too battery intensive because I have very many songs, so I stopped scanning. I searched for apps that scan for media themselves like MX Player or VLC.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
    So, how to edit, then?
    1. Turn off the phone
    2. Boot into TWRP recovery
    3. Mount System.
    4. On PC ADB type
    Code:
    adb pull /vendor/etc/fstab.qcom
    5. You will have fstab.qcom file in adb folder
    6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
    7. Push the fstab.qcom into mobile by typing this
    Code:
    adb push fstab.qcom /vendor/etc
    8.Voila, you have rewrited fstab.qcom file!
    9. Now, you can reboot the phone.

    For me it worked, I hope it helps to someone. :) :)
    1
    I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
    So, how to edit, then?

    1. Turn off the phone
    2. Boot into TWRP recovery
    3. Mount System.
    4. On PC ADB type
    Code:
    adb pull /vendor/etc/fstab.qcom
    5. You will have fstab.qcom file in adb folder
    6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
    7. Push the fstab.qcom into mobile by typing this
    Code:
    adb push fstab.qcom /vendor/etc
    8.Voila, you have rewrited fstab.qcom file!
    9. Now, you can reboot the phone.

    For me it worked, I hope it helps to someone. :) :)
    I have rooted NSTV device with Android11, when I connect my external HDD (ext4 formatted) to it, the device notify me the HHD not supported.
    I can mount the HDD successfully:

    Code:
    mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /mnt/media_rw
    The root privileged file manager apps can read & write to HDD (Root-Explorer or Solid-Explorer)
    But I can't open my movies through the VLC, MxPlayer... apps (logcat is: Access denied), also I tried to 'chown & chmod' but I'm not success.

    Can you help me to solve my problem please?!