Another Grub problem

Mars

Honorary Master
Joined
Feb 4, 2006
Messages
11,452
Reaction score
1,149
Location
Cape Town
I have installed 7 and Karmic onto my xp machine.

First 7 then karmic.

It boots fine into Karmic, but when I choose "Windows 7 (loader) (on /dev/sdb1)"

It just gives me an error :

"error: no such device: fc306940306902ce"

No 7 or xp anymore... Any ideas?
 
Post the output of:

sudo fdisk -l
sudo cat /etc/fstab
sudo cat /boot/grub/grub.cfg

When you paste it here, put it around the code tags

<code>
paste output
</code>

Except use [ and ] instead of < and >
 
Ok cool:

sudo fdisk -l
Code:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
16 heads, 63 sectors/track, 969021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x18d37dd7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1      969016   488384032+   7  HPFS/NTFS

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
16 heads, 63 sectors/track, 620181 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0xadf45812

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      620178   312569680+   7  HPFS/NTFS

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x64a5e197

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       13995   112414806   83  Linux
/dev/sdc2           13996       14593     4803435    5  Extended
/dev/sdc5           13996       14593     4803403+  82  Linux swap / Solaris

sudo cat /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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    defaults        0       0
# / was on /dev/sdc1 during installation
UUID=42f57553-1199-4d35-96e7-477ddfbb5651 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdc5 during installation
UUID=119dd36d-5759-49a5-9983-f89ba64ab43a none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

sudo cat /boot/grub/grub.cfg
Code:
#
# 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=(hd2,1)
search --no-floppy --fs-uuid --set 42f57553-1199-4d35-96e7-477ddfbb5651
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-14-generic-pae" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd2,1)
	search --no-floppy --fs-uuid --set 42f57553-1199-4d35-96e7-477ddfbb5651
	linux	/boot/vmlinuz-2.6.31-14-generic-pae root=UUID=42f57553-1199-4d35-96e7-477ddfbb5651 ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-14-generic-pae
}
menuentry "Ubuntu, Linux 2.6.31-14-generic-pae (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd2,1)
	search --no-floppy --fs-uuid --set 42f57553-1199-4d35-96e7-477ddfbb5651
	linux	/boot/vmlinuz-2.6.31-14-generic-pae root=UUID=42f57553-1199-4d35-96e7-477ddfbb5651 ro single 
	initrd	/boot/initrd.img-2.6.31-14-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/sdb1)" {
	insmod ntfs
	set root=(hd1,1)
	search --no-floppy --fs-uuid --set fc306940306902ce
	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 ###

Thanks for the help.
 
In
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
	insmod ntfs
	set root=(hd1,1)
	search --no-floppy --fs-uuid --set fc306940306902ce
	chainloader +1

It seems to me like the UUID (fc306940306902ce) is being truncated. Run
Code:
sudo blkid -s UUID
Then you can copy the UUID for your /dev/sdb1 into your grub.cfg windows section. So that it looks like:
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
	insmod ntfs
	set root=(hd1,1)
	search --no-floppy --fs-uuid --set d71aa172-bc69-48c1-a78b-87dc1fe06cb1
	chainloader +1
 
Unfortunately its the same:

sudo blkid -s UUID:

/dev/sda1: UUID="7AB07A36B079F949"
/dev/sdb1: UUID="FC306940306902CE"
/dev/sdc1: UUID="42f57553-1199-4d35-96e7-477ddfbb5651"
/dev/sdc5: UUID="119dd36d-5759-49a5-9983-f89ba64ab43a"
 
The UUID reported by blkid is uppercase... the one in your grub.cfg file is in lowercase.

Anything happen if you uppercase the one in grub.cfg?

Note this is grub2, so one shouldn't actually edit grub.cfg directly (rather edit the grub config scripts in /etc later once you have it working).
 
I would even edit so that it looks like
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
	set root=(hd1,1)
	chainloader +1
 
Thanks. I will give it a go tonight.

One more thing tho. I can't edit the file. Should I change the permissions, then edit it? Or is there another way...
 
What’s more the suggestion above is a temporary one. when update-grub is next run it will be overwritten. If this works, then I can provide you with a permanent solution.
 
ok, it worked.. kinda.

I think my windows 7 boot loader is messed up, because it just goes to a black screen.

If I change the hdd to "0" (my xp disk) it comes up with a ntldr.exe is missing error.

So this is what I'm thinking: Unplug the Ubuntu disk, do a repair on the xp installation to make it bootable again and to hell with 7 for a bit. Then I plug in the Ububtu disk, change the hard drive to "0" again and .... voila?

I will give 7 a go a bit later, right now I just need my pc to work for a bit. (I want to play torchlight)
 
I porked it.

It will now boot into xp, but grub is gone.

I assumed that grub resided on the Ubuntu disk (yes I know, assumption is the mother of all fk ups), but when I make that the primary boot disk, it gives me a black screen.
If I make the xp disk primary boot, it boots into xp.

I read that you can restore grub by booting the live cd and then doing this in a terminal:
Type "grub"
Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
Type "setup (hd0)", ot whatever your harddisk nr is.
Quit grub by typing "quit".

BUT: when I type grub it gives me an error = The program 'grub' is not currently installed.

eish!
 
Last edited:
If you boot your install CD (Ubuntu), there is probably an option to repair Grub.

Failing which, boot the live cd and open a terminal

Code:
sudo mkdir /mnt/karmic
sudo mount /dev/sdb1 /mnt/karmic/
sudo mount -o bind /proc /mnt/karmic/proc
sudo mount -o bind /dev /mnt/karmic/dev
sudo mount -o bind /dev/pts /mnt/karmic/dev/pts
sudo mount -o bind /sys /mnt/karmic/sys
sudo cp /etc/resolv.conf /mnt/karmic/etc/resolve.conf
sudo chroot /mnt/karmic /bin/bash
sudo grub-install /dev/sda
sudo update-grub

make sure grub points to the xp install
 
I checked the help option on the live cd, it says there are no repair options on the live cd.

Thanks for the help! I will do that tonight.
 
Top
Sign up to the MyBroadband newsletter
X