LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   grub install remote drive (https://www.linuxquestions.org/questions/linux-from-scratch-13/grub-install-remote-drive-4175442783/)

spiky0011 12-24-2012 07:19 AM

grub install remote drive
 
Hi

Ok I have a situation I would like to resolve.
Story so far, I have a pc I tried to put lfs on but cant build it on there, so I built on another machine dd over to drive but cant install grub.
Now what I intend to do is install grub from a local machine to the remote machine.
I have mounted the drive from remote machine to local/mnt/lfs dir local, (hope that makes sense). I have mounted the virtual kernel file system and chrooted into the remote drive I want to install grub, grub-install /dev/sda.
Now the thing thats stopped me proceeding, will this change the grub on the local machine or will it install into the remote drive, I am chrooted into the remote drive

Keith Hedger 12-24-2012 08:37 AM

If you have mounted your host /dev to the chrooted system then /dev/sda whatever will be pointing to your local machine NOT the remote machine even though you have chrooted into the drive.
Do you physical access to the remote machine? If so I would boot from something like the partedmagick live CD and install grub from there, if you muck it up you may end up not being able to boot the local machine, make sure you have an alternative boot medium and/or a backup.

spiky0011 12-24-2012 08:50 AM

Hi Keith

Yes this is why I didn,t install grub as I thought it would point to local machine drive.
I dont have a grub disc at the moment i.e super grub and cant boot off a live cd. I did find another option grub-install --root-directory=/mnt/lfs /dev/sda but again the /dev/sda stops me.
I have thought about grub-install user@ip:/dev/sda
The local machine is the 1 that built the lfs for remote.
Wots it like with time to waste!!!

Keith Hedger 12-24-2012 10:21 AM

Here's a thought, if your host and remote have a similar layout, booting from /dev/sda1 for instance as I recall if grub is installed in the MBR you can back it up with
Code:

dd if=/dev/sda of=/path/to/file bs=512 count=1
You could then reverse the process on the remote machine and it should install grub, I HAVEN'T TRIED THIS!, just an idea of how it could be done, you may fubar your system!

spiky0011 12-24-2012 10:29 AM

Hi

Yes just tried that lol.

Keith Hedger 12-24-2012 10:32 AM

Great minds think alike!
Did it work?

spiky0011 12-24-2012 10:39 AM

No not yet try something else

EDDY1 12-24-2012 12:12 PM

Did you dd the drive from usb?
1. If so put the drive back in usb install grub to sdb, it will overwrite grub in sda.
2. Add sda to the boot menu on sdb.
3. reboot system select the entry for sda.
4. Unmount usb drive sdb & remove from machine.
5.reinstall grub on sda.
I know this works because I keep a usb drive with debian on it, just for that purpose.


All times are GMT -5. The time now is 03:55 AM.