LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Grub : Lost my windows partition, can't find menu.lst in /boot/grub.Someone can help? (https://www.linuxquestions.org/questions/ubuntu-63/grub-lost-my-windows-partition-cant-find-menu-lst-in-boot-grub-someone-can-help-841685/)

lucid_dino 11-01-2010 09:21 AM

Grub : Lost my windows partition, can't find menu.lst in /boot/grub.Someone can help?
 
Hi everyone,
I got ubuntu 10.04 lucid lynx along with windows (dual boot) and using Grub.
On my computer, I have my C:/ (programs) and D:/ (data).
I've never used my D:/ before that day that I've lost my windows partition on my grub menu.
I usually use my D:/ with windows. The first time I used my D:/ to store data with linux, I lost my windows option in my grub menu. I'm not sure what I did wrong but I do want to restore my windows option in my grub menu.

After "fdisk -l",
/dev/sda1* 1 3188 7 HPFS/NTFS
/dev/sda2 3189 6642 f W95 Etendue (LBA)
/dev/sda3 6643 9729 83 Linux
/dev/sda5 3189 5070 7 HPFS/NTFS
/dev/sda6 6504 6642 82 Linux swap / Solaris
/dev/sda7 5070 6437 83 Linux
/dev/sda8 6437 6503 82 Linux swap / solaris

I checked in /boot/grub and there is no menu.lst to modify.
Someone knows how I can get back my windows option in my grub menu ?

Thanks a lot !!

hughetorrance 11-01-2010 09:39 AM

1/ you need to mention what GRUB you are using,is it legacy or GRUB2. I expect its GRUB2 so its not the /boot/grub/menu.lst you modify to add your windows partition its the /boot/grub/grub.conf
2/ you dont need two swap files,so you can remove one of them,the one not in use.

3/ more on GRUB http://www.google.co.uk/#sclient=psy...eafc35fdbce132

TobiSGD 11-01-2010 09:57 AM

Quote:

Originally Posted by hughetorrance (Post 4145814)
1/ you need to mention what GRUB you are using,is it legacy or GRUB2. I expect its GRUB2 so its not the /boot/grub/menu.lst you modify to add your windows partition its the /boot/grub/grub.conf

Please don't edit the grub.conf file, your changes will be overwritten the next time your kernel, one of the drivers or Grub is updated.

It is a known issue (at least for me) that Grub2 sometimes "looses/misses" an OS at install time or when an update makes it necessary to update your grub.conf. This can most of the times be solved by a simple
Code:

sudo update-grub
in terminal. Sometimes the command has to be repeated until Grub finds every OS on your system.

lucid_dino 11-01-2010 10:01 AM

Thanks hughetorrance for your quick reply,

I got grub2 (Gnu grub 1.98-ubuntu 7), so I have grub2.
Here is my output of 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 $prefix/grubenv ]; then
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
}
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
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
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
set locale_dir=($root)/boot/grub/locale
set lang=fr.UTF-8
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.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=9bce6d7d-6e58-4398-b7be-ccf0ed0451ac ro quiet splash
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
echo 'Loading Linux 2.6.32-25-generic ...'
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=9bce6d7d-6e58-4398-b7be-ccf0ed0451ac ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=9bce6d7d-6e58-4398-b7be-ccf0ed0451ac ro quiet splash
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
echo 'Loading Linux 2.6.32-24-generic ...'
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=9bce6d7d-6e58-4398-b7be-ccf0ed0451ac ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-24-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set 9bce6d7d-6e58-4398-b7be-ccf0ed0451ac
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, kernel 2.6.20-16-generic (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d9eb7995-d340-42fe-aca3-c7194a04059e
linux /boot/vmlinuz-2.6.20-16-generic root=UUID=d9eb7995-d340-42fe-aca3-c7194a04059e ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
}
menuentry "Ubuntu, kernel 2.6.20-16-generic (recovery mode) (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d9eb7995-d340-42fe-aca3-c7194a04059e
linux /boot/vmlinuz-2.6.20-16-generic root=UUID=d9eb7995-d340-42fe-aca3-c7194a04059e ro single
initrd /boot/initrd.img-2.6.20-16-generic
}
menuentry "Ubuntu, kernel 2.6.20-15-generic (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d9eb7995-d340-42fe-aca3-c7194a04059e
linux /boot/vmlinuz-2.6.20-15-generic root=UUID=d9eb7995-d340-42fe-aca3-c7194a04059e ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
}
menuentry "Ubuntu, kernel 2.6.20-15-generic (recovery mode) (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d9eb7995-d340-42fe-aca3-c7194a04059e
linux /boot/vmlinuz-2.6.20-15-generic root=UUID=d9eb7995-d340-42fe-aca3-c7194a04059e ro single
initrd /boot/initrd.img-2.6.20-15-generic
}
menuentry "Ubuntu, memtest86+ (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d9eb7995-d340-42fe-aca3-c7194a04059e
linux /boot/memtest86+.bin
}
### 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 ###


