LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   xp mising (https://www.linuxquestions.org/questions/linux-newbie-8/xp-mising-744301/)

greatgk 08-01-2009 02:51 AM

xp mising
 
had xp before installig ubuntu..but i cant boot from it coz at the time machine boots it doesnt show me option...here from terminal i see this..post it because may b u understand what is in my pc
amit@amit-desktop:~$ sudo fdisk -lu

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x4e574e56

Device Boot Start End Blocks Id System
/dev/sda1 * 63 2040254 1020096 82 Linux swap / Solaris
/dev/sda2 2040255 25398764 11679255 7 HPFS/NTFS
/dev/sda3 25398765 488375999 231488617+ f W95 Ext'd (LBA)
/dev/sda5 25398828 51199154 12900163+ 7 HPFS/NTFS
/dev/sda6 51199218 108535139 28667961 7 HPFS/NTFS
/dev/sda7 133114653 255995774 61440561 7 HPFS/NTFS
/dev/sda8 255995838 378876959 61440561 7 HPFS/NTFS
/dev/sda9 378877023 488375999 54749488+ 7 HPFS/NTFS
/dev/sda10 108535203 133114589 12289693+ 83 Linux

Partition table entries are not in disk order
amit@amit-desktop:~$ cat /boot/grub/menu.lst
# menu.lst - See: grub(, info grub, update-grub(
# grub-install(, grub-floppy(,
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=5425c4b5-0906-4d41-b7cd-78b256346cb0 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=5425c4b5-0906-4d41-b7cd-78b256346cb0

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-14-generic
uuid 5425c4b5-0906-4d41-b7cd-78b256346cb0
kernel /boot/vmlinuz-2.6.28-14-generic root=UUID=5425c4b5-0906-4d41-b7cd-78b256346cb0 ro quiet splash
initrd /boot/initrd.img-2.6.28-14-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-14-generic (recovery mode)
uuid 5425c4b5-0906-4d41-b7cd-78b256346cb0
kernel /boot/vmlinuz-2.6.28-14-generic root=UUID=5425c4b5-0906-4d41-b7cd-78b256346cb0 ro single
initrd /boot/initrd.img-2.6.28-14-generic

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 5425c4b5-0906-4d41-b7cd-78b256346cb0
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=5425c4b5-0906-4d41-b7cd-78b256346cb0 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 5425c4b5-0906-4d41-b7cd-78b256346cb0
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=5425c4b5-0906-4d41-b7cd-78b256346cb0 ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid 5425c4b5-0906-4d41-b7cd-78b256346cb0
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

johnsfine 08-01-2009 06:14 AM

Quote:

Originally Posted by greatgk (Post 3627405)
/dev/sda2 2040255 25398764 11679255 7 HPFS/NTFS

That looks like the bootable Windows partition, and in grub notation I think that partition is (hd0,1)

I'm not certain, but I think the chunk of text you need to add to menu.lst for Windows would be:

title Windows XP
root (hd0,1)
makeactive
chainloader +1

Put that in with the other uncommented (no #) chunks near the end of the menu.lst file.

Hopefully, you know how to open your menu.lst file in a text editor as root (using sudo and some text editor) to insert those lines.

gregorian 08-01-2009 12:36 PM

After editing the file, does he not have to install the bootloader to the MBR?

sudo grub-install

P.S. I don't know why Ubuntu did not detect Windows. The Windows partition exists - that implying you didn't wipe out the entire disk and install Ubuntu.

johnsfine 08-01-2009 02:53 PM

Quote:

Originally Posted by gregorian (Post 3627808)
After editing the file, does he not have to install the bootloader to the MBR?

sudo grub-install

I don't think so.
/boot/grub/menu.lst is used by grub each time you boot. Edits to that file will be visible the next time you boot. They don't need any modification to any other installed parts of grub.

Quote:

P.S. I don't know why Ubuntu did not detect Windows. The Windows partition exists - that implying you didn't wipe out the entire disk and install Ubuntu.
With luck that is true.

Notice that sda1 was bootable and is now the swap partition. Notice there are several NTFS partitions. If the bootable Windows partition hasn't been destroyed then it was sda2 and the right change to menu.lst would give back the ability to boot it.

But if sda1 was the bootable Windows partition (the C: drive) and sda2 was D: (some data partition) then by the time grub was installed Windows was too badly trashed for grub to connect to it.

The OP might want to take a look within Linux at the contents of sda2 to see if they were originally his C: drive or his D: drive. My earlier post was the optimistic viewpoint: how to make grub boot Windows if you haven't already destroyed the C: partition.

gregorian 08-01-2009 09:04 PM

Quote:

Originally Posted by johnsfine (Post 3627916)
I don't think so.
/boot/grub/menu.lst is used by grub each time you boot. Edits to that file will be visible the next time you boot. They don't need any modification to any other installed parts of grub.

I'm not sure myself, but you're assuming that Grub runs right? If it's been overwritten by the Windows bootloader, how will the computer know that Linux exists in the first place? Even if you change menu.lst, won't the changes will be useful only if grub runs everytime the computer runs? I always assumed that using grub-install would replace the existing Windows bootloader on the MBR.
Quote:

Originally Posted by johnsfine (Post 3627916)
Notice there are several NTFS partitions. If the bootable Windows partition hasn't been destroyed..

If I remember correctly, the option during the Ubuntu install asks you if you want to remove all partitions and install Windows. But the partitions exist. Besides, won't overwriting the Windows partition with Linux change the filesystem to ext2 or some other filesystem? I don't know if Linux can install on NTFS but I'm sure that's not the default option and I wouldn't expect the OP to change that.

They're just my thoughts. I'm not certain.

colorpurple21859 08-01-2009 09:52 PM

edit your /boot/grub/menu.lst and add the following after the last ubuntu entry:

title windows
rootnoverify (hd0,1)
map (hd0,1) (hd0,0)
map (hd0,0) (hd0,1)
makeactive
chainloader +1

save and then reboot. you do not have to reinstall grub. it windows don't boot change (hd0,1) to (hd0,4) if it still dosen't boot try changing to 5,6,7,or 8. you can also highlight the window entry and edit the line at the boot prompt by pressing e for edit

gregorian 08-02-2009 09:03 PM

Quote:

Originally Posted by colorpurple21859 (Post 3628122)
save and then reboot. you do not have to reinstall grub.

Could you read my previous post? I don't understand why you needn't re-install grub.

colorpurple21859 08-02-2009 09:46 PM

if he's booting into his linux distro. you don't have to reinstall grub to boot windows, just have to add windows to his menu.lst if he was using lilo then yes he would have to rerun lilo, but you don't have to with grub.

colorpurple21859 08-02-2009 10:39 PM

edited my first post and added
map (hd0,1) (hd0,0)
map (hd0,0) (hd0,1)
to the menu.lst need this when xp is not in first partition
if this dosn't work there is a ggod chance xp is hosed may be able to use a partition recovery program off a recovery cd to get it back, otherwise looking at xp reinstall.

johnsfine 08-03-2009 07:37 AM

I wonder if the OP is still reading any of this.

Quote:

Originally Posted by colorpurple21859 (Post 3629034)
edited my first post and added
map (hd0,1) (hd0,0)
map (hd0,0) (hd0,1)
to the menu.lst need this when xp is not in first partition

Do you have any references (URL if possible) or direct experience supporting that idea.

The sequence of drives is passed from the BIOS into the boot process and can be passed modified by map commands by a chainloader operation. But the sequence of partitions on one drive is not passed that way, so that mapping should not be something that grub can pass to the NT loader.

Another idea:

I'm not sure how picky Windows is about the boot flag on its partition entry. Usually Windows is only booted from the partition with that boot flag. Linux doesn't care about that at all. There is no reason the boot flag should stay on sda1 (the Linux swap partition). There is some command in gparted (though I don't know what command) that would move the boot flag to sda2. Maybe that would make Windows willing to boot.

colorpurple21859 08-03-2009 12:40 PM

I got it from here
http://www.linuxquestions.org/linux/...ROUBLE_SHOOTER
and have also seen it on other website,s back when I was researching how to use grub. Since my windows has always been on the first partition don't know how valid the mapping is needed when windows is on a partition other then the first partition. as far as I know it may depend on the bios as to whether one needs it or not. It seems if I remember right i did have windows on a second partiton about a year ago and had to do the mapping, but not sure, I tend to forget things now a days

johnsfine 08-03-2009 12:55 PM

Thanks for the link. It looks very convincing.

It has been a long time since I last had Linux and Windows set up for dual boot. Neither was in the first partition and I did not need nor use any map command to get the chainload to Windows in the second partition to work.

But I don't know what was different then vs. now and/or what differences are important between the way my Windows system was set up and what the OP has. So I can't say for sure that what worked for me is still (or even was) correct.


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