LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-25-2010, 01:11 PM   #1
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Rep: Reputation: 31
Question about one command - grub-install --root-directory=/mnt/ /dev/sda


I uses this command
Code:
grub-install --root-directory=/mnt/ /dev/sda
to restore my grub. But I dont understund what it does exactly.
Does somebody know How Does it work?
What I understund is that grub-install installs grub menu in dev/sda takeing some date from /mnt/
Is that right?
 
Old 01-26-2010, 07:41 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Not quite. The root directory is the directory in which the vmlinuz and initrd.img files written in /boot/grub/menu.lst can be found. That is: the paths given for vmlinuz and initrd.img are relative to this directory.

The root directory (depending on your configuration) is usually either the “/” or the “/boot” from your Linux installation.

Yves.
 
Old 01-27-2010, 12:35 PM   #3
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
I install grub in Debian, but I use Ubuntu like live cd to access the system and install boot.
I understund this part:

Code:
grub-install --root-directory=/mnt/
As I understund "grub-install" command install the grub in root directory that I point this way:

Code:
--root-directory=/mnt/
But what about this:

Code:
/dev/sda
I just want to understund the logic of this command.

Last edited by miros84; 01-27-2010 at 12:37 PM.
 
Old 01-27-2010, 02:49 PM   #4
mdg
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 626

Rep: Reputation: 37
Code:
grub-install --root-directory=/mnt/ /dev/sda
Grub will install the grub files it finds in /mnt/ to /dev/sda
 
1 members found this post helpful.
Old 01-27-2010, 03:06 PM   #5
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
In /mnt/ I had to mount Debian wchich grub failures.
So, how grub-install will take somefiles from Debian partition if exactly this partition havenot got working grub.
I understund it installs it in /dev/sda which is the MBR.
But about /mnt/ I dont understund it.
 
Old 01-28-2010, 03:06 AM   #6
mdg
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 626

Rep: Reputation: 37
The files grub needs to access are in your Debian mount. They are undamaged and accessible.
Grub is no longer installed in the Debian MBR, so you can't boot from Debian in this situation.

You boot from cd rescue, mount Debian under /mnt/ and give the install grub command. Grub reads the files in /mnt/ (Deb) and installs to MBR.
 
Old 01-28-2010, 08:42 AM   #7
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
The same way I can boot Ubuntu, mount debian partition on /mnt, then use this command:

Code:
grub-install --root-directory=/mnt/ /dev/sda
Right?
 
Old 01-28-2010, 10:45 AM   #8
mdg
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 626

Rep: Reputation: 37
Yes. The important part is the root directory must point to where the image files for your main distro are (see YinYeti's post #2).

Your main distro in this instance is where the grub files that boot up the computer reside.
 
Old 01-28-2010, 01:26 PM   #9
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
Ok, now I think I understand it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Executing 'grub-install /dev/sda' failed. This is a fatal error. Melhisedek Linux - Newbie 17 07-03-2009 10:07 AM
why only "mount /dev/sda /mnt/usb" works and not "mount /dev/sda1..." ? gromot Linux - General 7 05-19-2009 11:18 AM
Can I mount a file created by `dd if=/dev/sda of=/mnt/sdb1/40gig.bin` ? lumix Linux - Software 6 12-09-2008 09:51 AM
/sys/block/sda/sda1/dev: No such fiel or directory PlatinumX Linux - Newbie 1 08-05-2008 07:16 AM
Install lilo on external drive (/dev/sda), then boot as INTERNAL (/dev/hda)? slackware-elf Slackware 3 08-18-2007 05:51 PM


All times are GMT -5. The time now is 10:53 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration