Tuesday, June 28, 2016

Boot-Repair (other uses/ramblings)

Boot-Repair (other uses/ramblings)

I installed boot-repair on my new to my i5 ubuntu 16.04 LTS system so I could keep the generations of kernels installed limited (see my earlier but related post here: using boot-repair to keep installed kernels trimmed ). Tonight I had an epiphany (of sorts). I thought I should try this on my crouton chroot on my HP pavilion chromebook (butterfly) system and see what it produces in terms of system info that might prove useful. Besides this system has a fairly large but still limited amount of SSD storage after I expanded it to 128GB internal drive a while back. I've been running and upgrading the kernels on it for about three years so it definitely has built up a list of useless old kernel cruft that needs to be trimmed right?

Hmm, maybe not I found no grub entries for upgraded kernels on the crouton run boot-repair (Create Bootinfo Summary). Apparently and not surprisingly the chromeos does not use the grub bootloader to do it's magic. After browsing the crouton synaptic list of "kernel*" entries I was able to find and remove the accumulated cruft. Interestingly it does not include the actual kernels just the two header deb files are installed. I found and removed about ten of those guys in synaptic which seemed to work even though it barfed up what looked like a few errors in the console while it was removing the modules. Here is the launch dialog that was shown by synaptic:
I recovered about 340MB if the dialog above is to be believed. I did not do a before and after df so sadly I will never know the truth. Next time I upgrade the chroot I may do this exercise again and I will confirm savings via df during any such future exercise.  Even though I am a command line kind of guy and was disappointed not to be able to use the concise and easy way to remove the list of modules without dredging through miles of gui pages of kernel-* candidates in synaptic. I did not come up empty handed in this exercise...  I was pleasantly surprised with some other useful information that I was unaware of on my chromebook like how to change the chronos password for example. I am keeping copies of my Bootinfo Summary pages for both my machines on a thumb drive for future possible emergency use if my boot configurations melt down somehow.

In that earlier post I neglected to give a link to how to install the boot-repair facility. This link points to an official ubuntu how to page:
https://help.ubuntu.com/community/Boot-Repair
  • Note that I do NOT advocate actually using the boot-repair software's first button to actually attempt boot repair on a chromebook with or without crouton installed. It is great for linux computers but not sure what it might do to a chromebook boot configuration.

Postscript:
Okay I updated my chroot and it installed another set of headers: 105. So I ran the synaptic driven removal of the lowest one left installed last time and here are the results:
Here is the result of the df before and after....
# df -hm /usr
Filesystem                                          1M-blocks  Used Available Use% Mounted on
/mnt/stateful_partition/crouton/chroots/precise.pws    113999 66083     42119  62% /
# df -hm /usr
Filesystem                                          1M-blocks  Used Available Use% Mounted on
/mnt/stateful_partition/crouton/chroots/precise.pws    113999 65849     42353  61% /
                                                                                  --------
                                                                                  234MB
I think any reasonable person will agree that you don't want to just ignore these as they continue to build up over time on a machine with limited storage. Also it is pretty obvious you can't trust the synaptic dialog to give you the actual picture can you? I look at all gui software with a pretty jaundiced eye because I have to work with such tools all the time while working on gui software systems and I find that the trustworthiness of gui software in general is, in a word, atrocious at best.

Post Postscript:
Just running the Boot-repair bootinfo summary page generation seems to have corrupted this file and I had to restore it from my other system to get the apt based stuff to work again: /etc/apt/apt.conf.d/99synaptic
So I recommend not doing this on a chromebook. If anybody is interested I may post the content of the bootinfo summary I generated.