Skip to main content
Welcome guest. | Register | Login | Post

How to save changes in grub?

9 replies [Last post]
Offline
Joined: 2007-08-24

i am trying to edit grub from its main menu with e for edit. need instruction how to to make grub changes & save them. attempted to use edit fcn from main screen where gnu/linux & other OSs are listed. grub menu lists hda2 but now hdb2; made change - grub failed to save.
how do i change/save slice(partition)name. grub is my manager(for now dual boot). tried supergrub with no result, that is grub still attempts boot dvd-rom & fails, dropping into busybox with infamous error message: "... job control turned off." can use knoppix-cd to peek inside. but do not know how to change name of partition. read:can use ubuntu (edgy) dvd to change grub. ?how?
resisting for nonce using edgy dvd to reinstall ubuntu because would have to recompile intel pci modem (area over my head & don't swim well). (recently had send box back vendor to replace mainboard changing partition name.)
need instruction how to to make grub changes & save them.
greetings ZN
PS if this is incorrect catagory, &c., please move for me. thanks.

Computer: black box from OH vendor
- maxtor hdd (ide)(slave)
- ? hdd (sata)
- tsst cd/dvdw (ide)(master)
- pc chips a13g main
- amd sempron 3600 cpu
- phoenix bios

libervisco's picture
Offline
Joined: 2006-05-04
Thank you for asking your

Thank you for asking your question. I have moved it into a separate thread in the "System tools, drivers and hardware" forum where it seems to fit the best and took the liberty of renaming it into "How to save changes in grub?" as that seems to be your main question here (we can edit if that's not correct).

So, about editing grub in a way that would save changes, you have to make the edit while you are in the system and not on the grub screen. To do this the easiest way I recommend this:

  • 1. Press Ctrl-f2 to get the run-command dialog and write "gksudo gedit /boot/grub/menu.lst" and then enter your password when it asks
  • 2. Then scroll down to after the ## End Default Options ## where you can edit your grub entries
  • 3. Once you're finished editing open terminal and run sudo grub-install /dev/hda which should guarantee that changes are saved.

The above should work on Ubuntu, probably Debian and most other distros when using GNOME desktop, but in case it doesn't you can do the same in terminal, but change the editor (gedit) into something you have (like kate) or to edit completely in terminal you can use nano in which case it the first step would be to open the terminal and run sudo nano /boot/grub/menu.lst.

I hope I have understood your question well and that this helps. If not.. well then just ask. Smiling

Cheers

Offline
Joined: 2007-08-24
How to save changes in grub?

" * 1. Press Ctrl-f2 to get the run-command dialog and write "gksudo gedit /boot/grub/menu.lst" and then enter your password when it asks
* 2. Then scroll down to after the ## End Default Options ## where you can edit your grub entries
* 3. Once you're finished editing open terminal and run sudo grub-install /dev/hda which should guarantee that changes are saved."

understood query. am i to assume that i do the above from live-cd such as knoppix or ubuntu? call up terminal by using C-f2; thus giving me access to my linux sys? remember, grub only boots initial screen, not the system itself. will try implementing your instruction if i remember password, been several months. still struggling. :-)

thanks for reply ZN

libervisco's picture
Offline
Joined: 2006-05-04
Oh, actually if you can't

Oh, actually if you can't get into your system, but can boot from an Ubuntu LiveCD than the steps are the same except for these modifications.

Before everything, after booting into the livecd, you have to mount the filesystem of your installation's /boot partition which you can do in terminal with sudo mount /dev/hdaX /mnt/ where "X" is the number of your partition. If it's on /dev/hdb then it's /dev/hdbX.

Then instead of editing /boot/grub/menu.lst you edit /mnt/grub/menu.lst and then do the rest of the steps.

If your /boot isn't on a separate partition then just mount the one it is on, probably / (root) and then if you mounted it on /mnt/ your grub menu.lst file will beon /mnt/boot/grub/menu.lst.

So that's how you can access your real installation to edit something on it under the livecd and edit from there.

If you are trying to change grub in order to be able to boot your installation it might help to tell us what does it say when you try to boot it, what's the error?

Cheers

a thing's picture
Offline
Joined: 2005-12-20
GRUB isn't LILO
libervisco wrote:

3. Once you're finished editing open terminal and run sudo grub-install /dev/hda which should guarantee that changes are saved.

You don't have to do anything after editing grub.conf or menu.lst for the changes to take effect; GRUB dynamically reads the configuration file every boot (unlike LILO which you do have to reinstall every time you edit its configuration file).

Offline
Joined: 2007-08-24
"what's the error?"

"what's the error?" -libervisco. error is: "/bin/sh: can't access tty; job control turned off". to me it means grub is trying to boot from the rom drive (hda). the rom is now master while ide hhd (hdb) is slave since new mobo.
i'll try all the instructions. thank-you. Greetings, ZN

Offline
Joined: 2007-08-24
back again. used both

back again.
used both ubuntu live-dvd & knoppix live-cd. no joy. with same results: see attachment.
knoppix allow me to read gnu/linux which resides at /mnt/hdb2/boot/ & /... /grub/menu.lst is configured to: hda which is the rom drive. from the terminal I was unable to mount the parition. tried various permutations of sudo mount on /dev/ & /mnt/ without good result.
will try: cd /mnt/hdb2/boot & cd /mnt/hdb2/boot/grub. it is frustrating, know parition is there - can read grub files - just not edit.

tbuitenh's picture
Offline
Joined: 2005-12-21
What on earth are you

I think you meant to do something like this:

sudo su
mkdir /mnt/hdb2
mount /dev/hdb2 /mnt/hdb2
# (do your editing in /mnt/hdb2/.....)
umount /mnt/hdb2
exit

Note the third space in the third command. Unless a mountpoint is listed in /etc/fstab, you need to tell mount both the partition and the place ("mountpoint") where you want to see its contents. The partition goes first, the mountpoint second. Mountpoints may be put anywhere on the system and have any name, but to prevent confusion most people use /mnt/hd** .

sudo su removes the need to type sudo before every command, it gives you full permissions until you type exit.

Offline
Joined: 2007-08-24
:-) sucess - sorta :-(

the sudo su/ mkdir /mnt/.... did not work but the following did:

#cd /tmp
#mkdir M
#mount /dev/hdb2 M
#cd M/boot/grub
#mcedit menu.lst

ubuntu loads except x server does not start. the details on error message did not help. did not know what i was looking for thus unable to fix this problem. progress was made was able to edit & save grub menu.lst.

choices: figure out x server hangup; re-install ubuntu; or select dialup friendly distro, such simplymephis or mint so i heard then after configuring using favorite browser under wine (http://kmeleon.sourceforge.net/forum/read.php?1,25998,page=4) k-meleon.

to all those who gave me ideas & instructions: thank you all for the help, much aprreciated, ZN :-)

tbuitenh's picture
Offline