If I boot into CentOS on my home server from a Live CD or USB stick and go to Troubleshoot, it lists OS's it finds on the machine. How does it find these OS's? Presumably it looks through all the partitions on all the hard disks for something that looks like an OS? But how exactly does it identify an OS? -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin
On Sat, Jan 23, 2016 at 01:50:42PM +0000, Timothy Murphy wrote:> If I boot into CentOS on my home server from a Live CD or USB stick > and go to Troubleshoot, it lists OS's it finds on the machine. > How does it find these OS's? > Presumably it looks through all the partitions on all the hard disks > for something that looks like an OS? > But how exactly does it identify an OS?I know that in el7, grub2 uses os-prober (http://joeyh.name/code/os-prober/), which is probably what it uses in the LiveCD. -- Jonathan Billings <billings at negate.org>
On Sat, Jan 23, 2016 at 6:50 AM, Timothy Murphy <gayleard at eircom.net> wrote:> If I boot into CentOS on my home server from a Live CD or USB stick > and go to Troubleshoot, it lists OS's it finds on the machine. > How does it find these OS's? > Presumably it looks through all the partitions on all the hard disks > for something that looks like an OS? > But how exactly does it identify an OS?Live CD does not have a troubleshoot boot sub menu option. This is available with non-lives like DVD and netinstall images. The "rescue a system" option uses the 'rescue' or more recently the 'inst.rescue' boot parameter, which tells anaconda to run the text rescue mode, and all of that code is found in anaconda and python-blivet. -- Chris Murphy
Chris Murphy wrote:> Live CD does not have a troubleshoot boot sub menu option.If I boot into CentOS-7-x86_64-LiveKDE-1503.iso there is a Troubleshooting option, and if I choose this there is an option to "Boot into Local Disk". Clicking on this gives a list of OS's to boot into. It seems this does run through all partitions, running os-prober on each. I thought os-prober was an object file, but I see it is a bash script, so hopefully I can see exactly what it does. -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin
Jonathan Billings wrote:> I know that in el7, grub2 uses os-prober > (http://joeyh.name/code/os-prober/), which is probably what it uses in > the LiveCD.Yes, thanks. I confused os-prober with grub2-probe, which is an executable file. Hopefully I should be able to work out why I am getting this cannot find a GRUB drive for /dev/block/8 error when I run grub2-mkconfig -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin