PDA

View Full Version : [SOLVED] Cannot boot to win7 after ubuntu install



MadParrot
February 26th, 2010, 12:15 PM
Hi All,

After an unfortunate incident last night where I had to concatenate a bunch of text files on my windows 7 (64 bit) machine by hand, sans 'cat', I resolved to get it dual booting with ubuntu.

So I have installed the latest version (9.10?) of ubuntu (32 bit). I see the boot menu, and ubuntu boots perfectly (and is very nice after win7). 'Data' drive is accessible, but requires root password to mount/view.

If I select windows, I get a 'error: no such device: <UUID number>'.

I've got two 500G hard drives, one for data 'data', the other in two partitions for windows 'C_DRIVE' and linux.

I've run the info script, on boot I get this:


Boot Info Script 0.55 dated February 15th, 2010

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

=> No boot loader is installed in the MBR of /dev/sda

sda1: __________________________________________________ _______________________

File system:
Boot sector type: -
Boot sector info:
Mounting failed:
mount: unknown filesystem type ''

#### NB ^^^^^
# I used to get reasonable looking stuff in here when C_DRIVE was appearing on boot
# ####


sda2: __________________________________________________ _______________________

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

sda3: __________________________________________________ _______________________

File system: Bios Boot Partition
Boot sector type: -
Boot sector info:

sda4: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

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

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

Partition Boot Start End Size Id System

/dev/sda1 1 976,773,167 976,773,167 ee GPT


GUID Partition Table detected.

Partition Start End Size System
/dev/sda1 34 262,177 262,144 Microsoft Windows
/dev/sda2 264,192 765,958,796 765,694,605 Linux or Data
/dev/sda3 765,958,797 765,960,750 1,954 Bios Boot Partition
/dev/sda4 765,960,751 968,113,094 202,152,344 Linux or Data
/dev/sda5 968,113,095 976,773,134 8,660,040 Linux Swap

blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda2 D8CEA1F7CEA1CE56 ntfs data
/dev/sda4 35906fb1-7ea9-4a63-a017-a68b20486921 ext4
/dev/sda5 4e570509-b276-42b0-9178-6a74522baca0 swap

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sda4 / ext4 (rw,errors=remount-ro)


=========================== sda4/boot/grub/grub.cfg: ===========================

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

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-19-generic-pae" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
linux /boot/vmlinuz-2.6.31-19-generic-pae root=UUID=35906fb1-7ea9-4a63-a017-a68b20486921 ro quiet splash
initrd /boot/initrd.img-2.6.31-19-generic-pae
}
menuentry "Ubuntu, Linux 2.6.31-19-generic-pae (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
linux /boot/vmlinuz-2.6.31-19-generic-pae root=UUID=35906fb1-7ea9-4a63-a017-a68b20486921 ro single
initrd /boot/initrd.img-2.6.31-19-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 2692124892121d3d
chainloader +1
}
### 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 ###

=============================== sda4/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sdb4 :
UUID=35906fb1-7ea9-4a63-a017-a68b20486921 / ext4 errors=remount-ro 0 1
# Entry for /dev/sdb5 :
UUID=4e570509-b276-42b0-9178-6a74522baca0 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda1 /media/DRIVE_C ntfs-3g defaults,locale=en_AU.UTF-8 0 0

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


407.3GB: boot/grub/core.img
392.5GB: boot/grub/grub.cfg
392.7GB: boot/initrd.img-2.6.31-19-generic-pae
392.7GB: boot/vmlinuz-2.6.31-19-generic-pae
392.7GB: initrd.img
392.7GB: vmlinuz
And after I've mounted 'data' drive, the diff shows one extra line, seems fair.

/dev/sda2 /media/data fuseblk (rw,nosuid,nodev,allow_other,default_permissions,b lksize=4096)

If I attempt to run 'sudo mount -a' I get the following (should I be worrying?):

sarah@sarah-desktop:~$ sudo mount -a
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?On fresh install I was able to see 'C_DRIVE', but I'm steadily progressing backwards at the moment.

