Cannot boot from New Ubuntu 11 install
I have just installed Ubuntu 11.04 as a new install on an empty system. When I reboot after the install finishes, I get
"error: out of disk"
grub rescue >
I tried booting from the installer and running the rescue to re-install Grub loader, and the boot system on /dev/sda, but get the same error. I tried install from CD and USB - No Difference. I also tried v8.04 and 10.04 - Same error each time.
The machine is a rack-mount Supermicro with 1gb RAM, 80gb Seagate IDE HD. It was formerly used as a VOIP phone system under Red-Hat Linux, so I know it should work.
It seems that the installer is not configuring grub and/or the mount point correctly.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu grub2 Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
The first boot device in the BIOS is HDD
Revision history for this message
|
#2 |
There is a standard script provided to analyse boot configuration. Could you download script at:
http://
Then in a terminal (Ctrl+Alt+T) run command:
sudo bash ./boot_
This will produce a file named: RESULTS.txt. Paste content of this file in http://
Revision history for this message
|
#3 |
ok - I have 25 years of experience with MicroSoft o/s - but little with unix.
How do I get from grub rescue > to a point where I can open a terminal session in order to run the script. I tried running ubuntu from CD, but how do I then change the current device from CD (presumably) to USB drive.
When I type "ls" from the grub rescus> prompt, I get (hd0) (hd0,msdos1) (fd0)
"set" gives me
(hd0,msdos1)
root=hd0,msdos1
Revision history for this message
|
#4 |
OK. Boot on Ubuntu CD ROM, and choose "Try" instead of "Install".
You could also reinstall Grub2 from CD: https:/
Revision history for this message
|
#5 |
Getting a bit fed up with this. Having run Ubuntu from the CD, and got a desktop, cannot run Gnome from Alt-F2.
Ubyuntu is touted as a replacement for Windows. I tried running the 11.04 installer on another PC with a 120gb SATA drive and 2gb RAM. When I reboot I get Error "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER"
Surely it is not too much to expect that an operating system can partition an empty hard disk according to it's requirements and install an operating system that will allow the system to boot, without requiring the user to have a full knowledge of command line operation of Linux. Even Windows 95 did that, as did MsDos 3.0.
Revision history for this message
|
#6 |
I have the same problem. Once the installation is complete and i reboot the following error appears:
error: out of disk
grub rescue>
Revision history for this message
|
#7 |
Ok - Finally managed to get a terminal session.
Result.txt is at http://
Thanks
Revision history for this message
|
#8 |
1) When I reboot I get Error "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER"
The OS can do nothing if media can't be booted! Check BIOS boot order, media and ISO image
https:/
2) => Grub 2 is installed in the MBR of /dev/sda and looks for b2d. !!
b2d isn't name of a partition, so MBR is corrupted
could you paste result of command:
sudo hexdump -x -n 512 /dev/sda
In any case, you can both log a bug. Please add bug number in question.
@John: could you run also http://
Revision history for this message
|
#9 |
I am a bit confused....so bear with me.
1) Insert Ubuntu 11.04 CD
2) Go to terminal (While running from the CD)
3) Type the following command: ubuntu@ubuntu:~$ sudo hexdump -x -n 512 /dev/sda
4) boot_info_
a) How do I use this?
b) How do I get it from one pc to another pc that has no operating system?
For me...problem not solved.
Revision history for this message
|
#10 |
Delance,
I am a bit confused....so bear with me.
1) Insert Ubuntu 11.04 CD
2) Go to terminal (While running from the CD)
3) Type the following command: ubuntu@ubuntu:~$ sudo hexdump -x -n
512 /dev/sda
4) boot_info_
a) How do I use this?
b) How do I get it from one pc to another pc that has no
operating system?
error message.
found. Either this file is not
multi-part archive. In the
file comment will be found on
/tmp/aso3setup_
cannot find /typ/aso3setup_
For me...problem not solved.
Thanks,
John
_______
From: delance <email address hidden>
To: <email address hidden>
Sent: Tue, May 10, 2011 2:56:20 PM
Subject: Re: [Question #156397]: Cannot boot from New Ubuntu 11 install
Question #156397 on grub2 in Ubuntu changed:
https:/
Status: Open => Answered
delance proposed the following answer:
1) When I reboot I get Error "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS
ENTER"
The OS can do nothing if media can't be booted! Check BIOS boot order, media and
ISO image
https:/
2) => Grub 2 is installed in the MBR of /dev/sda and looks for b2d. !!
b2d isn't name of a partition, so MBR is corrupted
could you paste result of command:
sudo hexdump -x -n 512 /dev/sda
In any case, you can both log a bug. Please add bug number in question.
@John: could you run also http://
--
You received this question notification because you are a direct
subscriber of the question.
Revision history for this message
|
#11 |
From bootinfoscript
#!/bin/bash
VERSION=0.55
DATE="February 15th, 2010"
#to use this script:
#
# sudo bash boot_info_
#or
# su -
# bash boot_info_
#
#
### last-modified
#
#author Ulrich Meierfrankenfeld (aka meierfra.)
# with contributions from caljohnsmith
# (both members of ubuntuforums.org)
# and Gert Hulselmans
#
#hosted at: http://
#
#The birth of the boot info script:
# http://
#
#Looks at all MBRs and identifies the boot loader.
# For Grub and Supergrub: displays the controlling partition.
# If the MBR is unknown, displays the whole MBR.
#Looks at all partitions:
# Determines their type
# Identifies their boot sectors.
# For grub: displays the controlling partition and the offset
# of the stage2 file as recorded in the boot sector.
# For NTFS and Fat, examines the Boot Parameter Block for errors.
# Identifies the operating system
# Lists boot programs.
# Displays the partition table
# Displays "blkid -c /dev/null"
# Finds boot directories and displays their contents.
# Looks in "/" and "NST" for bootpart codes and displays the offset
# and boot drive it is trying to chainload
# Looks on "/" and "/NST" for stage1 files and displays the offset
# and bootdrive of the stage 2 files is trying to chainload.
# Displays boot configuration files.
# Is able to search LVM partitions if the LVM2 package is install
# ("apt-get install lvm2" in debian based distros)
# Is able to search Linux Software Raid partitions (MD Raids) if
# the "mdadm" package is installed.
# If dmraid is installed, searches all raid drives, detected by dmraid.
#All information is written to the file "RESULTS.txt" in the
# same folder as the script. But when run from /bin, /sbin, /usr/bin,
# or other system folder the file "RESULTS.txt" is written to the
# home directory of the user who runs this script.
###### Display version and date of the script when asked:
# ./boot_info_script -v
# ./boot_info_script -V
# ./boot_info_script --version
if [ x"$1" = x'-v' ] || [ x"$1" = x'-V' ] || [ x"$1" = x'--version' ] ;
then
echo "boot_info_script version $VERSION"
echo "Dated , $DATE"
exit 0
fi
###### Check if all necessary programs are available
Programs="
awk
basename
blkid
cat
dd
dirname
expr
fdisk
filefrag
fold
grep
hexdump
losetup
ls
mkdir
mount
pwd
rm
sed
sort
umount
wc
whoami"
Check_Prog=1;
for Program in $Programs ; do
if ! type $Program > /dev/null 2>&1 ; then
echo \"$Program\" could not be found. >&2
Check_Prog=0;
fi
done
if [ $Check_Prog -eq 0 ];
then
echo "Please install the missing program(s) and run boot_info_script again." >&2
exit 1;
fi;
###### check whether user is root
if [ $(whoami) != "root" ];
then
echo Please use \"sudo\" or become \"root\" to run this script. >&2;
exit 1;
fi;
######## List of folders which might contained files used for chainloading
Boot_Codes_Dir="
/
/NST/
"
################# List of folders whose content will be displayed
################# Since all the important files in these folder are already displayed
################# it doesn't seem necessary to display the contents of these folders.
#Boot_Dir="
# /Boot
# /boot
# /BOOT
# /boot/grub
# /grub
# /ubuntu/disks
# /ubuntu/disks/boot/
# /ubuntu/
# /ubuntu/
# /ubuntu/
# /NST
# "
############## List of files whose names will be displayed (if they exists)
Boot_Prog_Normal="
/bootmgr /BOOTMGR
/boot/bcd /BOOT/bcd /Boot/bcd /boot/BCD /BOOT/BCD /Boot/BCD
/Windows/
/Windows/
/grldr /GRLDR
/ntldr /NTLDR
/NTDETECT.COM /ntdetect.com
/NTBOOTDD.SYS /ntbootdd.sys
/wubildr.mbr /ubuntu/
/wubildr /ubuntu/
/ubuntu/
/ubuntu/
/ubuntu/
/core.img /grub/core.img /boot/grub/core.img
/boot/map /map
/DEFAULT.MNU /default.mnu
/IO.SYS /io.sys
/MSDOS.SYS /msdos.sys
/COMMAND.COM /command.com
"
Boot_Prog_Fat="
/bootmgr
/boot/bcd
/Windows/
/grldr
/ntldr
/NTDETECT.COM
/NTBOOTDD.SYS
/wubildr.mbr
/wubildr
/ubuntu/
/ubuntu/
/ubuntu/
/ubuntu/
/ubuntu/
/core.img /grub/core.img /boot/grub/core.img
/boot/map /map
/DEFAULT.MNU
/IO.SYS
/MSDOS.SYS
/COMMAND.COM
"
############### List of files whose contents will be displayed.
Boot_Files_Normal="
/boot/
/grub.cfg /grub/grub.cfg /boot/grub/grub.cfg
/ubuntu/
/boot/
/boot.ini /BOOT.INI
/etc/fstab
/etc/lilo.conf /lilo.conf
"
Boot_Files_Fat="
/boot/
/grub.cfg /grub/grub.cfg /boot/grub/grub.cfg
/ubuntu/
/boot/
/boot.ini
/etc/fstab
/etc/lilo.conf /lilo.conf
"
############### List of files whose end point (in GB) will be displayed.
GrubError18_Files="
boot/
ubuntu/
boot/
grub.cfg grub/grub.cfg boot/grub/grub.cfg
core.img grub/core.img boot/grub/core.img
boot/
boot/vmlinuz* vmlinuz* ubuntu/
boot/initrd* initrd* ubuntu/
boot/
initramfs* boot/initramfs*
"
####### Directory containing the script.
Dir=$(cd "$(dirname "$0")";pwd);
# Set $Dir to the home folder of the current user if the script is in one of the
# system folders
# This allows placement of the script in /bin, /sbin, /usr/bin, ...
# while still having a normal location to write the output file.
for systemdir in /bin /boot /cdrom /dev /etc /lib /lost+found /opt /proc /sbin /selinux /srv /sys /usr /var; do
if [ $(expr "$Dir" : $systemdir) -ne 0 ]; then
Dir="$HOME"
break
fi
done
######## To avoid overwriting existing files, look for a non-existing file
######## RESULT.txt RESULTS1.txt RESULTS2.txt ...
LogFile=
while ( [ -e "${LogFile}
do
if [ "j" = "" ]; then j=0; fi;
j=$((j+1));
wait;
done
LogFile=
###### Redirect stdout to RESULT File
#exec 6>&1
#exec > "$LogFile"
########### Create previously non-existing folder of the form
########## /tmp/BootInfo /tmp/BootInfo1, /tmp/BootInfo2 ...
Folder=
i=0;
while (! mkdir ${Folder}${i} 2>/dev/null)
do
i=$((i+1));
wait;
done
Folder=
cd $Folder
Log=$Folder/Log #File to record the summary.
Log1=$Folder/Log1 # Most of the information which is not part of
Error_Log=
Trash=$Folder/Trash # File to catch all usual Standard Errors
Mount_Error=
Unknown_
Tmp_Log=
PartitionTable=
FakeHardDrives=
BLKID=$Folder/BLKID # File to store the output of blkid
exec 2>$Error_Log #Redirect all standard error to the file Error_Log
All_Hard_
if type dmraid >>$Trash 2>>$Trash;
then
InActiveDMRai
if [ "$InActiveDMRaid" = "no raid disks" ];
then
InActiveD
fi;
if [ "$InActiveDMRaid" != "" ];
then
dmraid -ay $InActiveDMRaid >>$Trash;
fi;
if [ "$(dmraid -sa -c)" != "no raid disks" ];
then
fi;
fi;
####Arrays to hold information about Partitions: name, starting sector, ending sector, size in sector, Partition Type, Filesystem typ, UUID, Kind(Logical, Primary, Extended), HardDrive, boot flag, parent (for logical partitions), label, system(the partition id according the partition table), the device associate to the partition.
declare -a NamesArray StartArray EndArray SizeArray TypeArray FileArray UUIDArray KindArray DriveArray BootArray ParentArray LabelArray SystemArray DeviceArray
#####Arrays to hold information about the harddrives.
declare -a HDName FirstPartion LastPartition HDSize HDMBR HDHead HDTrack HDCylinder HDPT HDStart HDEnd HDUUID;
####Array for Hard drives formated as Filesystem
declare -a FilesystemDrives;
PI=-1 ## Counter for the identification number of a partition. (each partition gets unique number)
HI=0 ## Counter for the identification number of a hard drive. (each hard drive gets unique number)
PTFormat='%-10s %4s%14s%14s%14s %3s %s\n'; ### standard format to use for Partition table,
#### fdisk -s seems to malfunction sometimes. So use sfdisk -s if available
function fdisks (){
if type sfdisk >>$Trash 2>>$Trash
then
sfdisk -s "$1" 2>>$Trash;
else
fdisk -s "$1" 2>>$Trash;
fi;
}
##### A function which checks whether a file is on a mounted partition
MountPoints=$(mount | grep -e ^/dev |awk '{print $3}' |grep -v ^/$); ##list of mountpoints for devices
function FileNotMounted (){
local File=$1 curmp=$2;
for mp in $MountPoints;
do
if [ $(expr match "$File" "$mp""/" ) -ne 0 ] && [ "$mp" != "$curmp" ]
then
return 1;
fi;
done;
return 0;
}
##### A function which converts the two digit hexcode of a partition type
# The following list is taken from sfdisk -T and
# http://
# work in progress
function HexToSystem () {
local type=$1 system
case $type in
0) system="Empty";;
1) system="FAT12";;
2) system="XENIX root";;
3) system="XENIX usr";;
4) system="FAT16 <32M";;
5) system="Extended";;
6) system="FAT16";;
7) system=
8) system="AIX";;
9) system="AIX bootable";;
a) system="OS/2 Boot Manager";;
b) system="W95 FAT32";;
c) system="W95 FAT32 (LBA)";;
e) system="W95 FAT16 (LBA)";;
f) system="W95 Ext d (LBA)";;
10) system="OPUS";;
11) system="Hidden FAT12";;
12) system="Compaq diagnostics";;
14) system="Hidden FAT16 <32M";;
16) system="Hidden FAT16";;
17) system="Hidden HPFS/NTFS";;
18) system="AST SmartSleep";;
1b) system="Hidden W95 FAT32";;
1c) system="Hidden W95 FAT32 (LBA)";;
1e) system="Hidden W95 FAT16 (LBA)";;
24) system="NEC DOS";;
27) system="Hidden HPFS/NTFS";;
32) system="NOS";;
35) system="JFS on OS2";;
38) system="Theos";;
39) system="Plan 9";;
3a) system="Theos";;
3b) system="Theos Extended";;
3c) system=
40) system="Venix 80286";;
41) system="PPC PReP Boot";;
42) system="SFS";;
45) system="Boot-US boot manager";;
4d) system="QNX4.x";;
4e) system="QNX4.x 2nd part";;
4f) system="QNX4.x 3rd part";;
50) system="OnTrack DM";;
51) system="OnTrack DM6 Aux1";;
52) system="CP/M";;
53) system="OnTrack DM6 Aux3";;
54) system=
55) system="EZ-Drive";;
56) system="Golden Bow";;
5c) system="Priam Edisk";;
61) system=
63) system="GNU HURD or SysV";;
64) system="Novell Netware 286";;
65) system="Novell Netware 386";;
70) system="DiskSecure Multi-Boot";;
75) system="PC/IX";;
80) system="Old Minix";;
81) system="Minix / old Linux";;
82) system="Linux swap / Solaris";;
83) system="Linux";;
84) system="OS/2 hidden C: drive";;
85) system="Linux extended";;
86) system="NTFS volume set";;
87) system="NTFS volume set";;
88) system="Linux plaintext";;
8e) system="Linux LVM";;
93) system=
94) system="Amoeba BBT";;
9f) system="BSD/OS";;
a0) system="IBM Thinkpad hibernation";;
a5) system="FreeBSD";;
a6) system="OpenBSD";;
a7) system="NeXTSTEP";;
a8) system="Darwin UFS";;
a9) system="NetBSD";;
ab) system="Darwin boot";;
af) system="HFS";;
b0) sytem="Boot Star";;
b1 | b2 | b3 | b4 | b6) system=
b7) system="BSDI fs";;
b8) system="BSDI swap";;
bb) system="Boot Wizard hidden";;
bc) system="Acronis BackUp";;
be) system="Solaris boot";;
bf) system="Solaris";;
c0) system="CTOS";;
c1) system="DRDOS/sec (FAT-12)";;
c2) system="Hidden Linux/PowerBoot";;
c3) system="Hidden Linux Swap /PowerBoot";;
c4) system="DRDOS/sec (FAT-16 < 32M)";;
c6) system="DRDOS/sec (FAT-16)";;
c7) system="Syrinx";;
cb) system="DR-DOS FAT32 (CHS)";;
cc) system="DR-DOS FAT32 (LBA)";;
cd) system="CTOS Memdump?";;
ce) system="DR-DOS FAT16X (LBA)";;
cf) system=" DR-DOS EXT DOS (LBA)";;
d0) system=" REAL/32 secure big partition";;
da) system="Non-FS data";;
db) system="CP/M / CTOS / ...";;
dd) system="Dell Media Direct";;
de) system="Dell Utility";;
df) system="BootIt";;
e1) system="DOS access";;
e3) system="DOS R/O";;
e4) system=
eb) system="BeOS fs";;
ee) system="GPT";;
ef) system="EFI (FAT-12/16/32)";;
f0) system=
f1) system=
f4) system=
f2) system="DOS secondary";;
fb) system="VMware VMFS";;
fc) system="VMware VMKCORE";;
fd) system="Linux raid autodetect";;
fe) system="LANstep";;
ff) system="BBT";;
*) system="Unknown";;
esac;
echo $system;
}
##### Function to convert GPT's Partition Type.
#### ABCDEFGH-
#### GHEFCDAB-
function UUIDToSystem() {
local type=$1 system
case $type in
00000000000
41ee4d02e73
28732ac11ff
a2a0d0ebe5b
6dfd5706aba
16e3c9e35c0
79d3d6e607f
00534648000
48616821496
esac;
echo $system;
}
##### Function which insert a comma every third digit of a number
function InsertComma () {
echo $1 |sed -e :a -e 's/\(.*
}
##### Function to read 4 bytes starting at $1 of device $2 and convert to decimal.
function Read4Bytes () {
echo $(hexdump -v -s $1 -n 4 -e '4 "%u"' $2);
}
##### Function to read 8 bytes starting at $1 of device $2 and convert to decimal.
function Read8Bytes () {
local start=$1 device=$2;
local first4 second4;
first4=$(hexdump -v -s $start -n 4 -e '4 "%u"' $device);
second4=$(hexdump -v -s $((start+4)) -n 4 -e '4 "%u"' $device);
echo $((second4*
}
#### Functions to pretty print blkid output ######
BlkidFormat='%-16s %-38s %-10s %-30s\n'
BlkidTag (){
echo $(blkid -c /dev/null -s $2 -o value $1 2>>$Trash)
}
PrintBlkid (){
local part=$1;
if [ "$(blkid -c /dev/null $part 2>$Tmp_Log)" != "" ];
then
printf "$BlkidFormat" "$part" "$(BlkidTag $part UUID)" "$(BlkidTag $part TYPE)" "$(BlkidTag $part LABEL)">>$BLKID;
else blkid -p "$part" 2>&1 |grep "$part" >>$BLKID; #blkid -p is not avaible all all systems. This contructs makes sure the "usage" message is not displayed, but catches the "ambivalent" error.
fi;
}
## Reads and display the a partition table of an extended partitons ###########
############# and check the partition check for errors #######
# This function can be applied iteratively to read the extended partiton table
# Variable 1: HI of hard drive
# Variable 2: Start Sector of the extended Partition,
# Variable 3: Number of partitions in table (4 for regular PT, 2 for logical
# Variable 4: File for storing the partitions table.
# Variable 5: Format to use for displaying the partition table.
# Variable 6: PI of the primary extended partition containing the extended partition.
# ( equals "" for hard drive)
# Variable 7: Last Linux Index assigned (the number in sdXY).
ReadPT (){
local HI=$1 StartEx=$2 N=$3 PT_file=$4 format=$5 EPI=$6 Base_Sector
local LinuxIndex=$7 boot size start end type drive system;
local i=0 boot_hex label limit MBRSig
drive=$
limit=$
$(dd if=$drive skip=$StartEx of=$Tmp_Log count=1 2>>$Trash);
MBRSig=$(hexdump -v -s 510 -n 2 -e '"%x"' $Tmp_Log);
[[ "$MBRSig" != "aa55" ]] && echo Invalid MBR Signature found >> $PT_file;
if [[ $StartX -lt $limit ]];
then # set Base_Sector to 0 for HardDrive, and to the start
# sector of primary extended partition otherwise
[[ "$EPI" = "" ]] && Base_Sector=0 || Base_Sector=
for (( i=0; i < N; i++ ));
do
$(dd if=$drive skip=$StartEx of=$Tmp_Log count=1 2>>$Trash);
case $boot_hex in
00) boot=" ";;
80) boot="* ";;
*) boot="?";;
esac;
start=$(hexdump -v -s $((454+16*i)) -n 4 -e '4 "%u"' $Tmp_Log);
size=$(hexdump -v -s $((458+16*i)) -n 4 -e '4 "%u"' $Tmp_Log);
type=$(hexdump -v -s $((450+16*i)) -n 1 -e '4 "%x"' $Tmp_Log);
if [[ $size != 0 ]];
then
if [[ ( "$type" = "5" || "$type" = "f" ) && $Base_Sector != 0 ]];
then
start=
# relative to the start sector of an primary extended partition.
if [[ $i = 0 ]];
ReadPT $HI $start 2 $PT_file "$format" $EPI $LinuxIndex;
else
((PI++))
if [[ "$type" = "5" || "$type" = "f" ]];
then
else
start=
# relative to the start sector of directly assocated extented partition.
[[ $Base_Sector = 0 ]] && KindArray[$PI]="P" || KindArray[$PI]="L";
fi;
LinuxIndex=
end=$
[[ "${HDPT[$HI]}" = "BootIt" ]] && label="
system=
printf "$format" "$label$LinuxIndex" "$boot" $(InsertComma $start) "$(InsertComma $end)" "$(InsertComma $size)" "$type" "$system" >> $PT_file;
NamesArray[
StartArray[
EndArray[
TypeArray[
SystemArray[
SizeArray[
BootArray[
DriveArray[
ParentArray[
( [[ "$EPI" = "" ]] || [[ ${DeviceArray[
if [[ "$type" = "5" || "$type" = "f" ]];
then
fi;
fi;
elif [[ $Base_Sector != 0 && $i = 0 ]];
then
echo "Empty Partition"
else
LinuxIndex
fi;
done;
else
echo "EBR refers to a location outside the Hard drive" >>$PT_file;
fi;
}
############### Read partition table of type GPT (GUID, EFI)###
###### Variable 1: HI of hard drive
###### Variable 2: File to store the PartitionTable
function ReadEFI() {
local HI=$1 drive file=$2 Size N=0 i=0 format Label PRStart Start End Type Size System;
drive=
format='%-10s %14s%14s%14s %s\n';
printf "$format" Partition Start End Size System >> $file;
HDStart[
HDEnd[
HDUUID[
for (( i = 0; i< N; i++ ))
do
if [ "$Type" != "00000000000000
then
((PI++))
End=$(Read8Bytes $((PRStart+
printf "$format" "$Label" "$(InsertComma $Start)" "$(InsertComma $End)" "$(InsertComma $Size)" "$System" >>$file;
fi;
done;
}
############### Read the Master Partition Table of BootIt NG#####
###### Variable 1: HI of hard drive
###### Variable 2: File to store the MPT.
function ReadEMBR() {
local HI=$1 drive MPT_file=$2 Size N=0 i=0 BINGIndex Label Start End Type BINGUnknown format Size System StoredPI FirstPI=
drive=
format='%-18s %4s%14s%14s%14s %3s %-15s %3s %2s\n';
printf "$format" Partition Boot Start End Size Id System Ind "?">> $MPT_file;
N=$(hexdump -v -s 534 -n 1 -e '"%u"' $drive);
while [[ $i -lt "$N" ]]
do
New=1;
Start=$(hexdump -v -s $((542+28*i)) -n 4 -e '4 "%u"' $drive);
End=$(hexdump -v -s $((546+28*i)) -n 4 -e '4 "%u"' $drive);
BINGIndex=
Type=$(hexdump -v -s $((551+28*i)) -n 1 -e '"%x"' $drive);
Label=$(hexdump -v -s $((552+28*i)) -n 15 -e '"%_u"' $drive| sed -e s/nul[^$]*//);
printf "$format" "$Label" "-" "$(InsertComma $Start)" "$(InsertComma $End)" "$(InsertComma $Size)" "$Type" "$System" "$BINGIndex" "$BINGUnknown"
for ((j = FirstPI; j<=LastPI; j++ ));
do
if (( ${StartArray[$j]} == $Start ));
then
fi;
done;
if (( $New == 1 ));
then
fi;
if [[ $Type = "f" || $Type = "5" ]];
then
ReadPT $HI $Start 2 $MPT_file "$format" $PI 4 ;
else
fi;
((i++));
done;
}
################# Check partition table for errors #######
###
### This function checks whether any two partitions overlap
### and the logical partitions are inside the extended partition.
### Variable 1: PI of First partition to consider
### Variable 2: PI of Last Partition to consider
### Variable 3: File for the error messages.
### Variable 4: HI of containing hard drive
CheckPT () {
local first=$1 last=$2 file=$3; hi=$4;
local Si Ei Sj Ej Ki Kj i j k cyl track head cyl_bound sec_bound
cyl=
track=
head=
cyl_
sec_
for (( i=$first; i <= last; i++ ));
do
if [[ "$Ei" -gt "$sec_bound" ]];
then
echo $Ni ends after the last sector of ${HDName[
elif [[ "$Ei" -gt "$cyl_bound" ]]
then
echo $Ni ends after the last cylinder of ${HDName[
fi;
if [[ $Ki = "L" ]];
then
k=
[[ $Si -le $Sk || $Ei -gt $Ek ]] && echo the logical partition $Ni is not contained in the extended partition $Nk>>$file;
fi;
for (( j = i+1; j <= last; j++ ));
do
[[ !( ( $Ki = "L" && $Kj = "E" ) || ( $Ki = "E" && $Kj = "L" ) ) && ( ( $Si -lt $Sj && $Sj -lt $Ei ) || ($Sj -lt $Si && $Si -lt $Ej ) )]] && echo $Ni overlaps with $Nj >>$file;
done;
done
}
#######
########## Determine the embeded location of stage 2 in a stage 1 file,
########## look for the stage 2 and, if found, determine the
#########$ the location and the path of the embedded menu.lst
stage2_loc (){
local stage1=$1 hi;
offset=$(hexdump -v -s 68 -n 4 -e '4 "%u"' $stage1 2>>$Trash);
dr=$(hexdump -v -s 64 -n 1 -e '"%d"' $stage1);
pa="T"
Grub_Version="";
for hi in ${!HDName[@]};
do
hdd=
if [ $offset -lt ${HDSize[hi]} ];
then
tmp=$(dd if=$hdd skip=$offset count=1 2>>$Trash | hexdump -v -n 4 -e '"%x"');
if [[ "$tmp" = 3be5652 || "$tmp" = bf5e5652 ]]; ### If stage2 files was found.
then
dd if=$hdd skip=$((offset+1)) count=1 of=$Tmp_Log 2>>$Trash;
fi;
fi;
done;
dr=$((dr-127))
Stage2_Msg=$(echo looks at sector $offset )
if [ "$dr" = 128 ];
then
Stage2_
else
Stage2_
fi;
Stage2_Msg=$(echo $Stage2_Msg for the stage2 file);
if [ "$pa" = "T" ] #### no stage 2 file found.
then
Stage2_
else
pa=$((pa+1))
Stage2_
if [ "$pa" = 256 ];
then
else
fi;
Stage2_
fi;
}
#######
#######
########## Determine the embeded location of core.img for a Grub2 boot.img file,
########## look for the core.img and, the path of the Grub Folder.
#######
core_loc (){
local stage1=$1 grub2_version=$2 hi offset_loc dr_loc dir_loc;
case $grub2_version in
1.96) offset_loc=68; dr_loc=76; dir_loc=32;;
1.97) offset_loc=92; dr_loc=91; dir_loc=28;;
esac;
offset=$(hexdump -v -s $offset_loc -n 4 -e '4 "%u"' "$stage1" 2>>$Trash);
dr=$(hexdump -v -s $dr_loc -n 1 -e '"%d"' "$stage1");
pa="T"
for hi in ${!HDName[@]};
do
hdd=
if [ $offset -lt ${HDSize[hi]} ];
then
tmp=$(dd if="$hdd" skip=$offset count=1 2>>$Trash | hexdump -v -n 4 -e '"%x"');
if [ "$tmp" = 1bbe5652 ]; ### If conf.img file was found.
then
dd if=$hdd skip=$((offset+1)) count=1 of=$Tmp_Log 2>>$Trash;
fi;
fi;
done;
Core_Msg=$(echo looks at sector $offset of the same hard drive for core.img)
if [ "$pa" = "T" ]
then #### core.img not found.
Core_
else #### core.img found.
pa=$((pa+1))
Core_
if [ "$pa" = 255 ];
then
else
fi;
fi;
}
#######
############### Get_Partition_Info search a partition for information relevant for booting.
####Variables:
#### log $1 local version of RESULT.txt#### log1 $2 local version of log1
#### part $3 device for the partition
#### name $4 descriptive name for the partition
#### mountname $5 path where partition will be mounted.
### kind $6 kind of the partition
### start $7 starting sector of the partition
### end $8 ending sector of the partition
### system $9 system of the partition
### pi $10 pi of the partition, (equal to "" if not a regular partition.
Get_Partition_
local Log="$1" Log1="$2" part="$3" name="$4" mountname="$5" kind="$6" start="$7" end="$8" system="$9" pi="${10}";
local size=$((end-start)) BST="" BSI="" BFI="" OS="" BootFiles="";
echo "Searching $name for information... ";
PrintBlkid $part;
[[ "$system" == "Bios Boot Partition" ]] && type="Bios Boot Partition"
[[ $pi != "" ]] && FileArray[
echo "$name: _______
mkdir -p "$mountname" #### Directory where the partition will be mounted.
if [[ "$kind" = "E" && "$type" = "" ]] ; #### Check for extended partion.
then
type="Extended Partition";
cat $Tmp_Log>>$Trash; ### Don't display the error message from blkid for extended partition
else
cat $Tmp_Log>
fi;
echo " File system: "$type>>"$Log"; ### Display the File System Type
case $Bytes8081 in
10f) BST="HP Recovery";;
19d) BST="BSD4.4: Fat32";;
211) BST="Dell Utility: Fat16";;
734) BST=Dos_1.0;;
745) BST="Vista: Fat 32";;
89e) BST="MSDOS5.0: Fat 16";;
8cd) BST="Windows XP";;
488) BST="Grub 2's core.img";;
b60) BST="Dell Utility: Fat16";;
bd0) BST="MSWIN4.1: Fat 32";;
e00) BST="Dell Utility: Fat16";;
2d5e) BST=Dos_1.1;;
3a5e) BST="Recovery:Fat 32";;
4445) BST="DEll Restore: Fat32";;
55aa) BST="Windows Vista/7";;
55cd) BST="Fat32";;
6616) BST=Fat16;;
696e) BST=Fat16;;
6974) BST="BootIt: Fat16";;
6f65) BST="BootIt: Fat16";;
6f74) BST=Fat32;;
6f6e) BST="-";; #MSWIN4.1: Fat 32"
7815) BST=Fat32;;
7cc6) BST="MSWIN4.1: Fat 32";;
# 7cc6) BST=Win_98;;
8a56) BST="Acronis SZ: Fat32";;
8ec0) BST="Windows XP";;
8ed0) BST="DEll Recovery: Fat32";;
b6d1) BST="Windows XP: Fat32";;
e2f7) BST="Fat32, Non Bootable";;
e9d8) BST="Windows Vista/7";;
fa33) BST="Windows XP";;
48b4) BST="Grub 1.96";
7c3c) BST="Grub 2";
aa75 | 5272) BST=Grub;
############# If Lilo look for map file #######
8053) BST=LILO;
then
BSI=$(echo $BSI" "and the \"map\" file was found at this location.);
##
00) sig2=$(hexdump -v -s 128 -n 2 -e '/1 "%x"' $part)
then
else ###### Otherwise, display the boot sector, so we that we might identify it and add it to the list of known boot sectors.
*) BST="Unknown"
esac;
#######
echo " Boot sector type: "$BST>>"$Log"
#######
if [[ "$type" = "ntfs" ]]
then
# Track=$(hexdump -v -s 24 -n 2 -e '"%u"' $part)'' ### Number of sectors per track.
# Heads=$(hexdump -v -s 26 -n 2 -e '"%u"' $part)'' ### Number of heads
# if [[ "$Heads" != 255 || "$Track" != 63 ]]
# then
# BSI=$(echo $BSI" "Geometry: $Heads Heads and $Track sectors per Track.)
# fi;
if [[ "$MFT_Sector" -lt "$size" ]];
then
else
fi;
if [[ "$MFT_Mirr_Sector" -lt "$size" ]];
then
else
fi;
if [[ "$offset" = "$start" && "$MFT_FILE" = "FILE" && "$MFT_Mirr_FILE" = "FILE" && "$Comp_Size" = "0" ]];
then
BSI=$(echo $BSI" "No errors found in the Boot Parameter Block.);
else
if [[ "$offset" != "$start" ]]
then
if [[ "$offset" != "63" && "$offset" != "2048" && "offset" != "0" || "$kind" != "L" ]]
fi;
if [[ "$MFT_FILE" != "FILE" ]];
then
dd if=$part skip=$MFT_Sector count=1 2>>$Trash| hexdump -C >>$Unknown_MBR;
fi;
if [[ "$MFT_Mirr_FILE" != "FILE" ]];
then
BSI=$(echo $BSI" "The info in the boot sector on the starting sector of the MFT Mirror is wrong.);
fi;
if [[ "$Comp_Size" != "0" ]];
then
fi;
fi;
fi;
#######
##### Identifies Fat Bootsectors which are used for booting.
## if [[ "$Bytes8081" = "7cc6" || "$Bytes8081" = "7815" || "$Bytes8081" = "B6D1" || "$Bytes8081" = "7405" || "$Bytes8081" = "6974" || "$Bytes8081" = "bd0" || "$Bytes8081" = "89e" ]] ;
if [[ "$type" = "vfat" ]];
then
#if [[ "$Heads" != 255 || "$Track" != 63 ]] ### Checks for an usual geometry.
#then
# BSI=$(echo $BSI" "Geometry: $Heads Heads and $Track sectors per Track.) ### Report unusal geometry
#fi;
if [[ "$offset" = "$start" && "$Comp_Size" = "0" ]]; ### Check whether Partitons starting sector and the Partition Size of BPB and fdisk agree.
then
BSI=$(echo $BSI" "No errors found in the Boot Parameter Block.); ##If they agreee
else ###### if they don't agree
if [[ "$offset" != "$start" ]] ### if partition starting sector disagree
then
if [[ "$offset" != "63" && "$offset" != "2048" || "$kind" != "L" ]] ### check whether partition is logcial partition and starting sector is a 63.
fi; ### If not, don't display. (This is quite common occurence, and only matters if one tries to boot Windows from a logical partition. So I decided not to display a warning message in this case.
fi;
#### If Partition sizes from BPB and FDISK differ by more than 255 sector, display both sizes.
if [[ "$Comp_Size" != "0" ]];
then
BSI=$(echo $BSI" "According to the info in the boot sector, $name has $BPB_Part_Size sectors.)
if [[ "$BPB_Part_Size" != 0 ]];
fi; ## Don't display warning message in the common case BPB_Part_Size=0.
fi;
fi; #### End of BPB Error if then else
fi; ###### End of Investigation of the BPB of vfat partitions.
#######
##### Display boot sector info
echo -n " Boot sector info: ">>"$Log"
echo $BSI | fold -s -w 55 | sed -e '2~1s/.*/ &/'>>"$Log"
####Exclude Partitions which contain no information, #########
##### or which we (currently) don't know how to accces. #########
if [ "$type" != "swap" ] && [ "$type" != "Extended Partition" ] && [ "$type" != "unknown volume type" ] && [ "$type" != "LVM2_member" ] && [ "$type" != "linux_raid_member" ] && [ "$type" != "crypto_Luks" ] && [ "$system" != "Bios Boot Partition" ] ;
then
### Check whether partition is already mounted
if [ "$CheckMount" != "" ] ;
then
if [ "$CheckMount" = "/" ];
then mountname="";
else
fi;
fi;
if [ "$CheckMount" != "" ] || mount -r -t "$type" $part "$mountname" 2>>$Mount_Error || ( [ "$type" = ntfs ] && ntfs-3g -o ro $part "$mountname" 2>>$Mount_Error ) ; ####### Try to mount partition
then ############ if partition is mounted.
#####Try to identify the Operating System (OS) by looking for files specific to the OS
OS=""
grep -q "W.i.n.d.o.w.s. .V.i.s.t.a" "$mountname"
grep -q "W.i.n.d.o.w.s. .7" "$mountname"
for WinOS in "MS-DOS" "MS-DOS 6.22" "MS-DOS 6.21" "MS-DOS 6.0" "MS-DOS 5.0" "MS-DOS 4.01" "MS-DOS 3.3" "Windows 98" "Windows 95"; do grep -q "$WinOS" "$mountname"
[ -s "$mountname/
[ -s "$mountname/
[ -s "$mountname/
#######
#######
BootFiles=""
if [ "$type" = "vfat" ];
then
else
fi;
for file in $Boot_Files;
do
if [ -f "$mountname"$file ] && [ -s "$mountname"$file ] && FileNotMounted "$mountname"$file "$mountname"
then
if ! [ -h "$mountname"$file ]; ### check whether file is symlink
then ### if not a symlink, display content.
fi;
fi;
done;
################# Search for Wubi partitions #######
if [ -f "$mountname"
then
if [[ "$Wubi" = "" ]];
then
else
fi;
if [ "$Wubi" != "" ];
then
[[ $WubiDev = 0 ]] && losetup -d "$Wubi"; #delete Wubu loop device, if created by BIS
else
echo "Found Wubi on $name. But could not create a loop device"
fi;
fi;
#######
#######
if [ "$type" = "vfat" ];
then
else
fi;
for file in $Boot_Prog;
do
if [ -f "$mountname"$file ] && [ -s "$mountname"$file ] && FileNotMounted "$mountname"$file "$mountname";
then
fi;
done;
################### Search for the directories related to Booting #######
##################, if found display the list of files #######
# for file in $Boot_Dir; #directories in that directory.
# do
# if [ -d "$mountname"$file ];
# then
# BootFiles=$(echo $BootFiles" "$file);
# titlebar_gen "$name" $file ##generates a titlebar above each file/dir listed
# ls -la "$mountname"$file >> "$Log1" ;
#
# fi;
# done;
#######
for file in $Boot_Codes_Dir ##### loop through all directories which might contain boot_code files
do
if [ -d "$mountname"$file ] && FileNotMounted "$mountname"$file "$mountname"; ##### if such directory exist
then
for loader in $( ls "$mountname"$file ); ##### look at the content of that directory
do
then
then
dr=$((dr -127))
BFI=$(echo $BFI " "BootPart in the file $file$loader is trying to chain load sector \#$offset on boot drive \#$dr);
fi;
fi;
done; ## End of loop through the files in a particular Boot_Code_Directory
fi;
done ## End of the loop through the Boot_Code_
######### Determine the end point of all files in the GrubError18_Files list
echo >$Tmp_Log;
counter=0;
cd "$mountname"/;
for file in $(ls $GrubError18_Files 2>>$Trash);
do
if [[ -f $file ]] && [[ -s $file ]] && FileNotMounted "$mountname"
then
if [ "$BlockSize" != "" ];
then
if [ "$LastBlock" != "" ];
then
fi;
fi;
if [ "$BlockSize" != "" ];
then
if [ "$LastBlock" != "" ];
then
fi;
fi;
printf "%6sGB: %-s\n" $EndGB "$file" >>$Tmp_Log;
fi;
done;
cd $Folder;
if [ $counter != 0 ];
then
titlebar_gen "$name" ": Location of files loaded by Grub";
cat $Tmp_Log>>"$Log1";
fi;
echo >$Tmp_Log;
if [[ $BFI != "" ]];
then
echo -n " Boot file info: ">>"$Log"
echo $BFI | fold -s -w 55 | sed -e '2~1s/.*/ &/'>>"$Log"
fi;
echo " Operating System: "$OS | fold -s -w 55 | sed -e '2~1s/.*/ &/'>>"$Log"
echo -n " Boot files/dirs: ">>"$Log"
echo $BootFiles | fold -s -w 55 | sed -e '2~1s/.*/ &/'>>"$Log"
if [ "$CheckMount" = "" ]; ## if partition was mounted by the script
then
umount "$mountname" || umount -l "$mountname";
fi;
else ############### if partition failed to mount
echo " Mounting failed:">>"$Log";
cat $Mount_
fi; ### end of Mounting "if then else"
fi; ### end of Partition Type "if then else"
echo>>"$Log";
if [[ -e "$Log"x ]];
then cat "$Log"x>>"$Log";
rm "$Log"x;
fi;
if [[ -e "$Log1"x ]];
then cat "$Log1"x>>"$Log1";
rm "$Log1"x;
fi;
} ## end Get_Partition_Info function
## "titlebar_gen" generates the $name$file title bar to always be either 79 or 80 chars total in length:
titlebar_gen () {
name_
equal_
for length in $(seq $equal_
equal_
done;
echo "$equal_signs_line $name_file $equal_signs_line" >> "$Log1";
}
echo " Boot Info Script $VERSION dated $DATE ">>"Log";
echo>>"Log";
echo '======
echo>>"$Log";
##### Search for hard drives which don't exist,have a corrupted partition table
##### or don't have a parition table(whole drive is a file system)
##### Information on all hard drives which a valid partition table are stored in the
##### Hard drives arrays: HD?????
FSD=0; #id for Filesystem Drives
for drive in $All_Hard_Drives;
do
size=$(fdisks $drive);
PrintBlkid $drive;
if [ 0 -lt $size 2>>$Trash ];
then
if [ "$(blkid $drive)" = "" ] || [ "$(blkid | grep $drive:)" = "" ]; #Check whether drive is a filesystem
then #if drive is not a filesytem
# (not used) Hard_Drives=
###Look at the first 4 bytes of the second sector to identify type of partition table;
case $(hexdump -v -s 512 -n 4 -e '"%_u"' $drive) in
"EMBR") HDPT[$HI]
"EFI ") HDPT[$HI]="EFI";;
*) HDPT[$HI]="MSDos";;
esac;
else #if drive is filesystem
if [ $( expr match "$(BlkidTag "$drive" TYPE)" '.*raid') -eq 0 ] || [ "$(BlkidTag "$drive" UUID)" != "" ];
then
fi;
fi;
else
echo -n "$(basename $drive) " >>$FakeHardDrives;
fi;
done;
############ Identify the MBR of each hard drive.
echo "Identifying MBRs..." ;
for hi in ${!HDName[@]};
do
drive=
Message=$(echo is installed in the MBR of $drive)
case $(hexdump -v -n 2 -e '/1 "%x"' $drive) in ####Look at the first two bytes of the hard drive to identify the boot code installed in the MBR
#######
eb48) offset=$(hexdump -v -s 68 -n 4 -e '"%u"' $drive);### 0x44 contains the offset of the next stage
if [ "$offset" != 1 ]; ###if Grub is installed without stage1.5 files
then
else ### if grub is installed with stage1.5 files
pa=$((pa+1));
if [ $dr = 128 ];
fi;
fi;
#######
eb4c ) BL="Grub 1.96";
if [ "$offset" != 1 ]; ###if Grub2 is installed without Core.
then
else ### if Grub2 is installed with Core
pa=$((pa+1));
if [ $dr = 128 ];
fi;
fi;;
################### If Grub 2 in the MBR####
eb63 ) BL="Grub 2"
if [ "$offset" != 1 ]; ###if Grub2 is installed without embeded Core.
then
else ### if Grub2 is installed with Core
pa=$((pa+1));
if [ $pa = 255 ];
fi;;
#######
ebe) BL=ThinkPad;;
31c0) BL="Acer 3";;
33c0) BL=Windows;;
33ff) BL='HP/Gateway';;
b800) BL=PloP;;
ea1e) BL="Truecrypt Boot Loader";;
eb04) BL=Solaris;;
eb31) BL=Paragon;;
eb5e) case $(hexdump -v -n 3 -e '/1 "%x"' $drive) in ####Look at the first three bytes of the hard drive to identify the boot code installed in the MBR
eb5e00) BL=fbinst;;
eb5e80) BL=Grub4Dos;;
esac;;
fa31) case $(hexdump -v -n 3 -e '/1 "%x"' $drive) in ####Look at the first tree bytes of the hard drive to identify the boot code installed in the MBR
fa31c0) BL=Syslinux;;
fa31c9) BL="Master Boot LoaDeR";;
esac;;
fa33) BL="No boot loader";;
fab8) BL="No boot loader";;
fabe) BL="No boot loader?";;
faeb) BL=Lilo;;
fc31) BL=Testdisk;;
fc33) BL=GAG;;
fceb) BL="BootIt NG";;
00) BL="No boot loader";;
*) BL="No known boot loader"
echo "Unknown MBR on $drive" >> $Unknown_MBR;
echo >> $Unknown_MBR;
echo >> $Unknown_MBR;;
esac;
##Output message at beginning of summary that gives MBR info for each drive:
echo -n " => ">>"$Log"
echo "$BL $Message" | fold -s -w 75 | sed -e '2~1s/.*/ &/' >>"$Log"
done;
echo>>"$Log";
#######
############# Store and Display all the partitions tables.
for HI in ${!HDName[@]};
do
drive=
echo "Computing Partition Table of $drive...";
FP=$((PI+1)); #used if non-MS_DOS partition table is not in use.
FirstPartit
PTType=
HDPT[
echo "Drive: $(basename $drive ) ___________________ _______
fdisk -lu $drive 2>>$Trash |sed '/omitting/ d'|sed '6,$ d' >>$PartitionTable;
echo >>$PartitionTable;
printf "$PTFormat" "Partition" "Boot" "Start" "End" "Size" "Id" "System"
echo >>$PartitionTable;
ReadPT $HI 0 4 $PartitionTable "$PTFormat" "" 0;
echo >>$PartitionTable;
LastPartiti
LP=$PI;
CheckPT ${FirstPartitio
echo >>$PartitionTable;
HDPT[
case $PTType in
BootIt) echo -n BootIt NG Partition Table detected>
[[ "${HDMBR[$HI]}" = "BootIt NG" ]] && echo . >>$PartitionTable || echo , but does not seem to be used. >>$PartitionTable;
echo >>$PartitionTable;
if [ "${HDMBR[$HI]}" = "BootIt NG" ];
then
else
fi;;
EFI) FirstPartition[
echo -n GUID Partition Table detected>
[[ "$EFIee" = "ee" ]] && echo . >>$PartitionTable || echo , but does not seem to be used. >>$PartitionTable ;
echo >>$PartitionTable;
echo >>$PartitionTable;
if [ "$EFIee" = "ee" ];
then
else
fi;;
esac;
done;
for hi in ${!HDName[@]}; ############Loop through all Hard Drives
do
drive=
for (( pi = FirstPartition[
do
part_
start=
size=
end=
kind=
system=
if [[ "${DeviceArray[
then
#### --sizelimit $((size*512)) --sizelimit seems to be a recently added option for losetup. Failed on Hardy
else
fi;
Get_
[[ "${DeviceArray[
done; ### end of partition loop
done; ### end of hard drive loop
################ Deactivate dmraid's activated by the script#############
if [ "$InActiveDMRaid" != "" ];
then
dmraid -an $InActiveDMRaid
fi;
#######
#######
if type lvscan >>$Trash 2>>$Trash && type lvdisplay >>$Trash 2>>$Trash && type lvchange >>$Trash 2>>$Trash;
then ### if LVM2 is installed
LVM_
for LVM in $LVM_Partitions;
do
LVM_
LVM_
lvchange -ay $LVM;
name=
mountname
kind="LVM";
start=0;
end=
system="";
pi="";
Get_
[[ "$LVM_Status" = "NOT" ]] && lvchange -an "$LVM";
done;
fi;
#######
#######
if type mdadm >>$Trash 2>>$Trash;
then
MD_
mdadm --assemble --scan #assemble all arrays
MD_
for MD in $MD_Array;
do
for MDA in $MD_Active_Array; ## check whether MD is active
do
if [[ "$MDA" = "$MD" ]]
then
fi;
done;
name=${MD:5};
mountname
kind=
start=0;
end=$MD_Size;
system="";
pi="";
Get_
[[ "$MD_Active" = 0 ]] && mdadm --stop $MD
done;
fi;
#######
for FD in ${FilesystemDri
do
FD_
FD_
name=${FD:5};
mountname
kind="FD";
start=0;
end=$FD_Size;
system="";
pi="";
Get_
done;
#######
echo '======
echo>>"$Log";
[ -e $PartitionTable ] && cat $PartitionTable
echo "blkid -c /dev/null: _______
echo>>"$Log";
printf "$BlkidFormat" Device UUID TYPE LABEL>>"$Log";
echo>>"$Log"
for dev in $(blkid -o device);do PrintBlkid $dev;done;
sort -u $BLKID>>"$Log";
echo>>"$Log";
if [ $(ls -R /dev/mapper 2>>$Trash | wc -l) -gt 2 ]
then
echo '======
ls -R /dev/mapper>>$Log
echo>>"$Log";
fi;
echo '======
MountFormat='%-16s %-24s %-10s %s\n';
Fis=':x:x:x:x:'
echo>>"$Log";
printf "$MountFormat" "Device" "Mount_Point" "Type" "Options" >>"$Log";
echo>>"$Log";
mount | grep ' / '| grep -v '^/'| sed 's/ on /'$Fis'/' |sed 's/ type /'$Fis'/'|sed 's/ (/'$Fis'(/'|awk -F $Fis '{printf "'"$MountFormat"'", $1, $2, $3, $4 }'>>"$Log";
mount | grep '^/dev'|sed 's/ on /'$Fis'/' |sed 's/ type /'$Fis'/' |sed 's/ (/'$Fis'(/'|awk -F $Fis '{printf "'"$MountFormat"'", $1, $2, $3, $4 }'>>"$Log";
echo>>"$Log";
################# Write the content of Log1 to the log file
[ -e "$Log1" ] && cat "$Log1">>"$Log";
if [ -e $Unknown_MBR ];
then
echo "======
echo>>"$Log";
cat $Unknown_
echo>>"$Log";
fi;
if [ -e $FakeHardDrives ];
then
echo "=======Devices which don't seem to have a corresponding hard drive==
echo>>"$Log";
cat $FakeHardDrives
echo>>"$Log";
fi;
#######
if [ -s $Error_Log ];
then
echo "======
echo>>"$Log";
cat $Error_Log>>"$Log";
fi;
##### Copy the Log file to RESULTS file and make the user the owner of Result file
cp "$Log" "$LogFile"
chown $(basename ~) "$LogFile";
####### Reset the Standard Output to the Terminal
#exec 1>&-;
#exec 1>&6;
#exec 6>&-;
echo Finished. The results are in the file $(basename "$LogFile") located in "$Dir";
exit
Revision history for this message
|
#12 |
"2) => Grub 2 is installed in the MBR of /dev/sda and looks for b2d."
This was the way the boot info script initially reported partitions with Grub 1.99 and Natty. It doesn't mean there is a problem with the MBR. The latest version of the boot info script (0.56 and later I believe) correctly identifies the partition.
Revision history for this message
|
#13 |
Thanks for your help....but I am completelylost.
instructions to fixing the problem that I can follow?
Thanks,
John
_______
From: drs305 <email address hidden>
To: <email address hidden>
Sent: Mon, May 30, 2011 4:35:50 PM
Subject: Re: [Question #156397]: Cannot boot from New Ubuntu 11 install
Question #156397 on grub2 in Ubuntu changed:
https:/
drs305 posted a new comment:
"2) => Grub 2 is installed in the MBR of /dev/sda and looks for b2d."
This was the way the boot info script initially reported partitions with
Grub 1.99 and Natty. It doesn't mean there is a problem with the MBR.
The latest version of the boot info script (0.56 and later I believe)
correctly identifies the partition.
--
You received this question notification because you are a direct
subscriber of the question.
Revision history for this message
|
#14 |
Can you help with this problem?
Provide an answer of your own, or ask Tim Sneller for more information if necessary.