PDA

View Full Version : [ubuntu] Need help getting my Windows 7 entry back in Grub2



ninodoce
March 13th, 2011, 08:32 AM
I recently tried to delet excess entries from the Grub2 boot loader, and i succeeded, the only problem is that all i have now are the 2 Ubuntu entries, but no Windows 7, entrie.
I have tried all things in this site,and everywhere else but it seems that the problem is that the windows 7 entrie has been deleted from THE /ETC/GRUB.D/30_os-prober.nk

I think this problem can be solved by re-pasting the correct windows 7 script from

the grub.cfg file so if anyone can just paste one of those here for me, or offer a better solution i would be forever grateful. Countless hours trying to fix this problem



This is my grub.cfg file




#
# 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 part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
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
### END /etc/grub.d/05_debian_theme ###

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

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

menuentry 'Ubuntu 10.4' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu10.4(recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac

cat <<EOF
chainloader +1
}
### 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 ###

oboedad55
March 13th, 2011, 08:53 AM
So if you run "sudo update-grub", it doesn't find Windows? What file did you edit? The one you pasted, as it says, is not a good one to edit. When you run update-grub it will generate a new grub.cfg file. FWIW, here's my XP section from grub.cfg. XP is installed on the first partition of the hard drive. Remember, my disk uuid won't match yours. One thing I've learned, if I decide to edit something dangerous I ALWAYS make a backup first.

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows XP Professional x64 Edition (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ea58867a58864573
drivemap -s (hd0) ${root}
chainloader +1

Failing the above, you can always reinstall grub from a liveCD. Below are directions. One caveat, when you reinstall grub it may not find Windows right away. Not to panic; boot into Ubuntu, run "sudo update-grub" and it will pick it up.


Firstly, boot from your Linux or Ubuntu CD, and choose the option of trying Ubuntu without installation.

After Ubuntu gets loaded from the Live CD, you have to find out that which of the drive or partition was the one, containing your previously installed Linux. For checking out the partitions, goto the terminal ( Applications -> Accessories -> Terminal ), and write:

sudo fdisk -l
or
fdisk -l

This will show you the list of partitions you have in your system.

After you get to know the partition where your Ubuntu was installed, write the following commands. For example, if the partition is /dev/sda1, you have to write the following commands (you have to replace the sda1 from your partition name):

sudo mount /dev/sda1 /mnt
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc

Now write:

sudo chroot /mnt

and then install Grub by the following command:

grub-install /dev/sda

If any errors found after entering the above line, then try this one:

grub-install –recheck /dev/sda

This is it.

Now you can reboot your system, and enjoy using your previously installed Ubuntu, after un-mounting the system by:

sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt

and simply reboot:

sudo reboot

kansasnoob
March 13th, 2011, 11:00 AM
Your grub.cfg is not even showing either "/etc/grub.d/10_linux" or "/etc/grub.d/30_os-prober"! Did you disable them?

I'm honestly thinking you'll have to purge and reinstall grub2 as described here:

http://ubuntuforums.org/showthread.php?t=1581099

But you could first try:


sudo chmod +x /etc/grub.d/10_linux /etc/grub.d/30_os-prober


sudo update-grub

BTW there is no need to create a totally customized "/etc/grub.d/40_custom" just to remove unwanted kernel entries. You can do so either with Ubuntu Tweak or the Grub Customizer:

http://ubuntu-tweak.com/

http://ubuntuforums.org/showthread.php?p=10340183#post10340183

I prefer the latter.

coffeecat
March 13th, 2011, 11:06 AM
Hi and welcome to the forum. :)

Did you run 'sudo update-grub'?

Two possible reasons for os-prober to fail to detect Windows 7 (or any Windows) after running update-grub are:

1 - Somehow grub files have been written to the Windows partition boot sector. There have been quite a few threads about this. To see if this is so, and in your situation this is a good thing to do anyway, go to this site:

http://bootinfoscript.sourceforge.net/

Run the bootscript in Ubuntu according to those instructions. Post the RESULTS.txt file, but please post it within
and tags for legibility. It is very long. You can use the # icon on the message toolbar for this. The link tells you how.

2 - os-prober has inexplicably gone awol. This is unlikely but I have been involved in threads where this has happened, and it's easily checked. Open Synaptic (System > Administration) and check that the package os-prober is installed. If not, install it, and then open a terminal and run:


sudo update-grub

cipherboy_loc
March 13th, 2011, 01:47 PM
Run the boot info script in my signature, and then attach the resulting .txt file (RESULTS.TXT) here.


Cipherboy

ninodoce
March 14th, 2011, 06:21 AM
I tried re-installing Grub2 by following all of ur directions, in the last step it did give me an errir so i did that recheck thing and i think it did reinstall but it still does not show me my windows 7 in the loader. This is what happens when i update grub


Generating grub.cfg ...
Found Windows 7 (loader) on /dev/sda2
Found openSUSE 11.3 (x86_64) on /dev/sda6
done
nino@nino-Studio-1558:~$

It still finds the windows but it does not display it in the menu.


I'll move on to the other people's thoughts on it. Thank you very much though

ninodoce
March 14th, 2011, 07:01 AM
Boot Info Script 0.55 dated February 15th, 2010

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

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #7 for (,msdos7)/boot/grub.

sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Dell Utility: Fat16
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /COMMAND.COM

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: /bootmgr /Boot/BCD

