1. Download our Official Android App: Forums for Android!

Support Rooting for a log-time linux user.

Discussion in 'Android Lounge' started by azalea4va, Oct 10, 2019.

  1. azalea4va

    azalea4va Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Oct 10, 2019

    Oct 10, 2019
    3
    0
    5
    I have been looking all over the internet for information about rooting and am having difficulty making sense of it all (I suspect in part because there are well intentioned people who are describing things inaccurately). I have been using/developing linux/unix for over 40 years. Maybe that is making it harder for me to understand what I am seeing that is written by or for people who do not understand the details of how linux works.

    All I want to do is make some space on my 8GB ROM on my LG G5. With just a few added apps installed I am down to 0.5GB available and cannot even apply updates because the system complains I am out of memory. I do NOT want to always run as root, that is too dangerous. I just want what I have on any other linux system I use, the ability to execute SU to temprarily gain root provilege to do a specific task (like remove an uneeded bloatware system app). But generic android does not have an SU program on it.

    Is there a simple way to modify my file system to add an SU program (ideally one that requires a pin/password to execute to protect against someone using SU to mess with my phone) that temprarily gives me root access but then I can drop back down to "normal" access. Just that minimal change.
     

    Advertisement

  2. MoodyBlues

    MoodyBlues Compassion counts.
    VIP Member
    Rank:
     #27
    Points:
    713
    Posts:
    6,071
    Joined:
    Jan 27, 2011

    Jan 27, 2011
    6,071
    4,825
    713
    Formerly Linux sysadmin/programmer
    $HOME/LosAngeles
    Welcome to Android Forums, @azalea4va--from one long-time *nix user to another! :D

    What you're referring to as 'rooting' is not exactly what that term means on Android. Rooting on Android basically means gaining root access to the filesystem, thereby allowing you to modify/delete/create system files. Permanently. Once rooted, you're done. From that point on you have full system access.

    I don't know of anything on Android analogous to su on UNIX/Linux proper, nor any way to install it.

    Most of us long ago quit rooting our devices, for a number of reasons. Among them, Android improved! It left less to be desired, packing more of what we wanted. Also, some apps (banking comes to mind) will, for security reasons, refuse to run on a rooted device.

    You're dealing with only 8GB of storage, correct? So I'm guessing it's an older device (I'm not up on LG). Is upgrading to a newer device an option? 8GB...that's just not enough today.

    If you want to root your phone, check on XDA to see if it's even doable. But just bear in mind that mucking with system files on Android can easily result in bricking your device. I really don't recommend rooting any more.

    To free up space, try using system tools to delete individual apps' cache, uninstall apps you don't need, and disable apps you don't want but can't uninstall. Move data, such as photos or videos, off to a computer or cloud storage.

    Maybe others will have more suggestions.
     
    ocnbrze, Dannydet and MrJavi like this.
  3. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!!
    Rank:
     #6
    Points:
    3,033
    Posts:
    26,957
    Joined:
    May 13, 2010

    May 13, 2010
    26,957
    16,899
    3,033
    Male
    being a flashaholic sponsor, helping others gettin
    los angeles
    @MoodyBlues explanation is spot on.

    just to add that if you want to root your device then xda developers forum is the place to go. this is a developers forum where the devs publish their roms, kernels and other root goodies including guides on how to root your phone. always do research there before doing anything. and please if you do decide to root your phone, one tip i recommend is that you do your homework and be prepared. just remember to read, read, read, and then read some more. please feel free to ask any questions you have here.

    here is the forum for your device:
    https://forum.xda-developers.com/lg-g5

    also read up on recoveries. having a custom recovery is a must for any rooted phone. custom recoveries allows you to do many things, but the main one is making a nandroid backup. this is a complete backup of your phone. it is kind of like a save point in a video game (i use this analogy a lot....sorry guys but it works). if you mess up or something happens, as long as you have access to your recovery, you can always restore a backup.

    twrp is the recovery you want. it should be somewhere in the second link i provided.

    good luck!!!!
     
    Dannydet, MrJavi and MoodyBlues like this.
  4. MoodyBlues

    MoodyBlues Compassion counts.
    VIP Member
    Rank:
     #27
    Points:
    713
    Posts:
    6,071
    Joined:
    Jan 27, 2011

    Jan 27, 2011
    6,071
    4,825
    713
    Formerly Linux sysadmin/programmer
    $HOME/LosAngeles
    I love it. I meant to tell you that the other day, but forgot. I think it's a great analogy! :)

    My go-to line? Windows sucks, Linux rules, and, oh yeah, by the way, my favorite distro is Kubuntu. :D
     
    Dannydet, MrJavi and ocnbrze like this.
  5. azalea4va

    azalea4va Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Oct 10, 2019

    Oct 10, 2019
    3
    0
    5
    "Is upgrading to a newer device an option?"

    Some perspective. I rarely carry a cell phone, I am not that important that most communicatins can wait until I get home. When I do carry a cell phone, it is usually a 5 year old flip phone (fits in a pocket, no butt dialing, 2-week battery life), because all I am interested in is for the phone to make phone calls. For smartphone stuff, I prefer using a computer with a 30" screen and full sized keyboard. The one situation a smartphone is useful is when traveling. For that I have the older LG G5. Yes I could spend money to upgrade because 8GB is just too little, but I was exploring alternative solutions I thought would be preferable. There is no reason 8GB is not enough emmory, I just need to remove a few system apps that are no use to me. Of the 8GB, it appears only half is available for the file system. So I started out with only 2GB of free space, the android system taking up the other 2GB. It appears updates to all the system apps, has reduced that free space down to about 1GB (not sure why such a reduction). I have added 10 apps (firefox, a VPN, Kapersky, google voice, etc). None of those apps will install on the external SD card I have installed although I do use the SD to store all data file apps will allow on the SD card. I still have 500MB of internal memory left but now for some reason the system says I do not have enough space when the system tries to update an app like the small 10MB GoogleNews. I have to uninstall firefox, then the update will happen, then I can reinstall Firefox. Weird???

    From what I have learned about android, it seems to me to be a design disaster. One aspect of that is rooting. "Rooting on Android basically means gaining root access to the filesystem, thereby allowing you to modify/delete/create system files. Permanently." I do not want to do this. I do not want that power. More than that, it seems to me to violate one of the main security principles that has been a part of computer security forever, only use "root" privilege for situations where it is actually needed. From what I have read so far, android is all or nothing (or at least on a rooted device the default is root power unless turned off, which to me is backwards). I can install a "terminal" program. I would like to be able to run it as root (preferably only after supplying a pin/password) and execute the necessary linux command to remove the files for apps I do not need, like Opera. (Or maybe just move those files to the SD card so I could restore then easily if needed.) At least that is the way I would approach the task on a traditional linux system.

    It is my understanding android supports SUID programs. If so, it should be very easy to create a "su"-like app, install it into the filesystem, and leave normal access to this modied phone as being non-root. Or to rephrase, have the DEFAULT situation be non-root. Booting/Using the phone would be like using a non-rooted phone. Except there would be this su-like app would one gain "root" access. Or perhaps a su-terminal-emulator that would run with root access but that would be the only thing that runs with root access. To me, that is a much more sensible design.
     
  6. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male

    I am somewhat new to Android Forums myself and would just like to say , welocome to te community.
    As a rooted user for many years I would like to offer a few suggestions. I highly recommend the following

    https://forum.xda-developers.com/lg-g5

    The fact that you are 40yrs experience is with PC is a major plus. I will just give a few general pointer that are worth mentioning unlocked developer options bootloader, ADB, Fastboot, drivers for pc, TWRP (custom recovery) and backup all partitions before flashing or modify, save to external sd or pc , LGUP, LG Tool, ..... Be aware that my experience is with Samsung's and vaguely familiar with LGs.
    As far as updates or lack of, just might prove to be beneficial in your case. Generally speaking , root methods involved use security exploits to install su binarys.
     
    MoodyBlues and ocnbrze like this.
  7. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    Magisk is generally the preferred method theses days. I believe it aso has a root switch to turn root on and off when needed. Must toghle and reboot to take effect. My advise in regards to Linux/Unix is Mr MoodyBlues.
     
    MoodyBlues likes this.
  8. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    Imtyping i a rush getting ready for work so forgive the typos lol. Good luck
     
  9. MoodyBlues

    MoodyBlues Compassion counts.
    VIP Member
    Rank:
     #27
    Points:
    713
    Posts:
    6,071
    Joined:
    Jan 27, 2011

    Jan 27, 2011
    6,071
    4,825
    713
    Formerly Linux sysadmin/programmer
    $HOME/LosAngeles
    Slight correction, if I may? Ms MoodyBlues. :D
     
    ocnbrze and MrJavi like this.
  10. MoodyBlues

    MoodyBlues Compassion counts.
    VIP Member
    Rank:
     #27
    Points:
    713
    Posts:
    6,071
    Joined:
    Jan 27, 2011

    Jan 27, 2011
    6,071
    4,825
    713
    Formerly Linux sysadmin/programmer
    $HOME/LosAngeles
    I hear you. Even my laptops have big screens and full-sized keyboards, including the numeric pad on the right. I really only started heavily using my smartphone after a near-fatal illness. Being confined to bed, and too weak to sit up and use a laptop, once I was strong enough to prop up a phone and type, that's what I did. I keep my phone in airplane mode all the time except when I go out (for medical appointments). I have a landline that's used for 99.9% of my calls.

    Anyway, I totally understand your feelings/thoughts about your issue. It took me some getting used to Android, too. I kept saying/thinking, "but it's Linux! Why can't I do X, Y, Z?!" Well, it is -a- Linux, but there's something very important you need to keep in mind: Google assumed, correctly as it turned out, that window$ users would come to Android in droves.

    Now think about how stupid window$ is compared to *nix. Then factor in a generic clueless window$ user--who has never even had the ability, let alone the knowledge needed, to do the things we can do on *nix. They'd be dangerous if Android gave them those abilities. So it didn't. It created an easy-to-use, GUI-based OS that the masses could just jump in and use.

    Then some of us rebels came along, wanting more control and power, and rooting was born. And it was fun! I still have one rooted device in use, a Kindle Fire HD 8.9" that I made look/act/feel just like any other Android device, instead of a Kindle. I'll admit I get all warm and fuzzy when I drop to a command prompt and do real Linux stuff--but that's almost NEVER now. There's just no need.

    I use this fun app on my phones, UserLAnd, which lets you run various Linux distros. It doesn't give you root powers or anything, but it's fun.

    I'd love to see an su-like function on Android. It makes so much sense...for people like us, not the droves of window$ users who use Android. :rolleyes:
     
    ocnbrze and MrJavi like this.
  11. mikedt

    mikedt 你好
    Rank:
     #5
    Points:
    3,238
    Posts:
    27,339
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    27,339
    16,782
    3,238
    Teachaaa
    Jinan, China

    Removing apps from the system partition will NOT give you more room for installed user apps
    . On your full blown GNU/Linux PC you could run Gparted to resize the partitions, to give you more user space if necessary. Because of course Android been a compact embedded OS that runs on the Linux kernel, doesn't have GNU tools like Gparted included. And the partitioning in your phone is determined by the manufacturer, who decided to partition half of the 8GB for system use apparently.

    FWIW A smartphone for my uses and where I am is more than just communicating, like if I didn't have a smartphone, I would have to carry a wallet full of cash around. It's also entertainment for me. I travel a quite a lot, and the computer with the big-screen stays at home.
     
    #11 mikedt, Oct 11, 2019
    Last edited: Oct 11, 2019
    ocnbrze, MoodyBlues and MrJavi like this.
  12. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    True
     
    ocnbrze and mikedt like this.
  13. azalea4va

    azalea4va Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Oct 10, 2019

    Oct 10, 2019
    3
    0
    5
    I agree 100%. I would not put "su" in a stock android phone for all the reasons you state. But if it makes so much sense for the root community, I am surprised nobdoy has made it so.. Not to change the entire privlege structure but just allow limited raising to root access.

    Then can someone explain what is happening. After resettting the phone, I had 2GB of free space. Then I let the system loose to install updates to apps. Boom, I was down to 1.5 to 1GB of free space. No new apps installed, just allowing updates be applied to existing system apps. So what is being stored for system apps does appear to be affecting the amount of free space I have available for installing "optional" apps.

    That is one of the problems I have, I cannot see how storage space is laid out. I cannot see where system apps and "optional" apps are being intalled. I have a terminal emulaor and android lets me see what i in the root directory. But for example I cannot see what is in /data.
     
  14. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
     
  15. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    I have to admit, reading you post about Linux is very informative. The only experience I have was with this was years ago. I used Linux Deploy on Android (root). If I may ask your opinion, Pros and Cons using Linux vs Windows? Just General info, please
     
    #15 MrJavi, Oct 12, 2019
    Last edited: Oct 12, 2019
    ocnbrze likes this.
  16. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    You mention "changing the entire privileged structure" is this in reference to r/w? That may depend on the rom you install. Having root access grant the means to edit, port, modify, delete... anything and everything. Root provides me the means but its my experience that an additional step is need for full r/w. For instance, I'm running a rooted custom rom (ported, modifyed ,running silky smooth). To do so I had to change to full r/w. Thats the power of root.
    I should caution you that by doing so is without a doubt a security concern. Please use good judgment.

    A.png B.png
     
    #16 MrJavi, Oct 12, 2019
    Last edited: Oct 12, 2019
    MoodyBlues and ocnbrze like this.
  17. GameTheory

    GameTheory Android Expert
    Rank:
     #26
    Points:
    743
    Posts:
    4,256
    Joined:
    Jul 23, 2012

    I can explain this...

    When you buy your device for example, it comes with the Youtube app installed and located in "/system/app". When Youtube updates, the update goes to "/data/app" essentially leaving you with 2 versions of Youtube on your device. When you do a factory reset, the data partition gets wiped removing those app updates and you get the space back till apps start updating again.

    Now if you're interested, I wrote a tool that leverages ADB for non root users to give them a little more control. Option 6 of this tool will allow you to view and uninstall every app on the phone, including those in the data and system partitions. I made the tool open source and here it is(do make sure to read everything)...
    https://techstop.github.io/backup-and-debloat-android-no-root/
     
    MrJavi, MoodyBlues and ocnbrze like this.
  18. MrJavi

    MrJavi Well-Known Member
    Rank:
     #164
    Points:
    78
    Posts:
    152
    Joined:
    Aug 21, 2019

    Aug 21, 2019
    152
    104
    78
    Male
    Very impressive
     
    ocnbrze and GameTheory like this.

Share This Page

Loading...