LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lint 16 installed in freespace same drive as Win XP but no option to boot to XP (https://www.linuxquestions.org/questions/linux-newbie-8/lint-16-installed-in-freespace-same-drive-as-win-xp-but-no-option-to-boot-to-xp-4175503610/)

FarmerJohn 05-01-2014 01:47 PM

Lint 16 installed in freespace same drive as Win XP but no option to boot to XP
 
Pure Newbeee here, I installed Mint 16 on my XP system on same drive 80GB with Win XP allocated 40GB and other 40GB as freespace installed mint in freespace (do something else) which ended with:
/boot 800MB /dev/sda5
/ 10GB /dev/sda6
/home 27GB /dev/sda7
swap 2GB /dev/sda8
device for bootloader installation was left at /dev/sda

Problem is system will only boot to Linux, never get the option to select XP.
I checked the system file /boot/grub but there is no menu.lst file

I don't know where to go from here, any help appreciated

yancek 05-01-2014 01:57 PM

The partition information you posted only shows Linux. Boot Mint and open a terminal by simultaneously holding down the Ctrl+Alt+t keys and type: sudo fdisk -l(Lower Case Letter L in the command) to show your partition information and you can post it here. There should be at least one ntfs partition.

Did you use the 'Something Else' option on Installation Type page? If you left the default for bootloader installation and cana boot Mint, you may just need an entry for xp in the cfg file.

Quote:

I checked the system file /boot/grub but there is no menu.lst file
Correct. There is none and none is expected to be there as Mint uses Grub2 which has a different menu configuration file located at:
/boot/grub/grub.cfg.

Simplest thing to do is to open a terminal and run: sudo update-grub. Watch the output to see if it detects xp. If you don't get results, run: sudo os-prober and then sudo update-grub.

FarmerJohn 05-01-2014 02:50 PM

yancek, thanks for quik response. I performed commands as you suggested, following is results:
Disk /dev/sda: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b2c0

Device Boot Start End Blocks Id System
/dev/sda1 * 63 82317059 41158498+ 7 HPFS/NTFS/exFAT
/dev/sda2 82317310 160086015 38884353 5 Extended
/dev/sda5 82317312 83879935 781312 83 Linux
/dev/sda6 83881984 103411711 9764864 83 Linux
/dev/sda7 103413760 156162047 26374144 83 Linux
/dev/sda8 156164096 160086015 1960960 82 Linux swap / Solaris

Disk /dev/sdb: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5f300384

Device Boot Start End Blocks Id System
/dev/sdb1 63 160071659 80035798+ 7 HPFS/NTFS/exFAT

second suggestion gave the following:
skip@skip-desktop ~ $ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic
Found memtest86+ image: /memtest86+.bin
No volume groups found
done
skip@skip-desktop ~ $ sudo os-prober
No volume groups found
skip@skip-desktop ~ $

Still in trouble

DJ Shaji 05-01-2014 04:16 PM

Add the following to /boot/grub2/grub.cfg

Code:

menuentry 'Windows XP' {
    set root='hd0,msdos1'
    chainloader +1
}

You will need to be root to do this. Prefix your command by "sudo"
Code:

sudo gedit /boot/grub2/grub.cfg

FarmerJohn 05-01-2014 04:48 PM

D J, thanks for reply, first I don't have a /boot /grub2 "folder" , only /grub. It does have grub.cfg
I tried entering your code as follows,
### 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 'Windows XP' {
set root='hd0,msdos1'
chainloader +1
}
### END /etc/grub.d/40_custom ###

however system still boots directly to linux, it seems linux install may have installed /grub, not /grub2
any way to change it, or should entry be at some other point in the grub.cfg file?

such as below

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

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
Thanks JH

DJ Shaji 05-01-2014 06:25 PM

Towards the beginning of the file there woulf be a "timeout" entry. Set it to something greater than one. If there isn't, add
Code:

timeout=10
to the file.

yancek 05-01-2014 08:55 PM

Quote:

I don't have a /boot /grub2 "folder" , only /grub. It does have grub.cfg
If you have a grub.cfg file, you are using Grub2. I have seen systems with a /boot/grub directory which can be either Grub Legacy or Grub2. I have seen systems which just have a /boot/grub2 and systems which have both /boot/grub and /boot/grub2. You found the file and made the edit but did you run: sudo update-grub after? It won't show in the grub.cfg file until after you do that. If you had put the entry in the grub.cfg and NOT run update-grub, it should have shown in the menu.

It isn't really clear if you are seeing xp in the menu and it doesn't boot or if you do not see xp at all, can you clarify? If you don't see a menu, then the timeout change would help. If it still doesn't boot, put the two lines below in the menuentry suggested above, above the set root line.


Code:

insmod part_msdos
insmod ntfs


FarmerJohn 05-01-2014 09:04 PM

D J, thanks again, the timout was set to timeout=1, I changed it to timeout=10 saved and rebooted.
Again system booted directly to linux.
Maybe I should try replacing grub with grub2 ???
JH

cwizardone 05-01-2014 09:43 PM

How many primary partitions can one have on a hard drive?

DJ Shaji 05-06-2014 03:13 PM

Make a new file in the directory /etc/grub.d with the name "50_win_xp" and make it executable by running "chmod +x" on it. Put the following in it:

Code:

#!/bin/sh -e
cat << EOF
menuentry "Windows XP" {
    set root=(hd0,1)
    chainloader (hd0,1) +1
}
EOF

Update grub by running "update-grub". That should do the trick!

Refer here for more info: http://www.dedoimedo.com/computers/g...mozTocId293325

DJ Shaji 05-06-2014 03:21 PM

DJ Shaji likes this
 
Quote:

Originally Posted by cwizardone (Post 5163024)
How many primary partitions can one have on a hard drive?

As many as you want, buddy! Just kidding. The answer's four.

cwizardone 05-06-2014 03:45 PM

Quote:

Originally Posted by DJ Shaji (Post 5165891)
As many as you want, buddy! Just kidding. The answer's four.

And, swap is counted as a primary partition, so the OP has 5 primary partitions on that drive. Could that be the problem?

yancek 05-06-2014 05:05 PM

Quote:

And, swap is counted as a primary partition, so the OP has 5 primary partitions on that drive.
Actually he has two. sda1 is his windows partition, sda2 is a primary used as an Extended. In Linux, logical partitions are numbered beginning with 5 so sda8, the swap is a logical partition also.

DJ Shaji 05-06-2014 05:08 PM

the first is a primary partition. the second one's extended, and the rest are all logical. more than four can't be created due to restrictions, but maybe they can. See here for more: http://www.linuxquestions.org/questi...tition-898740/

cwizardone 05-06-2014 09:20 PM

1, 5, 6, 7, and 8 are all primary partitions.


All times are GMT -5. The time now is 04:54 PM.