Can't boot XP and can't find menu.lst

Asked by HKhalid

I have a single hdd partitioned for dual boot. I firstly install XP Pro before resizing it to install Ubuntu 9. The dual boot works beautifully until last night where it suddenly won't boot my XP. Gone through the answers in Launchpad and tried to look for the menu.lst to try out the available solution but can't find the file.

Please advise.

Regards,

Dan

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ian Ace (iaculallad) said :
#1

What Ubuntu version are you currently using? 9.04 or 9.10? By default, 9.04 uses GRUB which uses the menu.lst configuration file while 9.10 uses GRUB2 be default and it uses the /boot/grub/grub.cfg file replacing the /boot/grub/menu.lst which is used by previous version of Ubuntu.

Revision history for this message
Tom (tom6) said :
#2

Hi :)

Please can you get to a command-line and give us the results of this

sudo fdisk -l

where " -l" is a lower=-case " -L" and sudo will ask for your normal user password, not your SuperUser one and wont give you any stars as you type.

Note that the .04 = April release and the .10 = October release so you might be able to easily figure out which version you have installed. I think it has been about a decade since linux boot-loader got re-written previously but this one is modular so it wont ever need a complete re-write and yet can upgrade easily. The one before Grub was called "Lilo" which is still hugely better than even the latest Windows boot-loaders. Grub2 should last a fair while now :)

Good luck and regards from
Tom :)

Revision history for this message
HKhalid (hamdan-khalid) said :
#3

Hi Ian & Tom,

I hope these information can help:

1.

primo@primo-desktop:~$ sudo fdisk -l
[sudo] password for primo:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4c188d3b

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 5905 47431881 7 HPFS/NTFS
/dev/sda2 5906 7659 14089005 7 HPFS/NTFS
/dev/sda3 7660 9729 16627275 5 Extended
/dev/sda5 7660 8512 6851691 83 Linux
/dev/sda6 9639 9729 730926 82 Linux swap / Solaris
/dev/sda7 8513 9584 8610808+ 83 Linux
/dev/sda8 9585 9638 433723+ 82 Linux swap / Solaris

Partition table entries are not in disk order
primo@primo-desktop:~$ ^C
primo@primo-desktop:~$

2. grub.cfg

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

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
  have_grubenv=true
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  saved_entry=${prev_saved_entry}
  save_env saved_entry
  prev_saved_entry=
  save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 420f85b3-bb03-446d-8f0d-4af9daf19010
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-19-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 set quiet=1
 insmod ext2
 set root=(hd0,7)
 search --no-floppy --fs-uuid --set 420f85b3-bb03-446d-8f0d-4af9daf19010
 linux /boot/vmlinuz-2.6.31-19-generic root=UUID=420f85b3-bb03-446d-8f0d-4af9daf19010 ro quiet splash
 initrd /boot/initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 insmod ext2
 set root=(hd0,7)
 search --no-floppy --fs-uuid --set 420f85b3-bb03-446d-8f0d-4af9daf19010
 linux /boot/vmlinuz-2.6.31-19-generic root=UUID=420f85b3-bb03-446d-8f0d-4af9daf19010 ro single
 initrd /boot/initrd.img-2.6.31-19-generic
}
### 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 NT/2000/XP (loader) (on /dev/sda1)" {
 insmod ntfs
 set root=(hd0,1)
 search --no-floppy --fs-uuid --set 60346d74346d4e5a
 drivemap -s (hd0) ${root}
 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 ###

Thank you!

Regards,

Dan

Revision history for this message
Tom (tom6) said :
#4

Hi :)

Wow! That new .cfg file makes no sense to me & it looks as tho you can't edit in entries to appear higher than Ubuntu in the menu :( I realise that is "not a problem" because you can set the default boot to any line but it does make it awkward for me & some of my clients. Clearly i really am going to have to sit down sometimes soon and figure out how the .cfg really works :( lol

Ian, some good news and some weird news. Good news 1st. Your ntfs partition(s) are still there so they haven't been accidentally deleted somehow. This means your Xp 'should' still be there. The 'weird' news is that you appear to have 2 installs of gnu&linux.

Often people do this to have a small distro alongside Ubuntu for gaming or testing out different versions of linux while still being confident about having a system that works with no hassle. Also it can be a good plan to have a 2nd install of Ubuntu to check a release upgrade works on your machine before committing to it or for testing out different packages/DEs/WMs/graphics-drivers. I haven't checked the partition sizes yet but do you remember installing 2 versions of gnu&linux with 1 of them being your main install of Ubuntu?

There are 3 different paths i would like to follow with this but both might be irrelevant if Ian can figure out the .cfg.
1. I would like you to have a quick go at trying to remember if you saved any web-pages or things with other long path+filenames to the Windows partition.
2. Use gparted or fsck to check the integrity of the ntfs partitions making sure the "ntfs-3g" & "ntfsprogs" are both installed first.
3. Check that you are booting into the 'right' install of Ubuntu and haven't accidentally been booting into the other one for some reason.
Probably 3 is the easiest one least likely to cause additional problems if something goes wrong with trying it out.

Please let me know your thoughts about this & which way you want to proceed first. As i said, hopefully Ian (or someone) might figure out the .cfg and fix this easily first

Good luck and regards from
Tom :)

Revision history for this message
Ian Ace (iaculallad) said :
#5

The file /boot/grub/grub.cfg is not to be edited actually, not even by root as this file is only updated if there is a kernel upgrade or when the system sensed that the update-grub command was executed. The actual configuration files where users can change and add settings can be found at the /etc/default/grub file and the /etc/grub.d/ folder.

GRUB2 still presents an enigmatic way of configuring the boot menu.

Revision history for this message
Tom (tom6) said :
#6

Hi :)