sda3: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda3 has
350731568 sectors, but according to the info from
fdisk, it has 359149139 sectors.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe

sda4: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

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

sda6: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Welcome to openSUSE 11.3 "Teal"
- Kernel ().
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda7: __________________________________________________ _______________________

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

=========================== 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
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 63 224,909 224,847 de Dell Utility
/dev/sda2 229,376 24,223,743 23,994,368 7 HPFS/NTFS
/dev/sda3 * 24,223,744 383,372,883 359,149,140 7 HPFS/NTFS
/dev/sda4 383,373,311 781,459,455 398,086,145 f W95 Ext d (LBA)
/dev/sda5 383,373,313 387,568,125 4,194,813 82 Linux swap / Solaris
/dev/sda6 387,569,664 429,514,751 41,945,088 83 Linux
/dev/sda7 429,516,800 781,459,455 351,942,656 83 Linux


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 07DB-021B vfat DellUtility
/dev/sda2 C0EE0534EE05246E ntfs RECOVERY
/dev/sda3 5874080F7407EE96 ntfs OS
/dev/sda4: PTTYPE="dos"
/dev/sda5 7ad508a0-9573-4313-bfec-8eea9d834a1b swap
/dev/sda6 67aa7f85-68ad-454c-8aca-94be63eacba7 ext4
/dev/sda7 915570cf-0d8e-41ff-b2ce-0b072b07886d ext4
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

/dev/sda7 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sda3 /media/OS fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)
/dev/sda6 /media/67aa7f85-68ad-454c-8aca-94be63eacba7 ext4 (rw,nosuid,nodev,uhelper=udisks)


=========================== sda6/boot/grub/menu.lst: ===========================

# Modified by YaST2. Last modification on Tue Mar 1 21:37:44 EST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.3 - 2.6.34-12
root (hd0,5)
kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3 - 2.6.34-12
root (hd0,5)
kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title windows 1
rootnoverify (hd0,1)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,2)
chainloader +1

=============================== sda6/etc/fstab: ===============================

/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part7 /home ext4 acl,user_xattr 1 2
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part2 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.U TF-8 0 0
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part3 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.U TF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

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


216.2GB: boot/grub/menu.lst
215.7GB: boot/grub/stage2
199.1GB: boot/initrd
199.1GB: boot/initrd-2.6.34-12-desktop
216.0GB: boot/vmlinuz
216.0GB: boot/vmlinuz-2.6.34-12-desktop

=========================== sda7/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 part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
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
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-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/30_os-prober ###

menuentry "Desktop -- openSUSE 11.3 - 2.6.34-12 (on /dev/sda6)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 67aa7f85-68ad-454c-8aca-94be63eacba7
linux /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.34-12-desktop
}
menuentry "Failsafe -- openSUSE 11.3 - 2.6.34-12 (on /dev/sda6)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 67aa7f85-68ad-454c-8aca-94be63eacba7
linux /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
initrd /boot/initrd-2.6.34-12-desktop
}
### 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.

menuentry 'Ubuntu 10.4' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu10.4(recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry "Windows 7" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac

cat <<EOF
chainloader +1
}
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
multiboot /boot/gnumach.gz root=device:${mach_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--device-master-port='\${device-port}' \\
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
'\$(task-create)' '\$(task-resume)'
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
### 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 ###

=============================== sda7/etc/fstab: ===============================

# /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 nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=7ad508a0-9573-4313-bfec-8eea9d834a1b none swap sw 0 0

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


379.0GB: boot/grub/grub.cfg
221.3GB: boot/initrd.img-2.6.35-22-generic
221.4GB: boot/initrd.img-2.6.35-27-generic
220.1GB: boot/vmlinuz-2.6.35-22-generic
245.8GB: boot/vmlinuz-2.6.35-27-generic
221.4GB: initrd.img
221.3GB: initrd.img.old
245.8GB: vmlinuz
220.1GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda4

00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
000001b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 fe |................|
000001c0 ff ff 82 fe ff ff 02 00 00 00 fd 01 40 00 00 fe |............@...|
000001d0 ff ff 05 fe ff ff ff 01 40 00 02 0e 80 02 00 00 |........@.......|
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

wilee-nilee
March 14th, 2011, 07:25 AM
Install gparted in Ubuntu and open it and move the boot flag to sda2, that is where the boot is. Just right click on sda2 manage flags and click boot, then run the update grub command again.

Your sda7 looks to be missing a bit here is mine.
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
yours
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab

You actually have the right people helping you so the script will get you setup.

Try moving the boot flag, and even if that works check for any comments on the missing highlight in my example of the Boot files/dirs

If your in the Ubuntu setup open synaptic and look to see these are installed just to make sure grub is loaded.
grub-pc, grub-common, os-prober

cipherboy_loc
March 14th, 2011, 01:18 PM
What I am thinking is that /etc/grub.d/30_os-prober_proxy got modified. Can you post back the contents of that file?

Mine looks like:


#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "+*
"
Previously, it was not showing my newer kernels on Gentoo, so I had to modify it to what is above (what fixed it was removing the lines after '/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-*', and changing that line to '/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "+*'

Cipherboy

kansasnoob
March 14th, 2011, 03:53 PM
Install gparted in Ubuntu and open it and move the boot flag to sda2, that is where the boot is. Just right click on sda2 manage flags and click boot, then run the update grub command again.

Your sda7 looks to be missing a bit here is mine.
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
yours
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab

You actually have the right people helping you so the script will get you setup.

Try moving the boot flag, and even if that works check for any comments on the missing highlight in my example of the Boot files/dirs

If your in the Ubuntu setup open synaptic and look to see these are installed just to make sure grub is loaded.
grub-pc, grub-common, os-prober

+1!

The boot flag needs to be moved from sda3 to sda2, and "boot/grub/core.img" is missing from the Ubuntu grub files.

I'd be surprised if Ubuntu would even boot itself with that missing, so if ninodoce is still booted into Ubuntu I'd try running:


sudo apt-get install --reinstall grub-common grub-pc

Then check for "boot/grub/core.img" by running:


ls /boot/grub

I know that looks like a lot of files but it's all in alphabetical order and you're only looking for "core.img". Here's an example with core.img highlighted:


lance@lance-desktop:~$ ls /boot/grub
915resolution.mod gcry_twofish.mod pbkdf2.mod
acpi.mod gcry_whirlpool.mod pci.mod
affs.mod gettext.mod play.mod
afs_be.mod gfxmenu.mod png.mod
afs.mod gfxterm.mod probe.mod
aout.mod gptsync.mod pxeboot.img
ata.mod grldr.img pxecmd.mod
ata_pthru.mod grub.cfg pxe.mod
at_keyboard.mod grubenv raid5rec.mod
befs_be.mod gzio.mod raid6rec.mod
befs.mod halt.mod raid.mod
biosdisk.mod hashsum.mod read.mod
bitmap.mod hdparm.mod reboot.mod
bitmap_scale.mod hello.mod regexp.mod
blocklist.mod help.mod reiserfs.mod
boot.img hexdump.mod reiserfs_stage1_5
boot.mod hfs.mod relocator.mod
bsd.mod hfsplus.mod scsi.mod
btrfs.mod hwmatch.lua search_fs_file.mod
bufio.mod iorw.mod search_fs_uuid.mod
cat.mod iso9660.mod search_label.mod
cdboot.img jfs.mod search.mod
chain.mod jfs_stage1_5 sendkey.mod
cmostest.mod jpeg.mod serial.mod
cmp.mod kernel.img setjmp.mod
command.lst keylayouts.mod setpci.mod
configfile.mod keystatus.mod sfs.mod
core.img legacycfg.mod sleep.mod
cpio.mod linux16.mod squash4.mod
cpuid.mod linux.mod stage1
crypto.lst lnxboot.img stage2
crypto.mod loadenv.mod tar.mod
cs5536.mod locale terminal.lst
datehook.mod loopback.mod terminal.mod
date.mod lsacpi.mod terminfo.mod
datetime.mod lsapm.mod test_blockarg.mod
default lsmmap.mod testload.mod
diskboot.img ls.mod test.mod
dm_nv.mod lspci.mod tga.mod
drivemap.mod lua.mod trig.mod
e2fs_stage1_5 lvm.mod true.mod
echo.mod mdraid09.mod udf.mod
efiemu32.o mdraid1x.mod ufs1.mod
efiemu64.o memdisk.mod ufs2.mod
efiemu.mod memrw.mod uhci.mod
elf.mod minicmd.mod unicode.pf2
example_functional_test.mod minix2.mod usb_keyboard.mod
ext2.mod minix.mod usb.mod
extcmd.mod minix_stage1_5 usbms.mod
fat.mod mmap.mod usbserial_common.mod
fat_stage1_5 moddep.lst usbserial_ftdi.mod
font.mod msdospart.mod usbserial_pl2303.mod
fshelp.mod multiboot2.mod usbtest.mod
fs.lst multiboot.mod vbe.mod
functional_test.mod nilfs2.mod vga.mod
g2hdr.img normal.mod vga_text.mod
gcry_arcfour.mod ntfscomp.mod video_bochs.mod
gcry_blowfish.mod ntfs.mod video_cirrus.mod
gcry_camellia.mod ntldr.mod video_fb.mod
gcry_cast5.mod ohci.mod videoinfo.mod
gcry_crc.mod part_acorn.mod video.lst
gcry_des.mod part_amiga.mod video.mod
gcry_md4.mod part_apple.mod videotest.mod
gcry_md5.mod part_bsd.mod warty-final-ubuntu.png
gcry_rfc2268.mod part_gpt.mod xfs.mod
gcry_rijndael.mod partmap.lst xfs_stage1_5
gcry_rmd160.mod part_msdos.mod xnu.mod
gcry_seed.mod part_sun.mod xnu_uuid.mod
gcry_serpent.mod part_sunpc.mod xzio.mod
gcry_sha1.mod parttool.lst zfsinfo.mod
gcry_sha256.mod parttool.mod zfs.mod
gcry_sha512.mod password.mod
gcry_tiger.mod password_pbkdf2.mod


If it's still missing I'd be tempted to try running "sudo dpkg-reconfigure grub-pc", but hopefully it'll be there.

oldfred
March 14th, 2011, 04:12 PM
this is the windows entry that was created, which looks like you modified the grub scripts. It has script where the windows entry should be. The uninstall and reinstall of grub2 should replace the damaged script.


menuentry "Windows 7" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac

cat <<EOF
chainloader +1
}

ninodoce
March 15th, 2011, 03:50 AM
So i ran all that stuff u told me to, and that file was there. I am now going to try and move the flag, whatever that is, to the correct sda

ninodoce
March 15th, 2011, 03:59 AM
This is what my 30_os-prober looks like
From the looks of it all i have is

#! /bin/sh
set -e

Instead of all that stuff that u have, should i copy it onto the beggining?


#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

found_other_os=

make_timeout () {
if [ "x${found_other_os}" = "x" ] ; then
if [ "x${1}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=
else
verbose=" --verbose"
fi

if [ "x${1}" = "x0" ] ; then
cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep$verbose --interruptible 3 ; then
set timeout=0
fi
fi
fi
EOF
else
cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
fi
fi
EOF
fi
fi
fi
}

adjust_timeout () {
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
adjust_timeout
exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
# missing os-prober and/or linux-boot-prober
adjust_timeout
exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
# empty os-prober output, nothing doing
adjust_timeout
exit 0
fi

osx_entry() {
cat << EOF
menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ \$do_resume = 0 ]; then
xnu_uuid ${OSXUUID} uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
$1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
xnu_mkext /System/Library/Extensions.mkext
else
xnu_kextdir /System/Library/Extensions
fi
if [ -f /Extra/Extensions.mkext ]; then
xnu_mkext /Extra/Extensions.mkext
fi
if [ -d /Extra/Extensions ]; then
xnu_kextdir /Extra/Extensions
fi
if [ -f /Extra/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
fi
if [ -f /Extra/splash.jpg ]; then
insmod jpeg
xnu_splash /Extra/splash.jpg
fi
if [ -f /Extra/splash.png ]; then
insmod png
xnu_splash /Extra/splash.png
fi
if [ -f /Extra/splash.tga ]; then
insmod tga
xnu_splash /Extra/splash.tga
fi
fi
}
EOF
}

for OS in ${OSPROBED} ; do
DEVICE="`echo ${OS} | cut -d ':' -f 1`"
LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
BOOT="`echo ${OS} | cut -d ':' -f 4`"

if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi

echo "Found ${LONGNAME} on ${DEVICE}" >&2
found_other_os=1

case ${BOOT} in
chain)

cat << EOF

EOF
;;
linux)
LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
prepare_boot_cache=