* I installed 'NTFS' configuration tool - don't think this changed anything
* I have tried -e at the grub menu (v 1.72) I think, and removed the search command in case it was this issue http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:search (it wasn't, got a no such partition error)
* I stupidly, on the theory it was all temporary, decided to enter sda1 in one of the other parameters of the command in the boot menu, (it had the right UUID), can't remember exactly what, but I am hoping there was no lasting damage?? Only noticed the mount -a problem after that.

And, apologies for my first post being 'help me!' I've seen alot of similar issues get solved, but it hasn't worked for me yet. And I am steadily making things worse through cluenessness. Hoping its obvious to someone...

Massive thanks for any help or suggestions.

darkod
February 26th, 2010, 03:02 PM
Why does the script show only one 500GB disk, /dev/sda? There is no other disk shown at all.
Double check the connections/cables and make sure it's disabled in BIOS, for a start.

Another problem is that it doesn't recognize the first partition, sda1 properly, as ntfs and as having windows.

But lets see why the other disk is completely missing first.

MadParrot
February 27th, 2010, 02:14 AM
Thanks for that Darko. Not sure what happened, but when I booted this morning all my drives were accessable (and windows DRIVE_C, on same physical disk as ubuntu was mounted). Guess I'm not complaining :) Drives are now accessible, still no windows boot.

The updated output:

Boot Info Script 0.55 dated February 15th, 2010

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

=> Grub 2 is installed in the MBR of /dev/sda and looks for
(UUID=35906fb1-7ea9-4a63-a017-a68b20486921)/boot/grub.
=> No boot loader is installed in the MBR of /dev/sdb

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/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sdb1: __________________________________________________ _______________________

File system:
Boot sector type: -
Boot sector info:
Mounting failed:
mount: unknown filesystem type ''

sdb2: __________________________________________________ _______________________

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

sdb3: __________________________________________________ _______________________

File system: Bios Boot Partition
Boot sector type: -
Boot sector info:

sdb4: __________________________________________________ _______________________

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

sdb5: __________________________________________________ _______________________

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

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6d541e08

Partition Boot Start End Size Id System

/dev/sda1 * 2,048 976,771,071 976,769,024 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

Partition Boot Start End Size Id System

/dev/sdb1 1 976,773,167 976,773,167 ee GPT


GUID Partition Table detected.

Partition Start End Size System
/dev/sdb1 34 262,177 262,144 Microsoft Windows
/dev/sdb2 264,192 765,958,796 765,694,605 Linux or Data
/dev/sdb3 765,958,797 765,960,750 1,954 Bios Boot Partition
/dev/sdb4 765,960,751 968,113,094 202,152,344 Linux or Data
/dev/sdb5 968,113,095 976,773,134 8,660,040 Linux Swap

blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 2692124892121D3D ntfs DRIVE_C
/dev/sdb2 D8CEA1F7CEA1CE56 ntfs data
/dev/sdb4 35906fb1-7ea9-4a63-a017-a68b20486921 ext4
/dev/sdb5 4e570509-b276-42b0-9178-6a74522baca0 swap

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sdb4 / ext4 (rw,errors=remount-ro)
/dev/sda1 /media/DRIVE_C fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb2 /media/data fuseblk (rw,nosuid,nodev,allow_other,default_permissions,b lksize=4096)


=========================== sdb4/boot/grub/grub.cfg: ===========================

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

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-19-generic-pae" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
linux /boot/vmlinuz-2.6.31-19-generic-pae root=UUID=35906fb1-7ea9-4a63-a017-a68b20486921 ro quiet splash
initrd /boot/initrd.img-2.6.31-19-generic-pae
}
menuentry "Ubuntu, Linux 2.6.31-19-generic-pae (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set 35906fb1-7ea9-4a63-a017-a68b20486921
linux /boot/vmlinuz-2.6.31-19-generic-pae root=UUID=35906fb1-7ea9-4a63-a017-a68b20486921 ro single
initrd /boot/initrd.img-2.6.31-19-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 2692124892121d3d
chainloader +1
}
### 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 ###

=============================== sdb4/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sda4 :
UUID=35906fb1-7ea9-4a63-a017-a68b20486921 / ext4 errors=remount-ro 0 1
# Entry for /dev/sda5 :
UUID=4e570509-b276-42b0-9178-6a74522baca0 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda1 /media/DRIVE_C ntfs-3g defaults,locale=en_AU.UTF-8 0 0

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


407.3GB: boot/grub/core.img
392.5GB: boot/grub/grub.cfg
392.7GB: boot/initrd.img-2.6.31-19-generic-pae
392.7GB: boot/vmlinuz-2.6.31-19-generic-pae
392.7GB: initrd.img
392.7GB: vmlinuz

So, I guess this bit might have something to do with it? How can all my drives be on 'sdb' (my understanding is sda and sdb represent my physical drives?). ANd in the script output, how can windows 7 be on sdb2?



GUID Partition Table detected.

Partition Start End Size System
/dev/sdb1 34 262,177 262,144 Microsoft Windows
/dev/sdb2 264,192 765,958,796 765,694,605 Linux or Data
/dev/sdb3 765,958,797 765,960,750 1,954 Bios Boot Partition
/dev/sdb4 765,960,751 968,113,094 202,152,344 Linux or Data
/dev/sdb5 968,113,095 976,773,134 8,660,040 Linux Swap
I would think that all except the largest (my 'data' disk) should be sda? I used the defaults on the installer, just told it to use a partition a bit less than half of the windows+linux drive.


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 2692124892121D3D ntfs DRIVE_C
/dev/sdb2 D8CEA1F7CEA1CE56 ntfs data
/dev/sdb4 35906fb1-7ea9-4a63-a017-a68b20486921 ext4
/dev/sdb5 4e570509-b276-42b0-9178-6a74522baca0 swap
Trying to understand this a bit - Is this something to do with my partition label's being mucked up, and where? And how may I fix it?

