Edit Hosts file on /e/OS

Hello all !

I have installed /e/ 0.17 and I would like to edit my /etc/hosts file, which needs root access.
In the developer options, I can configure a root access to ADB. That is what I have done, and from my computer, I connect my phone.
With adb, I get the hosts file, I edit it, and then, I want to push it back. But it fails because it is a “read only system”. So, I don’t know if I failed to understand what is Root access via ADB, or if I am not doing what I need to make it work. (I tried to relaunch adp in “root” using adp root, but that does not change anything).
I don’t know how to use ADB (I have adb only because I used it to install /e/)

Any idea how to do that, if it is possible (I assume it is as we can make a root access to ADB…) ?

Thanks for your help !

Jonathan

Regain your privacy! Adopt /e/ the unGoogled mobile OS and online servicesphone

Hi @wyllyjon welcome.

Sounds like you need to find a good adb tutorial! :slight_smile:

But you can first boot into TWRP >> Mount >> mount /system.

adb root commands now have write access to /system

Edit typo!

Thanks @aibd

But, what is TRRP ?? :confused:
I searched on internet, but didn’t found what it can be…

https://twrp.me/about/

What is your device?

It is a Fairphone FP2
Ok ! This is the recovery reboot !
In the recovery mode, I have selected Mount > I have checked “system” and click on "select "
And I’ve been able to push hosts file from adb !! :smiley:

Thanks for your help @aibd !

2 Likes

I think you can also modify /system partition on most phones via the shell (adb shell) from the os and not just the recovery. The partition is mounted read-only. So you need to remount it with read write access. After your edits you better remount read-only again.

1 Like