for LINUX in ${LINUXPROBED} ; do
LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

if [ -z "${LLABEL}" ] ; then
LLABEL="${LONGNAME}"
fi

if [ "${LROOT}" != "${LBOOT}" ]; then
LKERNEL="${LKERNEL#/boot}"
LINITRD="${LINITRD#/boot}"
fi

cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
initrd ${LINITRD}
EOF
fi
cat << EOF
}
EOF
done
;;
macosx)
OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
osx_entry xnu_kernel 32
osx_entry xnu_kernel64 64
;;
hurd)
cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
multiboot /boot/gnumach.gz root=device:${mach_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--device-master-port='\${device-port}' \\
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
'\$(task-create)' '\$(task-resume)'
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
;;
*)
echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2
;;
esac
done

adjust_timeout

ninodoce
March 15th, 2011, 04:01 AM
I do haev the OS-prober installed, i am going to try re-installing it in a few minutes hopefully that doesnt screww me even more.

wilee-nilee
March 15th, 2011, 04:21 AM
I do haev the OS-prober installed, i am going to try re-installing it in a few minutes hopefully that doesnt screww me even more.

Always run the whole bootscript, just bits and pieces make it even more difficult.

Also describe in detail what you have done and who your answering.

Not including myself you have the eyes of some of the best at fixing this posting help them out.:)

ninodoce
March 15th, 2011, 06:08 AM
Install gparted in Ubuntu and open it and move the boot flag to sda2, that is where the boot is. Just right click on sda2 manage flags and click boot, then run the update grub command again.

Your sda7 looks to be missing a bit here is mine.
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
yours
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab

You actually have the right people helping you so the script will get you setup.

Try moving the boot flag, and even if that works check for any comments on the missing highlight in my example of the Boot files/dirs

If your in the Ubuntu setup open synaptic and look to see these are installed just to make sure grub is loaded.
grub-pc, grub-common, os-prober

Ive done all of this, i changed the flag with g-parted, and followed the rest to the letter, but nothing has happened yet.


nino@nino-Studio-1558:~$ sudo update-grub
[sudo] password for nino:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-27-generic
Found initrd image: /boot/initrd.img-2.6.35-27-generic
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found Windows 7 (loader) on /dev/sda2
Found openSUSE 11.3 (x86_64) on /dev/sda6
done
nino@nino-Studio-1558:~$



What else can i do, i do not want to re-install my windows 7

oboedad55
March 15th, 2011, 06:13 AM
If you just want to get Windows 7 back you can start the install disk and choose "repair" and reinstall the boot loader. Following that you can boot the Ubuntu CD and reinstall Grub if you want them both back. To reinstall the Windows boot loader just google for it. It's simple and there are easy directions online.

wilee-nilee
March 15th, 2011, 06:48 AM
Ive done all of this, i changed the flag with g-parted, and followed the rest to the letter, but nothing has happened yet.


nino@nino-Studio-1558:~$ sudo update-grub
[sudo] password for nino:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-27-generic
Found initrd image: /boot/initrd.img-2.6.35-27-generic
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found Windows 7 (loader) on /dev/sda2
Found openSUSE 11.3 (x86_64) on /dev/sda6
done
nino@nino-Studio-1558:~$



What else can i do, i do not want to re-install my windows 7

Since you have applied changes the boot script will help. This will show the latest setup and what has changed.

If you want to install the windows bootloader in the mbr you boot a W7 recovery or install disc hit the language choice then r for repair and get to the command terminal and run.
bootrec.exe /fixmbr

ninodoce
March 15th, 2011, 06:54 AM
This is the latest boot script, after i tried to install the windows boot loader, and nothing happened


Boot Info Script 0.55 dated February 15th, 2010

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

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #7 for (,msdos7)/boot/grub.

sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Dell Utility: Fat16
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /COMMAND.COM

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: /bootmgr /Boot/BCD

sda3: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda3 has
350731568 sectors, but according to the info from
fdisk, it has 359149139 sectors.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe

sda4: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

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

sda6: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Welcome to openSUSE 11.3 "Teal"
- Kernel ().
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda7: __________________________________________________ _______________________

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

=========================== 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
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 63 224,909 224,847 de Dell Utility
/dev/sda2 * 229,376 24,223,743 23,994,368 7 HPFS/NTFS
/dev/sda3 24,223,744 383,372,883 359,149,140 7 HPFS/NTFS
/dev/sda4 383,373,311 781,459,455 398,086,145 f W95 Ext d (LBA)
/dev/sda5 383,373,313 387,568,125 4,194,813 82 Linux swap / Solaris
/dev/sda6 387,569,664 429,514,751 41,945,088 83 Linux
/dev/sda7 429,516,800 781,459,455 351,942,656 83 Linux


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 07DB-021B vfat DellUtility
/dev/sda2 C0EE0534EE05246E ntfs RECOVERY
/dev/sda3 5874080F7407EE96 ntfs OS
/dev/sda4: PTTYPE="dos"
/dev/sda5 7ad508a0-9573-4313-bfec-8eea9d834a1b swap
/dev/sda6 67aa7f85-68ad-454c-8aca-94be63eacba7 ext4
/dev/sda7 915570cf-0d8e-41ff-b2ce-0b072b07886d ext4
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

/dev/sda7 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sr0 /media/UDF Volume udf (ro,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000, iocharset=utf8,umask=0077)


=========================== sda6/boot/grub/menu.lst: ===========================

# Modified by YaST2. Last modification on Tue Mar 1 21:37:44 EST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.3 - 2.6.34-12
root (hd0,5)
kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3 - 2.6.34-12
root (hd0,5)
kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title windows 1
rootnoverify (hd0,1)
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,2)
chainloader +1

=============================== sda6/etc/fstab: ===============================

/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part7 /home ext4 acl,user_xattr 1 2
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part2 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.U TF-8 0 0
/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part3 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.U TF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

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


216.2GB: boot/grub/menu.lst
215.7GB: boot/grub/stage2
199.1GB: boot/initrd
199.1GB: boot/initrd-2.6.34-12-desktop
216.0GB: boot/vmlinuz
216.0GB: boot/vmlinuz-2.6.34-12-desktop

=========================== sda7/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 part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
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
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-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/30_os-prober ###

menuentry "Desktop -- openSUSE 11.3 - 2.6.34-12 (on /dev/sda6)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 67aa7f85-68ad-454c-8aca-94be63eacba7
linux /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part5 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.34-12-desktop
}
menuentry "Failsafe -- openSUSE 11.3 - 2.6.34-12 (on /dev/sda6)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 67aa7f85-68ad-454c-8aca-94be63eacba7
linux /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK5056GSY_11NFTMZKT-part6 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
initrd /boot/initrd-2.6.34-12-desktop
}
### 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.