Thanks again for the help.

wilee-nilee
February 27th, 2010, 03:58 AM
Let me bump you so all can see. ;)

presence1960
February 27th, 2010, 05:16 AM
This is what I would do. I would set sdb as the first disk to boot in the hard disk boot order in BIOS & install GRUB 2 to MBR of that disk. I would then repair the MBR of sda so that it is a windows MBR.

Boot off the ubuntu 9.10 Live CD. Choose "try ubuntu without any changes". When the desktop loads open a terminal and run
sudo mount /dev/sdb4 /mntThis will mount your ubuntu / partition. Next in terminal run
sudo grub-install --root-directory=/mnt/ /dev/sdbThis will put GRUB on MBR of sdb.

Next repair your sda MBR to a windows MBR. From terminal run
sudo apt-get install liloThis will install lilo to the Live CD session. Now run
sudo lilo -M /dev/sda mbrto repair the sda MBR

Reboot without the CD and go into BIOS and set sdb disk as first hard disk in the hard disk boot order. Save changes to CMOS and continue booting into Ubuntu. Open a terminal and run
sudo dpkg-reconfigure grub-pcAt the last window select sdb. This will insure all grub-pc (GRUB2) updates go to sdb rather than sda. Now run in terminal
sudo update-grub.
You should now be good to go.

Edit:I would hold off on that! I just saw you have a GUID partition table. If I remember correctly GRUB has a problem with that and an MSDOS partition table. Wait until someone with the knowledge comes along like meierfra.

meierfra.
February 27th, 2010, 06:46 AM
the other in two partitions for windows 'C_DRIVE' and linux.

You actually have Ubuntu installed on a different hard drive than Window 7.

One possibly solution would be to reinstall Ubuntu to the Windows 7 drive. (If that's what you would like do, make sure to shrink the Window 7 partition with the Windows 7 disk management, before you reinstall Ubuntu)

But I actually recommend to keep your current setup, because it's bests to avoid unnecessary partitioning.

And I agree with presence1960 advice to install Grub to the MBR of /dev/sda. Boot up should be slightly faster and its keeps Window 7 and Ubuntu independent from each other.


GRUB has a problem with that and an MSDOS partition table.

Indeed, but luckily it can be fixed fairly easily:
Boot into Ubuntu, open a terminal and open the file "/etc/default/grub" via


gksudo gedit /etc/default/grub

Add the line


GRUB_PRELOAD_MODULES="part_msdos"

and save the file
Also since you will boot Ubuntu from /dev/sdb I recommend to edit your device.map


gksudo gedit /boot/grub/device.map
Change it to


(hd0) /dev/sdb
(hd1) /dev/sda

Save the file.

Open a terminal and run


sudo dpkg-reconfigure grub-pc

go with the defaults, but at the last window select sdb and deselect sda. This will insure all grub-pc (GRUB2) updates go to sdb rather than sda.

Reconfiguring "grub-pc" should automatically run "grub-install /dev/sdb" and "sudo update-grub". So you don't have to run those manually.

Finally, just as suggested by presence1960,


sudo apt-get install lilo

(ignore the warnings) and then


sudo lilo -M /dev/sda mbr

Reboot and go into BIOS and set sdb disk as first hard disk in the hard disk boot order. Save changes to CMOS and and see whether you can boot into Window 7 and Ubuntu.

All of the commands can be run from Ubuntu. No need to use the LiveCD.

MadParrot
February 28th, 2010, 12:36 AM
Thanks for the suggestions guys! Will give things a try and let you know how how it goes.

MadParrot
February 28th, 2010, 12:11 PM
Success!! :KS Thanks both for your help - worked perfectly. Great community/forum here. Posting from my unscathed windows installation now; I can now cat and photoshop to me heart's content.


Hadn't realised I had accidentally installed ubuntu on the data drive, though it doesn't really matter - I can chuck in a putative 20TB drive when I eventually run out of space :) (installed grub on /dev/sdb along with the linux installation for future ref). Ah well, I understand things just that little better now... Thanks again.

presence1960
February 28th, 2010, 01:35 PM
Success!! :KS Thanks both for your help - worked perfectly. Great community/forum here. Posting from my unscathed windows installation now; I can now cat and photoshop to me heart's content.


Hadn't realised I had accidentally installed ubuntu on the data drive, though it doesn't really matter - I can chuck in a putative 20TB drive when I eventually run out of space :) (installed grub on /dev/sdb along with the linux installation for future ref). Ah well, I understand things just that little better now... Thanks again.

Glad you got it up & running! Enjoy your dual-boot setup.