Jump to content











Photo
- - - - -

boot_info_script: troubleshoot boot problems


  • Please log in to reply
2 replies to this topic

#1 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 27 April 2009 - 11:20 PM

boot_info_script is a bash script which searches all hard drives attached to the computer for information related to booting and displays it in a convenient format. Its primary use is for troubleshooting booting problems.

http://sourceforge.n...bootinfoscript/

An example RESULT.txt file from: http://ubuntuforums....d.php?t=1137710
============================= Boot Info Summary: ============================== => Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive     in partition #3 for /grub/stage2 and /grub/menu.lst. => No boot loader? is installed in the MBR of /dev/sdbsda1: _________________________________________________________________________    File system:       ntfs    Boot sector type:  Windows Vista    Boot sector info:  According to the info in the boot sector, sda1 starts                        at sector 2048. But according to the info from fdisk,                        sda1 starts at sector 63.    Operating System:      Boot files/dirs:   /bootmgr /BOOTMGR /boot/bcd /BOOT/bcd /Boot/bcd                        /boot/BCD /BOOT/BCD /Boot/BCDsda2: _________________________________________________________________________    File system:       ntfs    Boot sector type:  Windows Vista    Boot sector info:  According to the info in the boot sector, sda2 starts                        at sector 13942784. But according to the info from                        fdisk, sda2 starts at sector 13940640.    Operating System:  Windows Vista    Boot files/dirs:   /bootmgr /Boot/bcd /Boot/BCD                        /Windows/System32/winload.exe                        /Windows/System32/Winload.exesda3: _________________________________________________________________________    File system:       ext3    Boot sector type:  -    Boot sector info:      Operating System:      Boot files/dirs:   /grub/menu.lstsda4: _________________________________________________________________________    File system:       Extended Partition    Boot sector type:  -    Boot sector info:  sda5: _________________________________________________________________________    File system:       swap    Boot sector type:  -    Boot sector info:  sda6: _________________________________________________________________________    File system:       ext3    Boot sector type:  -    Boot sector info:      Operating System:  Debian GNU/Linux 5.0    Boot files/dirs:   /boot/grub/menu.lst /etc/fstabsda7: _________________________________________________________________________    File system:       vfat    Boot sector type:  Vista: Fat 32    Boot sector info:  No errors found in the Boot Parameter Block.    Operating System:      Boot files/dirs:   sdb1: _________________________________________________________________________    File system:       vfat    Boot sector type:  Vista: Fat 32    Boot sector info:  No errors found in the Boot Parameter Block.    Operating System:      Boot files/dirs:   =========================== Drive/Partition Info: =============================Drive: sda ___________________ _____________________________________________________Disk /dev/sda: 160.0 GB, 160041885696 bytes240 heads, 63 sectors/track, 20673 cylinders, total 312581808 sectorsUnits = sectors of 1 * 512 = 512 bytesDisk identifier: 0x9455d63aPartition  Boot         Start           End          Size  Id System/dev/sda1                  63    13,940,639    13,940,577  27 Hidden HPFS/NTFS/dev/sda2    *     13,940,640   175,694,399   161,753,760   7 HPFS/NTFS/dev/sda3         175,694,400   175,769,999        75,600  83 Linux/dev/sda4         175,770,000   312,605,999   136,836,000   f W95 Ext d (LBA)/dev/sda5         175,785,120   179,686,079     3,900,960  82 Linux swap / Solaris/dev/sda6         179,686,143   271,842,479    92,156,337  83 Linux/dev/sda7         271,842,543   312,575,759    40,733,217   b W95 FAT32/dev/sda4 ends after the last sector of /dev/sdaDrive: sdb ___________________ _____________________________________________________Disk /dev/sdb: 8019 MB, 8019509248 bytes5 heads, 32 sectors/track, 97894 cylinders, total 15663104 sectorsUnits = sectors of 1 * 512 = 512 bytesDisk identifier: 0xf244be00Partition  Boot         Start           End          Size  Id System/dev/sdb1               8,064    15,663,103    15,655,040   c W95 FAT32 (LBA)blkid -c /dev/null: ____________________________________________________________/dev/sda1: UUID="2A9C301D9C2FE1D5" LABEL="ServiceV002" TYPE="ntfs" /dev/sda2: UUID="C63E346A3E345621" LABEL="Windows System" TYPE="ntfs" /dev/sda3: UUID="ee46df09-e0d2-4ec0-ba0b-e312a5fc4df2" TYPE="ext3" /dev/sda5: TYPE="swap" /dev/sda6: LABEL="Debian Ext3" UUID="bbafb375-23dc-4b14-a80a-ce25db2f9c8d" TYPE="ext3" /dev/sda7: LABEL="OS SHARE" UUID="FEB3-0857" TYPE="vfat" /dev/sdb1: LABEL="PATRIOT" UUID="F416-CACF" TYPE="vfat" =============================== "mount" output: ===============================/dev/sda6 on / type ext3 (rw,errors=remount-ro)tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)proc on /proc type proc (rw,noexec,nosuid,nodev)sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)procbususb on /proc/bus/usb type usbfs (rw)udev on /dev type tmpfs (rw,mode=0755)tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)/dev/sda3 on /boot type ext3 (rw)nfsd on /proc/fs/nfsd type nfsd (rw)/dev/sdb1 on /media/PATRIOT type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=1000)============================= sda3/grub/menu.lst: =============================# menu.lst - See: grub(8), info grub, update-grub(8)#            grub-install(8), grub-floppy(8),#            grub-md5-crypt, /usr/share/doc/grub#            and /usr/share/doc/grub-legacy-doc/.## default num# Set the default entry to the entry number NUM. Numbering starts from 0, and# the entry number 0 is the default if the command is not used.## You can specify &#39;saved&#39; instead of a number. In this case, the default entry# is the entry saved with the command &#39;savedefault&#39;.# WARNING: If you are using dmraid do not change this entry to &#39;saved&#39; or your# array will desync and will not let you boot your system.default        0## timeout sec# Set a timeout, in SEC seconds, before automatically booting the default entry# (normally the first entry defined).timeout        15# Pretty colourscolor cyan/blue white/blue## password [&#39;--md5&#39;] passwd# If used in the first section of a menu file, disable all interactive editing# control (menu entry editor and command-line)  and entries protected by the# command &#39;lock&#39;# e.g. password topsecret#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/# password topsecret## examples## title        Windows 95/98/NT/2000# root        (hd0,0)# makeactive# chainloader    +1## title        Linux# root        (hd0,1)# kernel    /vmlinuz root=/dev/hda2 ro### Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST### BEGIN AUTOMAGIC KERNELS LIST## lines between the AUTOMAGIC KERNELS LIST markers will be modified## by the debian update-grub script except for the default options below## DO NOT UNCOMMENT THEM, Just edit them to your needs## ## Start Default Options #### default kernel options## default kernel options for automagic boot options## If you want special options for specific kernels use kopt_x_y_z## where x.y.z is kernel version. Minor versions can be omitted.## e.g. kopt=root=/dev/hda1 ro##      kopt_2_6_8=root=/dev/hdc1 ro##      kopt_2_6_8_2_686=root=/dev/hdc2 ro# kopt=root=/dev/sda6 ro## default grub root device## e.g. groot=(hd0,0)# groot=(hd0,2)## should update-grub create alternative automagic boot options## e.g. alternative=true##      alternative=false# alternative=true## should update-grub lock alternative automagic boot options## e.g. lockalternative=true##      lockalternative=false# lockalternative=false## additional options to use with the default boot option, but not with the## alternatives## e.g. defoptions=vga=791 resume=/dev/hda5# defoptions=## should update-grub lock old automagic boot options## e.g. lockold=false##      lockold=true# lockold=false## Xen hypervisor options to use with the default Xen boot option# xenhopt=## Xen Linux kernel options to use with the default Xen boot option# xenkopt=console=tty0## altoption boot targets option## multiple altoptions lines are allowed## e.g. altoptions=(extra menu suffix) extra boot options##      altoptions=(single-user) single# altoptions=(single-user mode) single## controls how many kernels should be put into the menu.lst## only counts the first occurence of a kernel, not the## alternative kernel options## e.g. howmany=all##      howmany=7# howmany=all## should update-grub create memtest86 boot option## e.g. memtest86=true##      memtest86=false# memtest86=true## should update-grub adjust the value of the default booted system## can be true or false# updatedefaultentry=false## should update-grub add savedefault to the default options## can be true or false# savedefault=false## ## End Default Options ##title        Debian GNU/Linux, kernel 2.6.26-2-amd64root        (hd0,2)kernel        /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro initrd        /initrd.img-2.6.26-2-amd64title        Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)root        (hd0,2)kernel        /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro singleinitrd        /initrd.img-2.6.26-2-amd64title        Debian GNU/Linux, kernel 2.6.18-6-amd64root        (hd0,2)kernel        /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro initrd        /initrd.img-2.6.18-6-amd64title        Debian GNU/Linux, kernel 2.6.18-6-amd64 (single-user mode)root        (hd0,2)kernel        /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro singleinitrd        /initrd.img-2.6.18-6-amd64### END DEBIAN AUTOMAGIC KERNELS LIST# This is a divider, added to separate the menu items below from the Debian# ones.title        Other operating systems:root# This entry automatically added by the Debian installer for a non-linux OS# on /dev/sda1title        Windows Vista/Longhorn (loader)root        (hd0,0)kernel /bootmgrchainloader /bootmgr#savedefault#makeactive#chainloader    +1# This entry automatically added by the Debian installer for a non-linux OS# on /dev/sda2title        Windows Vista/Longhorn (loader)root        (hd0,1)kernel /bootmgrchainloader /bootmgr#savedefault#makeactive#chainloader    +1# Trying yet more things!title        Windows Vista!find --set-root /bootmgrmakeactivekernel /bootmgrchainloader /bootmgr=================== sda3: Location of files loaded by Grub: ===================  89.9GB: grub/menu.lst  89.9GB: grub/stage2  89.9GB: initrd.img-2.6.18-6-amd64  89.9GB: initrd.img-2.6.18-6-amd64.bak  89.9GB: initrd.img-2.6.26-2-amd64  89.9GB: initrd.img-2.6.26-2-amd64.bak  89.9GB: vmlinuz-2.6.18-6-amd64  89.9GB: vmlinuz-2.6.26-2-amd64=========================== sda6/boot/grub/menu.lst: ===========================# menu.lst - See: grub(8), info grub, update-grub(8)#            grub-install(8), grub-floppy(8),#            grub-md5-crypt, /usr/share/doc/grub#            and /usr/share/doc/grub-legacy-doc/.## default num# Set the default entry to the entry number NUM. Numbering starts from 0, and# the entry number 0 is the default if the command is not used.## You can specify &#39;saved&#39; instead of a number. In this case, the default entry# is the entry saved with the command &#39;savedefault&#39;.# WARNING: If you are using dmraid do not change this entry to &#39;saved&#39; or your# array will desync and will not let you boot your system.default        0## timeout sec# Set a timeout, in SEC seconds, before automatically booting the default entry# (normally the first entry defined).timeout        15# Pretty colourscolor cyan/blue white/blue## password [&#39;--md5&#39;] passwd# If used in the first section of a menu file, disable all interactive editing# control (menu entry editor and command-line)  and entries protected by the# command &#39;lock&#39;# e.g. password topsecret#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/# password topsecret## examples## title        Windows 95/98/NT/2000# root        (hd0,0)# makeactive# chainloader    +1## title        Linux# root        (hd0,1)# kernel    /vmlinuz root=/dev/hda2 ro### Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST### BEGIN AUTOMAGIC KERNELS LIST## lines between the AUTOMAGIC KERNELS LIST markers will be modified## by the debian update-grub script except for the default options below## DO NOT UNCOMMENT THEM, Just edit them to your needs## ## Start Default Options #### default kernel options## default kernel options for automagic boot options## If you want special options for specific kernels use kopt_x_y_z## where x.y.z is kernel version. Minor versions can be omitted.## e.g. kopt=root=/dev/hda1 ro##      kopt_2_6_8=root=/dev/hdc1 ro##      kopt_2_6_8_2_686=root=/dev/hdc2 ro# kopt=root=/dev/sda6 ro## default grub root device## e.g. groot=(hd0,0)# groot=(hd0,2)## should update-grub create alternative automagic boot options## e.g. alternative=true##      alternative=false# alternative=true## should update-grub lock alternative automagic boot options## e.g. lockalternative=true##      lockalternative=false# lockalternative=false## additional options to use with the default boot option, but not with the## alternatives## e.g. defoptions=vga=791 resume=/dev/hda5# defoptions=## should update-grub lock old automagic boot options## e.g. lockold=false##      lockold=true# lockold=false## Xen hypervisor options to use with the default Xen boot option# xenhopt=## Xen Linux kernel options to use with the default Xen boot option# xenkopt=console=tty0## altoption boot targets option## multiple altoptions lines are allowed## e.g. altoptions=(extra menu suffix) extra boot options##      altoptions=(single-user) single# altoptions=(single-user mode) single## controls how many kernels should be put into the menu.lst## only counts the first occurence of a kernel, not the## alternative kernel options## e.g. howmany=all##      howmany=7# howmany=all## should update-grub create memtest86 boot option## e.g. memtest86=true##      memtest86=false# memtest86=true## should update-grub adjust the value of the default booted system## can be true or false# updatedefaultentry=false## should update-grub add savedefault to the default options## can be true or false# savedefault=false## ## End Default Options ##title        Debian GNU/Linux, kernel 2.6.26-2-amd64root        (hd0,2)kernel        /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro initrd        /initrd.img-2.6.26-2-amd64title        Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)root        (hd0,2)kernel        /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro singleinitrd        /initrd.img-2.6.26-2-amd64title        Debian GNU/Linux, kernel 2.6.18-6-amd64root        (hd0,2)kernel        /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro initrd        /initrd.img-2.6.18-6-amd64title        Debian GNU/Linux, kernel 2.6.18-6-amd64 (single-user mode)root        (hd0,2)kernel        /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro singleinitrd        /initrd.img-2.6.18-6-amd64### END DEBIAN AUTOMAGIC KERNELS LIST# This is a divider, added to separate the menu items below from the Debian# ones.title        Other operating systems:root# This entry automatically added by the Debian installer for a non-linux OS# on /dev/sda1title        Windows Vista/Longhorn (loader)root        (hd0,0)kernel /bootmgrchainloader /bootmgr#savedefault#makeactive#chainloader    +1# This entry automatically added by the Debian installer for a non-linux OS# on /dev/sda2title        Windows Vista/Longhorn (loader)root        (hd0,1)kernel /bootmgrchainloader /bootmgr#savedefault#makeactive#chainloader    +1# Trying yet more things!title        Windows Vista!find --set-root /bootmgrmakeactivekernel /bootmgrchainloader /bootmgr=============================== sda6/etc/fstab: ===============================# /etc/fstab: static file system information.## <file system> <mount point>   <type>  <options>       <dump>  <pass>proc            /proc           proc    defaults        0       0/dev/sda6       /               ext3    errors=remount-ro 0       1/dev/sda3       /boot           ext3    defaults        0       2/dev/sda5       none            swap    sw              0       0/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0=================== sda6: Location of files loaded by Grub: ===================  92.0GB: boot/grub/menu.lst  92.0GB: boot/grub/stage2  92.0GB: boot/initrd.img-2.6.18-6-amd64  92.0GB: boot/initrd.img-2.6.18-6-amd64.bak  92.0GB: boot/initrd.img-2.6.26-2-amd64  92.0GB: boot/initrd.img-2.6.26-2-amd64.bak  92.0GB: boot/vmlinuz-2.6.18-6-amd64  92.0GB: boot/vmlinuz-2.6.26-2-amd64  92.0GB: initrd.img  92.0GB: vmlinuz=======Devices which don&#39;t seem to have a corresponding hard drive==============hda =============================== StdErr Messages: ===============================umount: /tmp/BootInfo/sda7: device is busyumount: /tmp/BootInfo/sda7: device is busy
It is able to determine which MBR is installed to a certain device (by looking at the first two bytes of the hard drive to identify the boot code installed in the MBR):
  • Grub
  • Grub2
  • Windows
  • Syslinux
  • Lilo
  • Solaris
  • Testdisk
  • Gag
  • Grub4Dos
  • Plop
  • HP/Gateway
  • Acer 3
  • ThinkPad
  • BootIT NG
  • No boot loader
  • No known boot loader
