Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I wanted to move from Windows XP to Linux for something new to learn and explore, but keep Windows so that I could still play games without the hassle.
I installed windows and then Ubuntu 7.04 on the same 80GB disk: 50GB for Windows, 15GB for Ubuntu, 3GB swap and 12GB FAT32. It's my second hard disk (of 3).
When I start my computer the Grub menu comes up offering Ubuntu and Windows, and I can load Ubuntu - I had to change /boot/grub/menu.lst
But, when I try to load Windows Grub tells me that it is loading Stage 2, but nothing happens. I can restart with ctrl, alt, delete, but that's it. Windows XP's entry in menu.lst is:
title Microsoft Windows XP Professional
root (hd0,1)
savedefault
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
Any help anyone can give me would be greatly appreciated. Thanks
I'm not 100% clear on the menu.lst syntax, but shouldn't there only be one map(hdx,n) entry for the Windows partition?
I have a dual-boot setup at home, except Linux and Windows are installed on different drives, but I remember there being a map() entry for the Windows image - I edit it enough times resetting my console resolution everytime Debian updates my kernel.
I'll post my Windows boot entry when I get home from work (~ T minus 7 hours). I hope you can wait that long; that is, unless, someone else knows for sure the proper syntax for a Windows boot entry.
I noticed that root is the same on both GRUB entries? Does that make any difference (sorry I'm no GRUB expert; Just trying to help)
I jumped a little the first time I saw that in my /boot/grub/menu.lst, but because there's that map() entry, it should be fine; it's like a last-minute modification to the root() value.
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
I tried adding "makeactive" but it didn't do anything. Getting rid of either of the two "map" entries just returns me to the GRUB o/s selection menu when I try to boot.
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Microsoft Windows XP Professional
root (hd0,1)
savedefault
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
menu.lst tells me that XP is on sdb1, which I thought translated into (hd1,0) because the counting starts at zero, but if I change the line to anything but (hd0,1) it doesn't work.
I'm sure the root entry for Windows is incorrect. It should point to the partition where you have your Windows installation.
If Ubuntu boots OK, then your hard disk is hd0, so you don't need to change that I belive.
Quote:
I installed windows and then Ubuntu 7.04 on the same 80GB disk: 50GB for Windows, 15GB for Ubuntu, 3GB swap and 12GB FAT32.
Is this the actual order of the partitions? If it is, then Windows is (hd0,0), Ubuntu is (hd0,1), the swap is (hd0,2) and the FAT one is (hd0,3). So you might want to try changing to "root (hd0,0)". And yes, you should use the makeactive command before chainloader.
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
makeactive
chainloader +1
and Windows now boots, thanks!
However... when I restart my computer it boots Windows without showing the GRUB menu and if I want to see it I have to use systemcd to use GParted to change the "boot" drive to Linux. Any ideas?
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# 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 change this entry to 'saved' 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 10
## 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=6e3224e5-7a5b-47b0-83ee-30e8d157ede0 ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,1)
## 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
## 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
title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=6e3224e5-7a5b-47b0-83ee-30e8d157ede0 ro single
initrd /boot/initrd.img-2.6.20-15-generic
title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
makeactive
chainloader +1
I think you life would be easier with windows on sda and linux on sdb.
About the "Cannot open /dev/sda" try running fdisk as root, and throw in the c for sdc as well if you like:
fdisk -l /dev/sd[abc]
Hardly a reason to reinstall everything. This is how my boot flags (*) are set with windows on hda1 and linux / on hdb1:
Code:
fdisk -l /dev/hd[ab]
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf9fbf9fb
Device Boot Start End Blocks Id System
/dev/hda1 * 1 4865 39078081 7 HPFS/NTFS
/dev/hda2 4866 9728 39062047+ b W95 FAT32
/dev/hda3 9729 24321 117218272+ 5 Extended
/dev/hda5 9729 24321 117218241 83 Linux
Disk /dev/hdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x474c6a31
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 1459 11719386 83 Linux
/dev/hdb2 1460 14593 105498855 5 Extended
/dev/hdb5 1460 1581 979933+ 82 Linux swap / Solaris
/dev/hdb6 1582 7052 43945776 83 Linux
/dev/hdb7 7053 14593 60573051 83 Linux
You can easily toggle the boot flag in cfdisk if you have it:
Code:
sudo cfdisk /dev/sda
and the same for sdb.
If your BIOS allows it, you could just change the boot order in the BIOS to boot sdb first, and install grub to sdb's MBR, but I would just swap cables sda<->sdb and change drive letters in menu.lst and /etc/fstab.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.