Oops, the line where is said "Ian, some good news ..." should have been "HKhalid , some good news ...". Sorry about that confusion. I still haven't had my first cup of tea this morning!

Good luck and regards from
Tom :)

Revision history for this message
HKhalid (hamdan-khalid) said :
#7

Hi Guys! Good morning! It's a hot Friday afternoon where I am..... feeling kind of lazy.

Btw, yes! I have 2 Ubuntu installed. Not on purposed but sheer stupidity. I installed the first one using Ubuntu files that I got from the net without burning the ISO image. So, I installed a second one from a CD I burned off the ISO image. I realised then that I got 2 Ubuntus but it seemed to work just find until recently. Maybe later you can advise me how to get rid off the 1st one.

On Tom's Q1: Yes, I believe I must have saved some files with very long name but I do not remember that the path being too deep.

On Q2: I have gparted but it runs under XP. Can't open XP, so no gparted. Anyway, my Ubuntu says that my hdd may be failing. It indicated that my hdd has many bad sectors. It gives report that I have problems at "Reallocated Sector Count" and "Current Pending Sector Count". Anyway, the hdd is at least 8 years old.

As for Q3: I've been booting from the right Ubuntu. Never tried the 'safe mode". Should I try that?

Please keep in mind that the last time I did any programming was back 1982. Yessir! That was in the last century and it was the antique Fortran 77. So, please bear with me.

Regards,

Dan

Revision history for this message
Tom (tom6) said :
#8

Hi HKhalid :)

Yup, that all sounds normal. Obviously it's time to buy or acquire a 'new' hard-drive as this one is probably getting a bit wobbly.

In my country the 'sweet spot' is a decent 1Tb drive at about £80. By 'sweet spot' i mean that half the size does not cost half as much. A 500Gb drive would cost £50-65 for about the same quality.

When i was using my old mbord i bought a sata hard-drive plus an adapter so i could plug it into the old ide slots my old mbord hard. The hard-drive is now working fine on my newer mbord but the adapter is now in my older 2nd machine with an 'oldish' dvd-player i found somewhere.

It almost definitely sounds as though you need to back-up your data before going much further with any of this. Hopefully you can read the Windows data from the Ubuntu side of things? Have you found Xp's "My Documents" through Ubuntu's "Places" menu?

Q1
If possible just rename anything with a long filename that is on the Windows side of things. If Windows has a "pathname+filename" string that is too long then it wont be able to bootup on that partition. This is usually only a problem when saving web-pages onto the Windows side from linux. Web-pages love to have long meaningless names which Windows usually truncates. Bypassing by using linux can create a problem.

Q2
Please run a LiveCd session of Ubuntu (or other linux OS, i could suggest a few suitable ones that have gparted built in to their LiveCd. Ubuntu has gparted on the LiveCd but not the standard install which is not as dumb as i first thought when i first found out)
https://help.ubuntu.com/community/LiveCD
If you can get a LiveCd sesion working then we can help you check the various partitions and mark all the bad-blocks and generally tidy things up.

Q3
Has become irrelevant as you clearly know what you are doing now. Presumably by "safe mode" you mean the boot menu item that has "recovery mode" at the end of it's line? If so then this takes us back into Q2. It might be worth booting into "recovery mode" to do the fsck checks from there to avoid the need for using gparted at all. I think it will only check the ubuntu partition but that is a good start and then we might be able to help do an fsck check of the Windows partition from inside Ubuntu later. The "recovery mode" goes to a disturbingly blue screen (remember bsods?) but it does have a useful menu instead. Most of these options are worth running through every couple of months except the "fix x-server" which puts all your graphics eye-candy and stuff back to defaults, which i find quite painful sometimes. The top option in that menu is "Resume normal boot" which is really handy for me.

Yes we can help you remove the extra Ubuntu but it would be nice to make the system a bit more stable first and hopefully recover the ability to bot into Windows. Nowadays i feel edgy if i haven't got 2 systems i can boot into and work from comfortably. Also you could consider using the spare partitions you have set up for experimentation as i suggested? There's no urgency on dealing with this problem right now anyway, that's the main thing :)

It's not quite so hot here but the snow and ice has melted so it feels unusually warm right now. The health&safety inspectors along with fire-safety people are due in any moment now (been edgy about them for 2 or 3 hours now). These "surprise" inspections are really dumb.

Good luck and regards from
Tom :)

Revision history for this message
HKhalid (hamdan-khalid) said :
#9

Hi Tom,

Thanks for the reply. I will definitely work on your advise. I'll try to get back to you some time this week. By the way, locally here 1TB hdd should cost about RM280 which is approximately £45 off the shelf. But I don't think my P3 1Ghz motherboard can handle it.

Regards,

Dan

Revision history for this message
Tom (tom6) said :
#10

Hi :)

Previously when there have been limits like that it has allowed you to use the drive but only access the first small part of the drive. Meaning the drive could then continue to be used as other parts of the machine got upgraded. This approach avoids the need for a single vast expense and allows a system to gradually improve and reduces the amount of expensive equipment that has to be discarded.

Also it might be that you are restricted from having a 1Tb partition but might be able to have say four 250Gb ones instead. I am not certain about this tho. Also i think it would be better to have 1 large partition for data at the end of a drive with a smaller partition at the front for the main OS.

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#11

Hi :)

Have you been able to test the new Ubuntu 10.04 before it gets officially released?
http://www.ubuntulinux.org/testing/lucid/beta1
Trying it as a LiveCd or as an extra dual/multi-boot would be ideal. Developers and everyone are keen to try to iron out any problems before 10.04 gets officially released so you might find faster & more effective answers to your bug reports which would make 10.04 work better on your system for you

Thanks and regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask HKhalid for more information if necessary.

To post a message you must log in.