For my hard disk and USB sticks, it gives:

============================= Boot Info Summary: ==============================

=> Gag is installed in the MBR of /dev/sda
=> Syslinux is installed in the MBR of /dev/sdb
=> Testdisk is installed in the MBR of /dev/sde



#2 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 17 May 2011 - 12:46 AM

boot_info_script v0.60 is released.

Some of the changes:
* Add Grub2 v1.99 support.

  * Display the embedded Grub2/burg config file.

  * Syslinux support added:

      - Check if Syslinux can find its second stage.

      - Display the version number.

      - Display the Syslinux directory in which Syslinux will look first for

        its config file.

      - Display content of Syslinux config file.

      - Display the ADV.

      - List all COM32(R) module files and display the major version number.

  * Add detection for the following MBRs:

      - Different Syslinux MBRs and versions (standard, GPT and ISOhybrid)

      - Diskcryptor

      - FreeDOS

      - SUSE generic MBR

      - Grub4dos

      - WEE

      - XOSL

  * Add detection for grub4dos installed in the PBR.

  * Add detection for FreeDOS PBR code.

  * List additional boot files when found:

      - SYSLINUX/EXTLINUX: ldlinux.sys and extlinux.sys

      - Grub4dos: grldr and grldr.bin

      - burg (Grub2 based): /burg/core.img and /boot/burg/core.img

      - Grub2: added /boot/grub2/core.img as alternative location

      - FreeDOS: kernel.sys

      - DellDiagnostics: dellbio.bin and dellrmk.bin

      - ReactOS: freeldr.sys qnd freeldr.ini

  * Display embedded config file for Grub4dos/WEE.

  * Add ReactOS support.


#3 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 17 May 2011 - 05:54 PM

boot_info_script v0.60 is released.

Seems like a handy script to have available! Or even to ask a user to run, to gather relevant information all at once. :dubbio:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users