LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to edit grub.conf? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-edit-grub-conf-296095/)

zeroz52 02-28-2005 10:29 PM

How to edit grub.conf?
 
Sorry for the stupid question. I have Ubuntu as my primary OS and need to edit the grub.conf to see xandros. With what do I edit it with. I tied opening it with Office, but it was read only. Please help. Thanks alot for any and all help.

:newbie:

homey 02-28-2005 10:56 PM

If it's read only, that probably means you tried it as a regular user.
To run things as the root user ( adminitrator ) you will need to know the password.
Type: su -
Enter the root password

As the root user, type: kwrite /boot/grub/grub.conf to edit the file.

Tuvok 02-28-2005 10:59 PM

Open terminal, login as root, and edit it with vi. Like this:

vi grub.conf

It might be easier to use gedit. Like this:

gedit grub.conf

Wim Sturkenboom 02-28-2005 11:06 PM

You need to have root privileges. Easiest is to open a root terminal in gnome. You will be prompted for your password.
If you're familiar with vi, emacs etc, you can now use those without the warning about readonly.
If you prefer an editor with a gui, type gedit filename (ignore the warning you get) or just gedit and browse to the file to edit.

BTW which version of Ubuntu are you using. I'm using Warty and don't have grub.conf, but menu.lst

zeroz52 02-28-2005 11:09 PM

Wim, you rock. And thanks to evryone else who replied. Wim, I have warty too, and have been having troubles finding a grub.conf that doesn't exist thanks all.

zeroz52 02-28-2005 11:14 PM

I can use this and seems to allow me to edit, but none of the suggestions you all had. ???

nano /boot/grub/menu.lst

But not sure what I need to edit to get my other distro to install.? Anyone.

root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-5-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-5-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-5-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-5-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8.1-5-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-3-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-3-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-3-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8.1-3-386
savedefault
boot

title Memory test
root (hd0,0)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

harken 03-01-2005 05:31 AM

Copy and paste one of the command sequences already existent, replacing "root(hd0,0)" with the appropriate HD/partition Xandros resides in. If, for example, Xandros is found on a 2nd HD, replace it with "root(hd1,0)". If, instead, is on the same hard-disk but on the 3rd partition, replace with "root(hd0,2)". These are only examples, finding the correct one is up to you.
Also, keep the lines
Quote:

kernel /boot/vmlinuz-2.6.8.1-5-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-5-386
but modify (if needed) the kernel version with the one Xandros have (like vmlinuz-2.6.7-386, don't know for sure). The rest (savedefault and boot) remains unaltered.

zeroz52 03-01-2005 07:56 AM

thanks a lot I will give that a try. If Xandros were to get update to a new kernel after I set it up do i need to reedit the kernel version? Just curious, cause I have 2 kernel versions of Ubuntu I can choose to boot into.

Thanks again

0pal_t0ad 03-01-2005 08:26 AM

you should boot into ubuntu, then mount your xandros partition to see what the kernel name is. or better yet, copy everything in the boot config for xandros(i'm guessing xandros is another linux distro).

harken 03-01-2005 08:30 AM

Don't know about Xandros. I can speak for Debian which, if you get a newer kernel version using their repositories, will automagically add the proper entry in menu.lst.
If, however, that doesn't work in Xandros or you compile your own kernel, there should be no big deal. Just add another command sequence like the previous ones, taking care to modify only the version number (if the new kernel will stay in its regular place such as /boot; otherwise change that too).

And one more thing: after getting a newer kernel (no matter how), keep the old one as well at least for a period of time to make sure everything is working fine with the new version. This way you can always boot safely with the old one to make the right adjustments.

zeroz52 03-01-2005 10:10 AM

Thanks for all of the replies, you all have been very helpful and it is appreciated. To mount the Xandros distro to see what kernel version it is do I type as root: mnt /dev/hda4 ? Xandros is on hda4. Do I need to issue another command after mounting it to get the kernel info? Thanks alot, I am a n00b to linux but have learned a lot in the last week thanks to everyone on this forum. you guys and gals are great. I no longer even have Windows XP on my computer. :D

0pal_t0ad 03-01-2005 11:03 AM

yeah. 'mkdir /mnt/xandros' and 'mount /dev/hda4 /mnt/xandros'

you can do without the mkdir part if you have a dir/folder to mount it to already.

zeroz52 03-01-2005 05:29 PM

sorry to bug you all once more. When i type: (after i did mkdir /mnt/xandros)

mount /dev/hda4 /mnt/xandros

I get this:

root@ubuntu:/home/boots # mount dev/hda4 /mount/xandros
mount: you must specify the filesystem type
root@ubuntu:/home/boots #

Anyone? What did i do wrong?

Thanks again
:newbie:

zeroz52 03-01-2005 05:30 PM

By the way i get this when trying again, so i must have mounted it correctly.

root@ubuntu:/home/boots # mkdir /mnt/xandros
mkdir: cannot create directory `/mnt/xandros': File exists
root@ubuntu:/home/boots #

rsmith 03-01-2005 06:00 PM

If it's stating that you need to specify a filesystem type you need to add the -t <filesystem used on the mount> I.E. -t ext2 or -t jfs etc. etc. Good luck.

zeroz52 03-01-2005 06:38 PM

oot@ubuntu:/home/boots # mount -t ext2 /dev/hda4 /mnt/xandros
mount: wrong fs type, bad option, bad superblock on /dev/hda4,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
root@ubuntu:/home/boots # mount -t jfs /dev/hda4 /mnt/xandros
mount: wrong fs type, bad option, bad superblock on /dev/hda4,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)

this is what I received. I did the first one then remembered that Xandros by defaul mounts reiserFS. ( I think that name is correct) Sorry noob. I'm guessing I need to replace the ext2 or jfs with one for the reiserFS. What would that be?

Thanks

zeroz52 03-01-2005 06:47 PM

and this

root@ubuntu:/home/boots # mount -t reiserfs /dev/hda4 /mnt/xandros
mount: wrong fs type, bad option, bad superblock on /dev/hda4,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)

homey 03-01-2005 06:54 PM

Run the command: fdisk -l /dev/hda and post the results back please.

zeroz52 03-01-2005 07:03 PM

woot, ok I'm in, it was hda5. hda4 is split into hda5 and hda6. Sorry, brain fart, noobb style. :}
Ok now that im in how can i find the kernel info? I'm soo close guys sorry for being a pain.

zeroz52 03-01-2005 07:06 PM

I found a file in the boot folder that contains a file : vmlinuz-2.6.9-x1.... but that doesn't look right.

zeroz52 03-01-2005 07:38 PM

Ok, it is Kernel 2.6.9-x1. I coppied what you guys told me to copy. And made the changes. But when i try to boot into Xandros it gives me an Error 15: says it cant "locate" /boot/initrd.img-269-x1. But it is there I'm looking at it with xandros mounted. What gives? What did I do wrong now? Thought I was there.

zeroz52 03-01-2005 07:54 PM

title Ubuntu, kernel 2.6.8.1-5-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-5-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-5-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-5-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-5-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8.1-5-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-3-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.8.1-3-386
savedefault
boot

title Ubuntu, kernel 2.6.8.1-3-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8.1-3-386
savedefault
boot

title Xandros, kernel 2.6.9-x1
root (hd0,4)
kernel /boot/vmlinuz-2.6.9-x1 root=/dev/hda5 ro quiet splash
initrd /boot/initrd.img-2.6.9-x1
savedefault
boot


title Memory test
root (hd0,0)
kernel /boot/memtest86+.bin

That is what I have in my menu.lst.
hda4 is split into hda5 ( xandros / ) and hda6 (xandros /home)

the image file is there and is named exactly that except it has a .gz extension. I'm obviously missing something, im an idiot i guess.

Can someone help me finish this off? please

homey 03-01-2005 08:04 PM

I just ran into this problem yesterday so you may be in luck. :)
While in Ubuntu, mount the xandros system and chroot into it. then run the command: rdev to see what it thinks you should call the xandros root.

Do these commands.
mkdir /mnt/test
mount /dev/hda5 /mnt/test
chroot /mnt/test
rdev
exit

Post the results of rdev and put that info in your grub.conf
kernel /boot/vmlinuz-2.6.9-x1 root= ###put output of rdev here ###


title Xandros, kernel 2.6.9-x1
root (hd0,4)
kernel /boot/vmlinuz-2.6.9-x1 root=??????????
initrd /boot/initrd.img-2.6.9-x1

zeroz52 03-01-2005 08:25 PM

This is what I get and entering it didn't work.

root@ubuntu:/home/boots # mkdir /mnt/test
mkdir: cannot create directory `/mnt/test': File exists
root@ubuntu:/home/boots # mount /dev/hda5 /mnt/test
root@ubuntu:/home/boots # chroot /mnt/test
ubuntu:/# rdev
0x0305 /
ubuntu:/#



:scratch: :cry:

Also, i ran fdisk and got this....

root@ubuntu:/home/boots # fdisk -l /dev/hda

Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 20318 10240240+ 83 Linux
/dev/hda2 20319 40635 10239768 83 Linux
/dev/hda3 40636 42667 1024128 83 Linux
/dev/hda4 42668 77545 17578512 f W95 Ext'd (LBA)
/dev/hda5 42668 58921 8191984+ 83 Linux
/dev/hda6 58922 77545 9386464+ 83 Linux
root@ubuntu:/home/boots #


maybe that will offer more info.

Thanks again everyone. I'm soo close i can smell it.

homey 03-01-2005 08:43 PM

Quote:

ubuntu:/# rdev
0x0305 /
That's exactly what I ran into yesterday! put the number into your menu.lst / grub.conf.....

Code:

title Xandros, kernel 2.6.9-x1
root (hd0,4)
        kernel /boot/vmlinuz-2.6.9-x1 root=0x0305 rw acpi=on
        initrd /boot/initrd-2.6.9-x1.gz

Edit: I just noticed that you didn't have gz at the end of the initrd

0pal_t0ad 03-02-2005 01:18 AM

depending on what filesystem xandros uses by default you'll need to type:
mount -t reiserfs /dev/hda4 /mnt/xandros

if that doesn't work try changing reiserfs to ext2,ext3 or....i cant think of any more worth mentioning, but only 'cos i don't use anything else.

zeroz52 03-02-2005 08:11 AM

So you do need the .gz extension then? Cause this is the part that seems to give me an error 15 when trying to boot into xandros:

initrd /boot/initrd-2.6.9-x1.gz

but I don't have the gz on there. I will give that a try, and let you guys all know how it goes. Think I'm going to do a short lil write up on how to do this, since I know all the commands now by heart. :) Cross your fingers....

0pal_t0ad 03-02-2005 12:58 PM

yeah, and the kernel-2.6.9.... if there is one.
if xandros used grub then just copy everything from /mnt/xandros/boot/grub/grub.conf and paste it into ubuntu's /boot/grub/grub.conf.


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