menuentry 'Ubuntu 10.4' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu10.4(recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 915570cf-0d8e-41ff-b2ce-0b072b07886d
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
### 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 ###

=============================== sda7/etc/fstab: ===============================

# /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 nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
UUID=915570cf-0d8e-41ff-b2ce-0b072b07886d / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=7ad508a0-9573-4313-bfec-8eea9d834a1b none swap sw 0 0

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


245.8GB: boot/grub/core.img
379.0GB: boot/grub/grub.cfg
221.3GB: boot/initrd.img-2.6.35-22-generic
221.4GB: boot/initrd.img-2.6.35-27-generic
220.1GB: boot/vmlinuz-2.6.35-22-generic
245.8GB: boot/vmlinuz-2.6.35-27-generic
221.4GB: initrd.img
221.3GB: initrd.img.old
245.8GB: vmlinuz
220.1GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda4

00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
000001b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 fe |................|
000001c0 ff ff 82 fe ff ff 02 00 00 00 fd 01 40 00 00 fe |............@...|
000001d0 ff ff 05 fe ff ff ff 01 40 00 02 0e 80 02 00 00 |........@.......|
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

wilee-nilee
March 15th, 2011, 07:00 AM
So the script does look different closer to what we should see. So what does boot now can you get into Ubuntu, and Fedora.

ninodoce
March 15th, 2011, 07:04 AM
So the script does look different closer to what we should see. So what does boot now can you get into Ubuntu, and Fedora.

Yea ive been restarting and booting into Ubuntu all the time, OpeSuse i thought i had deleted a while ago so i wont try it since itll probably mess something up. All i need is to get my Windows 7, and Ubuntu together on the grub2 boot loader, and then i will be a happy man. I still cant thank you guys enough though for all your help.

wilee-nilee
March 15th, 2011, 07:21 AM
Yea ive been restarting and booting into Ubuntu all the time, OpeSuse i thought i had deleted a while ago so i wont try it since itll probably mess something up. All i need is to get my Windows 7, and Ubuntu together on the grub2 boot loader, and then i will be a happy man. I still cant thank you guys enough though for all your help.

I assume you have run a update-grub command in Ubuntu after the modifications. I could make other suggestions but I think this is better for the posters who are better at this.

ninodoce
March 15th, 2011, 07:27 AM
I assume you have run a update-grub command in Ubuntu after the modifications. I could make other suggestions but I think this is better for the posters who are better at this.

Yeap done it a thousand times, still nothing changes.

coffeecat
March 15th, 2011, 11:22 AM
@ninodoce, what do you mean in this post?


This is what my 30_os-prober looks like
From the looks of it all i have is

#! /bin/sh
set -e

Instead of all that stuff that u have, should i copy it onto the beggining?


#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

found_other_os=

make_timeout () {
if [ "x${found_other_os}" = "x" ] ; then
if [ "x${1}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=
else
verbose=" --verbose"
fi

if [ "x${1}" = "x0" ] ; then
cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep$verbose --interruptible 3 ; then
set timeout=0
fi
fi
fi
EOF
else
cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
fi
fi
EOF
fi
fi
fi
}

adjust_timeout () {
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
adjust_timeout
exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
# missing os-prober and/or linux-boot-prober
adjust_timeout
exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
# empty os-prober output, nothing doing
adjust_timeout
exit 0
fi

osx_entry() {
cat << EOF
menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ \$do_resume = 0 ]; then
xnu_uuid ${OSXUUID} uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
$1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
xnu_mkext /System/Library/Extensions.mkext
else
xnu_kextdir /System/Library/Extensions
fi
if [ -f /Extra/Extensions.mkext ]; then
xnu_mkext /Extra/Extensions.mkext
fi
if [ -d /Extra/Extensions ]; then
xnu_kextdir /Extra/Extensions
fi
if [ -f /Extra/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
fi
if [ -f /Extra/splash.jpg ]; then
insmod jpeg
xnu_splash /Extra/splash.jpg
fi
if [ -f /Extra/splash.png ]; then
insmod png
xnu_splash /Extra/splash.png
fi
if [ -f /Extra/splash.tga ]; then
insmod tga
xnu_splash /Extra/splash.tga
fi
fi
}
EOF
}

for OS in ${OSPROBED} ; do
DEVICE="`echo ${OS} | cut -d ':' -f 1`"
LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
BOOT="`echo ${OS} | cut -d ':' -f 4`"

if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi

echo "Found ${LONGNAME} on ${DEVICE}" >&2
found_other_os=1

case ${BOOT} in
chain)

cat << EOF

EOF
;;
linux)
LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
prepare_boot_cache=

for LINUX in ${LINUXPROBED} ; do
LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

if [ -z "${LLABEL}" ] ; then
LLABEL="${LONGNAME}"
fi

if [ "${LROOT}" != "${LBOOT}" ]; then
LKERNEL="${LKERNEL#/boot}"
LINITRD="${LINITRD#/boot}"
fi

cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
initrd ${LINITRD}
EOF
fi
cat << EOF
}
EOF
done
;;
macosx)
OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
osx_entry xnu_kernel 32
osx_entry xnu_kernel64 64
;;
hurd)
cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
multiboot /boot/gnumach.gz root=device:${mach_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--device-master-port='\${device-port}' \\
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
'\$(task-create)' '\$(task-resume)'
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
;;
*)
echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2
;;
esac
done

adjust_timeout


What you enclosed in code tags is what 30_os-prober should look like, yet you say that you only have the two lines:


#! /bin/sh
set -eWhich is it?

kansasnoob
March 15th, 2011, 03:23 PM
I copied the 30_os-prober file you posted and named it "30_os-prober_ninodoce", then I copied my Maverick file and named it "30_os-prober_mine". Next I ran a "diff-u" on the two files:


--- 30_os-prober_ninodoce 2011-03-15 08:57:03.000000000 -0500
+++ 30_os-prober_mine 2011-03-15 08:58:28.000000000 -0500
@@ -29,13 +29,13 @@
if [ "x${found_other_os}" = "x" ] ; then
if [ "x${1}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
- verbose=
+ verbose=
else
- verbose=" --verbose"
+ verbose=" --verbose"
fi

if [ "x${1}" = "x0" ] ; then
- cat <<EOF
+ cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
@@ -51,7 +51,7 @@
fi
EOF
else
- cat << EOF
+ cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
@@ -99,9 +99,9 @@
cat << EOF
menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
EOF
- save_default_entry | sed -e "s/^/\t/"
- prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
- cat << EOF
+ save_default_entry | sed -e "s/^/\t/"
+ prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+ cat << EOF
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
@@ -163,7 +163,24 @@
chain)

cat << EOF
+menuentry "${LONGNAME} (on ${DEVICE})" {
+EOF
+ save_default_entry | sed -e "s/^/\t/"
+ prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

+ case ${LONGNAME} in
+ Windows\ Vista*|Windows\ 7*)
+ ;;
+ *)
+ cat << EOF
+ drivemap -s (hd0) \${root}
+EOF
+ ;;
+ esac
+
+ cat <<EOF
+ chainloader +1
+}
EOF
;;
linux)
@@ -182,25 +199,25 @@
LLABEL="${LONGNAME}"
fi

- if [ "${LROOT}" != "${LBOOT}" ]; then
- LKERNEL="${LKERNEL#/boot}"
- LINITRD="${LINITRD#/boot}"
- fi
+ if [ "${LROOT}" != "${LBOOT}" ]; then
+ LKERNEL="${LKERNEL#/boot}"
+ LINITRD="${LINITRD#/boot}"
+ fi

cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
- save_default_entry | sed -e "s/^/\t/"
- if [ -z "${prepare_boot_cache}" ]; then
- prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
- fi
- printf '%s\n' "${prepare_boot_cache}"
- cat << EOF
- linux ${LKERNEL} ${LPARAMS}
+ save_default_entry | sed -e "s/^/\t/"
+ if [ -z "${prepare_boot_cache}" ]; then
+ prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
+ fi
+ printf '%s\n' "${prepare_boot_cache}"
+ cat << EOF
+ linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
- initrd ${LINITRD}
+ initrd ${LINITRD}
EOF
fi
cat << EOF
@@ -223,18 +240,18 @@
mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
- *fs) hurd_fs="${grub_fs}" ;;
- *) hurd_fs="${grub_fs}fs" ;;
+ *fs) hurd_fs="${grub_fs}" ;;
+ *) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
- multiboot /boot/gnumach.gz root=device:${mach_device}
- module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
- --multiboot-command-line='\${kernel-command-line}' \\
- --host-priv-port='\${host-port}' \\
- --device-master-port='\${device-port}' \\
- --exec-server-task='\${exec-task}' -T typed '\${root}' \\
- '\$(task-create)' '\$(task-resume)'
- module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
+ multiboot /boot/gnumach.gz root=device:${mach_device}
+ module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
+ --multiboot-command-line='\${kernel-command-line}' \\
+ --host-priv-port='\${host-port}' \\
+ --device-master-port='\${device-port}' \\
+ --exec-server-task='\${exec-task}' -T typed '\${root}' \\
+ '\$(task-create)' '\$(task-resume)'
+ module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
;;

Lots of differences, some tiny like difference in spacing, but some very huge differences :(

I'd say too many to correct easily, but don't panic! I'm in Natty right now, I'm going to boot into my Maverick and try something on my own machine and then get right back here :)

Edit: I highlighted what I think the worst of the problem is.

oldfred
March 15th, 2011, 03:31 PM
Your windows still seems to have some issues:

sda2 Operating System should have windows 7 like sda3 does
sda3 should not have an error on number of sectors

I think from the windows repair disk:
bootrec.exe /fixBoot

Probably the same for sda3 but you may have to move boot flag, but then it may install all the boot files and obsolete sda2?


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: /bootmgr /Boot/BCD

sda3: ______________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda3 has
350731568 sectors, but according to the info from
fdisk, it has 359149139 sectors.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe

kansasnoob
March 15th, 2011, 03:34 PM
Actually, here's the full content of my 30_os-prober in case you want to open yours with gedit and try replacing the entire contents using copy-n-paste:

186141

You would then of course have to run "sudo update-grub".

What I'm going to try is trashing my entire "/etc/grub.d" including all it's content and making sure that reinstalling grub-pc replaces the missing folder and files. I know I've done it before on my own machine but I didn't make any notes about what exactly worked so give me a bit.

coffeecat
March 15th, 2011, 03:39 PM
I copied the 30_os-prober file you posted and named it "30_os-prober_ninodoce", then I copied my Maverick file and named it "30_os-prober_mine". Next I ran a "diff-u" on the two files:

...

Lots of differences, some tiny like difference in spacing, but some very huge differences :(


You're right! I only eyeball compared the code the OP posted with my Maverick 30_os-prober, but I've just done a diff too. Ouch. Mea culpa! I wonder how the OP's 30_os-prober got into that state.

kansasnoob
March 15th, 2011, 03:52 PM
Your windows still seems to have some issues:

sda2 Operating System should have windows 7 like sda3 does
sda3 should not have an error on number of sectors

I think from the windows repair disk:
bootrec.exe /fixBoot

Probably the same for sda3 but you may have to move boot flag, but then it may install all the boot files and obsolete sda2?


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: /bootmgr /Boot/BCD

sda3: ______________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda3 has
350731568 sectors, but according to the info from
fdisk, it has 359149139 sectors.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe


Glad to see you around \\:D/

I was somewhat wondering about the wisdom in moving the boot flag myself this AM. What broke the boot was editing grub files, the OP had originally lost both "/etc/grub.d/10_linux" and "/etc/grub.d/30_os-prober" altogether.

I just went back to my second to last post and highlighted some of the missing Windows files in his existing 30_os-prober. Please have a look ;)

kansasnoob
March 15th, 2011, 04:07 PM
You're right! I only eyeball compared the code the OP posted with my Maverick 30_os-prober, but I've just done a diff too. Ouch. Mea culpa! I wonder how the OP's 30_os-prober got into that state.

Obviously trying to create a custom menu. I've done it myself - I mean I've really hosed things on my own box trying things that didn't work. That's how I've learned to fix stuff ;)

kansasnoob
March 15th, 2011, 06:15 PM
@ ninodoce,

oldfred got me thinking this morning, so let's get that out of the way before we go any further. In your original post you said, "I recently tried to delet excess entries from the Grub2 boot loader, and i succeeded, the only problem .............. (etc)".

So, given the reasons oldfred pointed out, I think we were wrong to move that boot flag :(

I'm thinking you should change that boot flag back to the way it was if Windows was booting OK before you tried creating that custom grub menu!

Beyond that I ran through this twice on my own machine, I'll call it:

Deep and dirty grub 2 purge and replacement!

It should work for anyone that's totally hosed their grub 2 configuration. You must be booted into Ubuntu to do this. Please copy-n-paste the commands as there is some danger involved here!

First backup the old grub.cfg (along with all the files in /boot/grub) and create a new directory:


sudo mv /boot/grub /boot/grub_OLD


sudo mkdir /boot/grub

Likewise with /etc/default/grub except it's only a file so we need not "make" a new one, it'll be generated when we reinstall grub:


sudo mv /etc/default/grub /etc/default/grub_OLD

Next we get real dirty and remove /etc/grub.d and all of it's contents, we don't bother with a backup because we'd have to change the executable bit in each of it's files (NOTE: the capital R is intentional):


sudo rm -R /etc/grub.d

Now we're ready to remove/purge packages. The first few commands may return a message like "not installed, so not removed", that's OK. You'll need to confirm removal of most packages by typing "y". (NOTE: It's also safe to reinstall 'grub-customizer', 'startupmanager', and 'ubuntu-tweak' after you know that grub 2 is restored and booting properly. But it is NOT safe to reinstall the package 'grub'!) When you "purge grub-pc" you'll be asked if you're sure you want to remove all grub files so you'll have to confirm that by using the Tab key to select Yes. Each command must be run separately:


sudo apt-get remove startupmanager


sudo apt-get remove grub-customizer


sudo apt-get remove ubuntu-tweak


sudo apt-get purge grub


sudo apt-get purge grub-pc


sudo apt-get purge grub-common

Reinstalling grub 2 will hopefully require only one command:


sudo apt-get install grub-pc

This will produce a number of debconf windows like when we purged 'grub-pc'. When you see the window asking where to install grub you must know where! Generally you'll install grub to the MBR of whichever drive is set as the boot drive in your BIOS. Selection is made using the space bar, up & down arrows, and the Tab key.

Now we need to perform a couple of "sanity-checks" before rebooting. Run the command:


ls /etc/grub.d

You should see this:


00_header 10_linux 30_os-prober 41_custom
05_debian_theme 20_linux_xen 40_custom README

Also run:


ls /etc/default

And look for "grub" as highlighted here:


acpid cacerts grub~ kerneloops saned
acpi-support console-setup grub_OLD locale speech-dispatcher
alsa cron grub.ucf-old ntpdate tmpfs
apport cups halt pulseaudio ufw
avahi-daemon dbus hddtemp rcS useradd
bootlogd devpts irqbalance rsync
brltty grub kdm.d rsyslog


If you're super cautious, or if you need to set any specific boot parameters, you can also run:


sudo dpkg-reconfigure grub-pc

Yeah more debconf windows. If all appears well then it's time to reboot :D

ninodoce
March 16th, 2011, 03:42 AM
So this is me writing this post from my windows 7, After a week or so of messing with it.


Actually, here's the full content of my 30_os-prober in case you want to open yours with gedit and try replacing the entire contents using copy-n-paste:

186141

You would then of course have to run "sudo update-grub".

What I'm going to try is trashing my entire "/etc/grub.d" including all it's content and making sure that reinstalling grub-pc replaces the missing folder and files. I know I've done it before on my own machine but I didn't make any notes about what exactly worked so give me a bit.

This is what fixed it right here, i have no idea if all the other things i did were really necesarry to the fix, but the correct 30_os which i originally knew was the solution was what i neeeded to get me back into windows 7.

Thank you guys very much for all of your help, ill deffinitly come back here next time i mess up my computer, which should be in the near future.

Fiannnallllllyyyyyaaaaaahhhhhhhhh!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

kansasnoob
March 16th, 2011, 07:06 PM
So this is me writing this post from my windows 7, After a week or so of messing with it.



This is what fixed it right here, i have no idea if all the other things i did were really necesarry to the fix, but the correct 30_os which i originally knew was the solution was what i neeeded to get me back into windows 7.

Thank you guys very much for all of your help, ill deffinitly come back here next time i mess up my computer, which should be in the near future.

Fiannnallllllyyyyyaaaaaahhhhhhhhh!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

We love a success story :D

ninodoce
March 18th, 2011, 04:45 AM
We love a success story :D

Thanks even though i didnt get to use your last method, which looks like u put a lot of work into, hopefully someonelse will stumble upon it and be able to use it.

Dutch70
March 18th, 2011, 08:23 AM
Thanks even though i didnt get to use your last method, which looks like u put a lot of work into, hopefully someone else will stumble upon it and be able to use it.

Nice work kansasnoob!

@ninodoce, that's very thoughtful of you. People will be more likely to find & use it, if it's marked "solved" with "Thread Tools" at the top of the page. This also prevents people from continuing to click on it to try and help.

Kind regards & welcome to UF