Sunday, June 16, 2019

Edit hosts file from terminal IDE with root accessed


My terminal IDE accessed root but cannot edit hosts file.


root@172.16.0.151:/system/etc #vim hosts

But vim just opens hosts file as readonly. Where do I missed here?



Answer



You've missed that the /system file system is mounted read-only.


mount -o remount,rw /system
cd /system/etc
vim hosts

# edit, save, then make /system read-only again:
mount -o remount,ro /system

No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...