Do you know how to modify this file to gat back my windows option in my grub menu ?
Thanks again

lucid_dino 11-01-2010 10:03 AM

Thanks tobySGD,
I'll try this before!!

lucid_dino 11-01-2010 10:13 AM

I tried sudo update-grub a couple times, and got that output in my terminal(each time):
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-25-generic
Found initrd image: /boot/initrd.img-2.6.32-25-generic
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 7.04 (7.04) on /dev/sda3
done

And I still don't have my windows option in grub.
Someone has another suggestion ?

yancek 11-01-2010 12:09 PM

In your initial post, you indicate you are using Ubuntu 10.04.
In your last post, the output from sudo update-grub shows

Quote:

Found Ubuntu 7.04 (7.04) on /dev/sda3
so you have Ubuntu 7.04 on sda3. Where is Ubuntu 10.04? Did you run the update command from sda3? Ubuntu 7.04? Your grub.cfg file shows Ubuntu 10.04 on (hd0,7), sda7. Your grub.cfg file also shows 4 different kernels.

If you have 7.04 and 10.04 installed, boot 10.04 and run the command. If that fails, you may have to re-install grub. I haven't used Grub2 but you could check this tutorial for detailed information:

http://www.dedoimedo.com/computers/grub-2.html

tommcd 11-01-2010 12:36 PM

If you do still have Ubuntu 7.04 installed, get rid of it. Ubuntu 7.04 reached end of life ages ago, and it is no longer getting updates.

lucid_dino 11-01-2010 01:09 PM

I run linux with 10.04.

What is the best way to get rid of 7.04 without injuring linux 10.04 ?

I'm still lokking to retrieve my windows partition, ..if someone knows how

Thanks,

tommcd 11-01-2010 01:51 PM

Quote:

Originally Posted by lucid_dino (Post 4146011)
What is the best way to get rid of 7.04 without injuring linux 10.04 ?

You could simply delete the partition using GParted. Then use GParted to grow one of the contiguous partitions into the unallocated space. Or install another distro to the partition used by 7.04. Or reformat that partition and use it to store data. The choice is yours.
Quote:

Originally Posted by lucid_dino (Post 4146011)
I'm still lokking to retrieve my windows partition, ..if someone knows how

You can create a custom boot file for booting Windows in the /etc/grub.d/ directory. For reference, here is my custom boot file for booting WindowsXP using grub2 from Lubuntu 10.10:
Code:

echo "Adding WindowsXP on /dev/sda1" >&2
cat << EOF
menuentry "WindowsXP on /dev/sda1" {
        set root=(hd0,1)
        chainloader +1
}
EOF

I named the file 33_WindowsXP so it would show up after 31_Slackware and 32_Salix.
Be sure to make the file executable, then run:
Code:

sudo update-grub
in order to update your boot/grub/grub.cfg file.
See this for the details:
https://help.ubuntu.com/community/Grub2
And specifically for custom boot entries:
https://help.ubuntu.com/community/Gr...Menu%20Entries

NOTE: The first part of the file:
Code:

echo "Adding WindowsXP on /dev/sda1" >&2
cat << EOF

is not really necessary. It just provides some visual feedback about what grub2 is doing. I got that from another tutorial that seems to have vanished from: https://wiki.ubuntu.com/
What version of Windows are you using???


All times are GMT -5. The time now is 06:24 AM.