LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-28-2012, 04:45 AM   #1
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Rep: Reputation: 2
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?
 
Old 07-28-2012, 04:57 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
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.
 
Old 07-28-2012, 08:17 PM   #3
Linux_420
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora
Posts: 27

Rep: Reputation: Disabled
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

Last edited by Linux_420; 07-28-2012 at 08:27 PM.
 
1 members found this post helpful.
Old 07-28-2012, 08:56 PM   #4
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 314

Rep: Reputation: 45
for grub legacy it is
Code:
grub-install --root-directory=/mnt/sda2 /dev/sda
for example
 
Old 08-01-2012, 02:32 AM   #5
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] grub-install command not found ! debianD Gentoo 3 04-30-2015 12:05 AM
grub-install: command not found NetRock Linux - General 2 03-23-2012 03:54 PM
Grub command prompt during install - what do I have to type? snowweb Linux - Newbie 1 09-08-2009 02:24 PM
Install - boots cd to grub command line Optiker MEPIS 3 12-19-2006 02:27 PM
How to install Grub bootloader to MBR from command line sleddog Linux - Software 2 04-08-2004 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration