Boot Info Script - Troubleshoot boot problems

#1
With all the boot problems we get here, I thought this may prove to be useful.

SourceForge.net: Boot Info Script
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.
An example of a RESULTS.txt file (the boot info results returned after running the script) from [all variants] Resized Partitions with GParted - Cannot Boot Vista - Ubuntu Forums:
============================= 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/sdb

sda1: _________________________________________________________________________

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/BCD

sda2: _________________________________________________________________________

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.exe

sda3: _________________________________________________________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files/dirs: /grub/menu.lst

sda4: _________________________________________________________________________

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/fstab

sda7: _________________________________________________________________________

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 bytes
240 heads, 63 sectors/track, 20673 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x9455d63a

Partition 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/sda

Drive: sdb ___________________ _____________________________________________________

Disk /dev/sdb: 8019 MB, 8019509248 bytes
5 heads, 32 sectors/track, 97894 cylinders, total 15663104 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf244be00

Partition 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 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' 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 colours
color cyan/blue white/blue

## password ['--md5'] 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 'lock'
# 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-amd64
root (hd0,2)
kernel /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro
initrd /initrd.img-2.6.26-2-amd64

title 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 single
initrd /initrd.img-2.6.26-2-amd64

title Debian GNU/Linux, kernel 2.6.18-6-amd64
root (hd0,2)
kernel /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro
initrd /initrd.img-2.6.18-6-amd64

title 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 single
initrd /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/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
kernel /bootmgr
chainloader /bootmgr
#savedefault
#makeactive
#chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Windows Vista/Longhorn (loader)
root (hd0,1)
kernel /bootmgr
chainloader /bootmgr
#savedefault
#makeactive
#chainloader +1

# Trying yet more things!
title Windows Vista!
find --set-root /bootmgr
makeactive
kernel /bootmgr
chainloader /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 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' 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 colours
color cyan/blue white/blue

## password ['--md5'] 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 'lock'
# 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-amd64
root (hd0,2)
kernel /vmlinuz-2.6.26-2-amd64 root=/dev/sda6 ro
initrd /initrd.img-2.6.26-2-amd64

title 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 single
initrd /initrd.img-2.6.26-2-amd64

title Debian GNU/Linux, kernel 2.6.18-6-amd64
root (hd0,2)
kernel /vmlinuz-2.6.18-6-amd64 root=/dev/sda6 ro
initrd /initrd.img-2.6.18-6-amd64

title 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 single
initrd /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/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
kernel /bootmgr
chainloader /bootmgr
#savedefault
#makeactive
#chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Windows Vista/Longhorn (loader)
root (hd0,1)
kernel /bootmgr
chainloader /bootmgr
#savedefault
#makeactive
#chainloader +1

# Trying yet more things!
title Windows Vista!
find --set-root /bootmgr
makeactive
kernel /bootmgr
chainloader /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't seem to have a corresponding hard drive==============

hda
=============================== StdErr Messages: ===============================

umount: /tmp/BootInfo/sda7: device is busy
umount: /tmp/BootInfo/sda7: device is busy
boot_info_script: troubleshoot boot problems - Boot Land
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
  • Grub 2
  • Windows
  • Syslinux
  • Lilo
  • Solaris
  • TestDisk
  • Gag
  • Grub4Dos
  • Plop
  • HP/Gateway
  • Acer 3
  • Thinkpad
  • BootIT NG
  • No bootloader
  • No known bootloader
The author of the script goes by the username "Meierfra" at the Ubuntu forums, and is respected greatly by the community. The script only works from a Linux platform, not Windows, and so it is limited to users who either have a working Linux installed on their computer, or who have access to a LiveCD to run it from. The script needs to be saved to the Linux desktop (after downloading it), and then executed from the command line.
Run the script via:

sudo bash ~/Desktop/boot_info_script*.sh (if your OS uses sudo)

or

su -
bash /home/<username>/boot_info_script*.sh
(otherwise)

The results will be in the file RESULTS.txt on your desktop.

Hope this helps somebody.

Jake
 

mqudsi

Mostly Harmless
Staff member
#2
Excellent resource, thanks Jake.