Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I have two hard drives. The primary has 4 liunx partitions (3 ext3, 1 swap), the secondary has 1 ntfs. Here is my layout:
Code:
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 3188 25607578+ 83 Linux
/dev/hda2 3189 3310 979965 82 Linux swap / Solaris
/dev/hda3 3311 6349 24410767+ 83 Linux
/dev/hda4 6350 24321 144360090 83 Linux
Disk /dev/hdb: 8455 MB, 8455200768 bytes
255 heads, 63 sectors/track, 1027 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 1026 8241313+ 7 HPFS/NTFS
I try to add my windows xp to my grub but it wont take. When i run update-grub it resets me menu.lst file and removes my windows stuff i put in.
I am not totally dumb to this, I know my way around, and I can still boot into windows on boot by pressing "C" at grub to get the grub command line. I then type this stuff in:
And then my windows XP boots up like normal. But when I add this crap to my menu.lst file and run update-grub, the stuff gets erased and it never hits my grub list on boot.
Here is my menu.lst file of what it wants to be:
Code:
###############################################################
# 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'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5
# 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 specifiv 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=root=/dev/hda3 ro vga=792
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)
## 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
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) 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
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,2)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda3 ro vga=792
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot
title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda3 ro vga=792 single
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
###############################################################
Now I add my windows stuff before my very last line like so:
Code:
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,2)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda3 ro vga=792
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot
title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda3 ro vga=792 single
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot
title Windows XP
rootnoverify (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
makeactive
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
Then When I run update-grub... it goes back to the normal menu.lst like i never changed it...
I am so lost... I'd like to be able to boot into windows without having to type in the commands everytime.. Anyone know whats wrong??
Did you try just adding the entry to the file and not running update-grub? From this, it looks like it just generates the file with entries according to what images are in your /boot.
I'll try this tonight - I was told to always run update-grub after I edit the menu.lst file...
From your link, Nylex:
"After update-grub has been run for the first time, the user is required to edit the generated menu.lst. The user must set the two options update-grub uses. Then re-run the update-grub script to update the menu.lst file using the default's that have been set."
And this is what I was taught also. You make your edits to the menu.lst file, then you have to pass the changes to the kernel by running update-grub.
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728
Rep:
Quote:
And this is what I was taught also. You make your edits to the menu.lst file, then you have to pass the changes to the kernel by running update-grub.
I saw no line tell that you have to pass the changes to the kernel.
The options you add in the menu.lst file will be given to the kernel while grub load your linux.
Kernel take these options and boot up the way you want.
update-grub is used to make the initial menu.lst file.
It will find your kernel and creat an entry for that kernel.
I do nothing but edit your menu.lst file.
So if you have manually editted your menu.lst file, there were no need to run it.
In FC4, I don't have the command but grub still work properly.
I think you have know so much about grub.
And that make you confuse.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.