PDA

View Full Version : Grub



rumpty
24-08-2009, 07:44 PM
I'm at the point of rearranging the hard drives, doing away with one at least, in my Linux/Windows multi-boot computer.

Assuming booting back into Ubuntu is achieved, what command can I give to make Grub look around at the rearrangement, so that it will rewrite the menu.lst file?

Thanks.

mikebartnz
24-08-2009, 07:50 PM
It is a text file so you can just edit it. Not knowing the HD and OS arrangement it is hard to truly help.

rumpty
24-08-2009, 08:06 PM
I have indeed edited it in the past. Just thought that the manual procedure could be replaced by telling Ubuntu to repeat whatever Grub does "by itself" during the original OS installation.

Erayd
24-08-2009, 09:38 PM
What it does 'by itself' is 'grub-install <boot drive device node>', but if you're moving drives around simply running it again could break things, as it'll use the old drive mapping file - you really need to tell us what you're doing with them before we can be of any help.

beama
24-08-2009, 09:42 PM
If Im correct grub is the boot loader for Ubuntu. To modify menu.1st you need to be in Ubuntu (chicken egg situation I think)

If you get caught like this then you'll have to use grubs limited editing facility which is ( like )editing a text file. I hope you know your HDAs from SDAs etc

mikebartnz
24-08-2009, 11:00 PM
If Im correct grub is the boot loader for Ubuntu. To modify menu.1st you need to be in Ubuntu (chicken egg situation I think)

If you get caught like this then you'll have to use grubs limited editing facility which is ( like )editing a text file. I hope you know your HDAs from SDAs etc
Grub is a boot loader and most Linux distributions use it. I wish Grub would make a backup of the MBR like Lilo.
You can boot from any Linux live cd and edit menu.1st. PCLinuxOS live cd has a way for redoing grub.
Grubs limited editing facility is more like using Edlin from the old MSDOS days.

Erayd
24-08-2009, 11:59 PM
You can easily back up the boot sector yourself using something like the following (run as root):
dd bs=512 count=1 if=/dev/sda of=bootsectorbackup.imgThis assumes that your boot drive is /dev/sda.

WARNING: BE *VERY* CAREFUL WITH DD!!! Used incorrectly, it can completely hose your system.

mikebartnz
25-08-2009, 12:18 AM
You can easily back up the boot sector yourself using something like the following (run as root):
dd bs=512 count=1 if=/dev/sda of=bootsectorbackup.imgThis assumes that your boot drive is /dev/sda.

WARNING: BE *VERY* CAREFUL WITH DD!!! Used incorrectly, it can completely hose your system.
Thanks Erayd
PCLinuxOS still uses hda while Fedora uses sda. Do you know why they changed to sda from hda.

Erayd
25-08-2009, 12:30 AM
Thanks Erayd
PCLinuxOS still uses hda while Fedora uses sda. Do you know why they changed to sda from hda.
It's due to a change in the way the kernel manages them - both ATA and SCSI devices are now managed under a new, unified driver stack.

Whether or not you enable this is an option at compile-time. If you don't compile your own kernels, you don't need to worry about it - they both work :).

[Edit: And for the purposes of this post, SATA drives are considered to be SCSI ones.]

R2x1
25-08-2009, 01:11 AM
[Edit: And for the purposes of this post, SATA drives are considered to be SCSI ones.]

However for the purposes of plugging 'em in, they ain't. ;)

Erayd
25-08-2009, 05:37 AM
However for the purposes of plugging 'em in, they ain't. ;)
Indeed... one has nice thin cables, and the other has annoyingly bulky fat ribbons :p.