LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   i want to understand grub-install command (https://www.linuxquestions.org/questions/linux-software-2/i-want-to-understand-grub-install-command-4175419050/)

bluekill14 07-28-2012 04:45 AM

i want to understand grub-install command
 
Im studying for lpic-1. I'm confused on what scenario would I use grub-install command.

As a test, I deleted the file /boot/grub/menu.lst on a vm machine and booted centos 6.2 to rescue it. I ran grub-install /dev/sda but still my system would not boot

Will I only use it if its corrupted? How do I corrupt my system for me to test grub-install?

Which physical disk will I choose for grub-install if I have two physical disk namely sda and sdb?

syg00 07-28-2012 04:57 AM

grub-install (re-)writes the stage0 to the MBR. Classic grub doesn't build the menu.lst for you. Some distro installers (like Anaconda) do.

Refer to the appropriate doco - gnu.org for the grub[2] package.

Linux_420 07-28-2012 08:17 PM

http://www.dedoimedo.com/computers/grub.html
http://www.gnu.org/software/grub/manual/
etc.


you may find the need to reinstall grub after attempting (and failing) to set up a multi-boot system or experimenting with alternate boot loaders.

as far as which device you choose to install to.. it will be sd* or hd* depending on which kind of hard drive you use NOT something like sda1 or hda2 which refer to partitions on a hard drive. the boot loader is a part of the MBR which is stored on the first sector of the hard drive.


rtfm... go to bash & type

Quote:

man grub-install

Karl Godt 07-28-2012 08:56 PM

for grub legacy it is
Code:

grub-install --root-directory=/mnt/sda2 /dev/sda
for example

bluekill14 08-01-2012 02:32 AM

Thank you all, I finally understand it but the reputation point goes to Linux_420. Reading the manual is not enough as I'm having troubles understanding some of the manpages of commands, I just keep on reading tutorials and articles then test and that works best for me. :)


All times are GMT -5. The time now is 07:03 PM.