LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Booting windows 7 after hard drive removal (Boot Info Script results included) (https://www.linuxquestions.org/questions/linux-hardware-18/booting-windows-7-after-hard-drive-removal-boot-info-script-results-included-921545/)

briced 01-01-2012 08:12 PM

Booting windows 7 after hard drive removal (Boot Info Script results included)
 
1 Attachment(s)
I am running a computer Windows7/Ubuntu 11.10 dual bootable. Both OS installations are on the Secondary slave drive, The primary master was just for storage. I had to remove the primary master drive and afterwards I couldnt boot either OS. So i re installed Ubuntu 11.10 to the partition previously containing the Ubuntu install just to be able to start the computer. I am wondering how, if possible, to be able to boot the windows7. Ive looked into adding windows to the grub list. can someone please help? i do not want to reinstall windows and loose all important documents and files

Boot Info Script 0.60 from 17 May 2011


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

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for on this drive.

sda1: __________________________________________________________________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /bootmgr /Windows/System32/winload.exe

sda2: __________________________________________________________________________

File system: Extended Partition
Boot sector type: Unknown
Boot sector info:

sda5: __________________________________________________________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.10
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda6: __________________________________________________________________________

File system: swap
Boot sector type: -
Boot sector info:

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 2,048 214,830,913 214,828,866 7 NTFS / exFAT / HPFS
/dev/sda2 214,831,102 312,580,095 97,748,994 5 Extended
/dev/sda5 214,831,104 307,881,983 93,050,880 83 Linux
/dev/sda6 307,884,032 312,580,095 4,696,064 82 Linux swap / Solaris


"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/sda1 A6FC890FFC88DAC7 ntfs
/dev/sda5 04b63c7a-f5fd-4bae-a554-97d651d6ae18 ext3
/dev/sda6 3c1c183e-d199-4ac6-b2e4-78509f8dcd39 swap

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda1 /media/A6FC890FFC88DAC7 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda5 / ext3 (rw,errors=remount-ro,commit=0)


=========================== sda5/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
set locale_dir=($root)/boot/grub/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=04b63c7a-f5fd-4bae-a554-97d651d6ae18 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, with Linux 3.0.0-12-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
echo 'Loading Linux 3.0.0-12-generic ...'
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=04b63c7a-f5fd-4bae-a554-97d651d6ae18 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 04b63c7a-f5fd-4bae-a554-97d651d6ae18
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda5 during installation
UUID=04b63c7a-f5fd-4bae-a554-97d651d6ae18 / ext3 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=3c1c183e-d199-4ac6-b2e4-78509f8dcd39 none swap sw 0 0
--------------------------------------------------------------------------------

=================== sda5: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

= boot/grub/core.img 1
= boot/grub/grub.cfg 1
= boot/initrd.img-3.0.0-12-generic 6
= boot/vmlinuz-3.0.0-12-generic 3
= initrd.img 6
= vmlinuz 3

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sda2

00000000 e4 25 a0 97 7c cf 94 5c e4 25 a0 97 7c cf 94 5c |.%..|..\.%..|..\|
*
00000030 e4 25 a0 97 7c cf 94 5c e4 25 a0 97 1f 26 bd bf |.%..|..\.%...&..|
00000040 d2 66 9d 15 62 4b 32 ea da 0a 4d 59 ab 46 5d 13 |.f..bK2...MY.F].|
00000050 3e 2b 17 26 d0 af 0d 82 e7 87 1c 13 6f bb 49 28 |>+.&........o.I(|
00000060 dc 82 2e 22 8b 6b e4 57 0e 97 18 84 ed a8 5f 01 |...".k.W......_.|
00000070 57 d1 6f be 47 ff 83 20 ad 3c 4e 47 52 95 15 6c |W.o.G.. .<NGR..l|
00000080 a7 27 d9 27 f8 7c e1 4d dd dc 33 c0 cf 3e 7a a3 |.'.'.|.M..3..>z.|
00000090 a6 29 40 10 da 8c 31 ad 59 ac ba 2f 77 f6 0e d8 |.)@...1.Y../w...|
000000a0 be bf 9a 60 78 09 da 65 1c 6a 4c c4 34 33 2b 21 |...`x..e.jL.43+!|
000000b0 31 2c ce 83 2c f4 97 09 5d 1d 21 2b c1 e2 59 27 |1,..,...].!+..Y'|
000000c0 ef db bd a4 73 1e e3 e9 44 2f 85 fe 4a 9d c2 29 |....s...D/..J..)|
000000d0 8c e4 43 c1 da 12 a1 04 51 6f d7 80 58 dd ae 3f |..C.....Qo..X..?|
000000e0 cc 3d 27 f0 39 8a 89 5b af c3 fa 5b 97 a2 05 18 |.='.9..[...[....|
000000f0 73 89 6c cf 41 96 0d dc 47 ff 83 20 00 98 fc 99 |s.l.A...G.. ....|
00000100 be bc a9 77 7e ae 08 c6 d3 82 31 d0 43 c1 79 84 |...w~.....1.C.y.|
00000110 a1 0e 4c f7 59 51 f3 bc 49 29 5b 39 7c cf 94 5c |..L.YQ..I)[9|..\|
00000120 e4 25 a0 97 7c cf 94 5c e4 25 a0 97 7c cf 94 5c |.%..|..\.%..|..\|
*
00000170 e4 25 a0 97 7c cf 94 5c e4 25 a0 97 47 ff 83 20 |.%..|..\.%..G.. |
00000180 4d b3 39 01 1a 4c fd 7e 7c cf 94 5c e4 25 a0 97 |M.9..L.~|..\.%..|
00000190 7c cf 94 5c e4 25 a0 97 7c cf 94 5c e4 25 a0 97 ||..\.%..|..\.%..|
*
000001b0 7c cf 94 5c e4 25 a0 97 7c cf 94 5c e4 25 00 fe ||..\.%..|..\.%..|
000001c0 ff ff 83 fe ff ff 02 00 00 00 00 d8 8b 05 00 fe |................|
000001d0 ff ff 05 fe ff ff 02 d8 8b 05 00 b0 47 00 00 00 |............G...|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200


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

unlzma: Decoder error
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in
awk: cmd. line:36: Math support is not compiled in

blue_print 01-01-2012 08:29 PM

Boot Ubuntu in normal mode and try

Code:

sudo update-grub

briced 01-01-2012 08:37 PM

tried it, Output:

drew@drew-OptiPlex-GX270:~$ sudo update-grub
[sudo] password for drew:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-12-generic
Found initrd image: /boot/initrd.img-3.0.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
done
drew@drew-OptiPlex-GX270:~$

briced 01-01-2012 08:39 PM

here is my fdisk -l output:

drew@drew-OptiPlex-GX270:~$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005b3e5

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 214830913 107414433 7 HPFS/NTFS/exFAT
/dev/sda2 214831102 312580095 48874497 5 Extended
/dev/sda5 214831104 307881983 46525440 83 Linux
/dev/sda6 307884032 312580095 2348032 82 Linux swap / Solaris



So i am sure that the windows 7 OS is still there

EDDY1 01-01-2012 11:50 PM

Start sector 2048?
1st partition missing?

grahamatlq 01-03-2012 05:13 AM

Hes right
 
EDDY1 is right.

I believe Win7 puts the bootloader onto a separate partition so you need to recover it.
"parted" is your friend.

syg00 01-03-2012 06:11 AM

(very) close.
There was a partition with the Win7 loader code on the other disk (not in the first 2k of this disk).

purevw 01-03-2012 07:44 AM

Windows is very bad about wanting it's installation on the first disk in the system. I would assume that if you forced it to install on the second disk, it installed it's bootloader on the first disk, which you removed. In XP, the most straight forward way to fix Windows was to use your Windows DVD to boot and go into "recovery Console" and run "fixboot". Win 7 has an automated system if If remember correctly. You may be able to use your Windows disk to repair the Windows bootloader, but that will most likely mess up the booting of your Linux installation and you would then have to repair that.

Arelatensis 01-03-2012 02:16 PM

Quote:

Originally Posted by purevw (Post 4564602)
Windows is very bad about wanting it's installation on the first disk in the system. I would assume that if you forced it to install on the second disk, it installed it's bootloader on the first disk, which you removed.

The primary bootloader (not bootmgr and other peripheral windows boot files) set always in first sectors of a first primary (master) drive. When you install Grub in the same location (dev/sda), it read this date, and incorporate into itself so you get a boot menu entry in Grub and file ntldr renamed into grldr. But the first partition of the first prymary drive is removed, so any bootloader id killed.

Quote:

Originally Posted by purevw (Post 4564602)
In XP, the most straight forward way to fix Windows was to use your Windows DVD to boot and go into "recovery Console" and run "fixboot". Win 7 has an automated system if If remember correctly. You may be able to use your Windows disk to repair the Windows bootloader, but that will most likely mess up the booting of your Linux installation and you would then have to repair that.

True, it is vary easy process in Win Vista/7. But it often fails. May be need re installation of Win, without formatting partition, wit previous installation. Your old windows installation will be moved to "windows. old" folder not deleted.
You don't be worry about you data, it remains intact, if you will not remove or format partition with Windows installation. You can access to it under from Ubuntu, and copy to any safe location.

bg3075 01-03-2012 06:36 PM

This I found on "Tweak Home PC" site:

Quote:

Restore a Windows 7 or Vista Boot Sector

Your computer will boot to Windows 7 or Vista if you execute the following procedure.

Bootup from any Windows 7/Vista installation DVD or even from NeoSmart's free Windows 7 System Recovery Disk or Vista Recovery Disk.
Press a key when you see Press any key to boot from a CD or DVD.
Select your Language and then Time....
Select Repair your computer (bottom left of the Install now screen).
An automatic check of your system will run but will not identify GRUB control!
In System Recovery Options, highlight Windows 7, and click Next.
Click Command Prompt in System Recovery Options.
Type in, and press ENTER after each line (not case sensitive)
BOOTREC /FIXBOOT
BOOTREC /FIXMBR
(the Win7/Vista's boot sector/loader will be reinstalled).
EXIT
Now click Startup Repair in System Recovery Options.
Restart computer.
Windows should boot as originally.

purevw 01-04-2012 12:33 AM

Yes, that is the procedure I spoke of, but Arelatensis is correct when he says it does not generally work well. Hopefully it will be able to install the primary bootloader on the correct disk and your Windows installation will be back to normal. Just remember, when Windows repairs it's bootloader and the MBR of that disk, there will no longer be a link pointing the system to the grub bootloader. It will point to the Windows bootloader. So you will then have to fix your Linux installation.

colinetsegers 01-04-2012 04:34 AM

Hi. No Idea if what I'm going to write will help to understand the problem, but here it is.

First, I think that installing a system on a secondary disk was a mistake, even if it worked; then, after you removed the main drive you might have tried to set the jumper of that secondary disk on "master", and still, this is of no use if the bootloader was installed on the original primary drive.

Concerning Windows, I discovered that in any case it is better to first install Windows, and then only Linux, because done otherwise Windows will erase the Linux bootloader.

Because this happened to me some time ago, I decided the best way to deal with the problem was to just reinstall everything in the correct order, on a correctly configured hard disk. I was by the way able to save first my personnal files with the help of a Linux livecd.

Best Wishes to all,
Paul

rrdonovan 01-04-2012 09:32 AM

NO Master?
 
OK, so you have a Master and a Slave. Both operating systems are installed on the slave.
1. Understand that the Master is your boot drive.
2. It contains the Master Boot Record.
3. It is the Active Boot Device that is required to start GRUB.
4. With the Master removed, you have none of the above.
You might:
1. Make the Slave a Master by changing the connection port in a sata drive.
2. Change the Jumper from Slave to Master on an IDE drive.
3. Check your BIOS and make sure it is set to Master and Active if possible.
4. Re-Install GRUB on Slave and set up your Windows and Linux partitions as they do exist on the Slave.
My Recomendation:
Put back the Master and backup all your Documents, etc. to a USB or external HD.
Remove the Master and replace with the Slave.
Reinstall Linux. After all is running fine, Download Virtual box form Oracle.
Run Virtual box and once you get the installation screen, you can reinstall windows and run Windows as a virtual OS inside Linux.

Master Rod

LQParsons 01-04-2012 09:35 AM

A furtherance
 
Hi.
This is on the same vein but in anticipation of an endeavor.

In my dual boot systems, I agree with the previous entry: I've found it best to install Windows first, then make it a dual boot machine. I've found it always dicey to mess with the primary/secondary disks when in the mix is a brain-dead operating system such as any Microsoft offerings.

I have Windows/XP on its own machine, my second machine is dual-boot.
  • Windows -- don't recall when I last used it
  • SuSE
  • CentOS -- my current Linux of choice.
My customer base is mostly Windows/XP, then Macintosh, then Linux, then alternative Windows:vista,7.
Both machines are old -- one's approaching a decade, the other I'm not sure doesn't have vacuum tubes.

I've decided when Windows/8 is out for a couple of months this Spring/Summer (and I have the cash-flow), that I'm getting a 64-bit machine with way too much memory and disk <.grin>
I'm getting it with Win/8 installed, when I get it home, I'll make it dual-boot CentOS. On the CentOS, I'll install VMWare so I can have differing Linuxes, either for supporting my customer base or for my own amusement and education. I can test my java development on multiple operating systems.

One of my partitions will be Win/8, so I can always have it live and I don't have to reboot to gain access.
Even though all my Win/8 work and stuff will be on my 'VM-Win8', I'll occasionally boot native and keep the 'original' up-to-date so that if I have problems, I can boot it 'native' and eliminate any accusations that the problem is related instead to CentOS or VMware, etc.

Does my plan make sense ?
Any caveats ?

-doug

rrdonovan 01-04-2012 09:55 AM

Very Good Doug!

You seem to have things covered. VMware is pretty good, though I much prefer Virtual Box for its no nonsense simplicity. Once you have tried it, Ahh, well, You might agree. With virtualization, it is always best to get as much memory as possible. I saw a laptop with an AMD 4 core processor and 4 gig of ram at Walmart for about $548. All I can say is "Ham Sandwich", no bologna here. Now if only I could add raid to my laptop????

Master Rod

colorpurple21859 01-04-2012 09:56 AM

My 2 cents worth, windows 7 uses a boot partition, which may have been on the hard drive that was removed, may have even been the partition you was using for storage. I would suggest trying to access the removed hard drive and see if the window bootloader files are on it and if so transfer them to the other hardrive

EDDY1 01-04-2012 12:50 PM

Quote:

Start sector 2048
What happened to the sectors before 2048 on hdd?

purevw 01-05-2012 07:31 AM

Quote:

Originally Posted by LQParsons (Post 4565853)
Hi.

I've decided when Windows/8 is out for a couple of months this Spring/Summer (and I have the cash-flow), that I'm getting a 64-bit machine with way too much memory and disk <.grin>
I'm getting it with Win/8 installed, when I get it home, I'll make it dual-boot CentOS. On the CentOS, I'll install VMWare so I can have differing Linuxes, either for supporting my customer base or for my own amusement and education. I can test my java development on multiple operating systems.

Does my plan make sense ?
Any caveats ?

-doug

All I would say about your new dream machine is that you should research very carefully about the computer you buy and verify that it has an "unlock" in the BIOS for the new Windows UEFI "secure boot" that Microsoft is cramming down the hardware manufacturers throats. It will prevent addition of another OS. Here's an article: http://www.zdnet.com/blog/hardware/y...s-rivers;item1
Microsoft won't certify their hardware if it doesn't include the lock. OEMs have the option of adding a manual "unlock" in BIOS, but it seems that some vendors are not using the option.
My apologies to everyone for getting "off topic".


All times are GMT -5. The time now is 09:32 PM.