View previous topic :: View next topic |
Author |
Message |
big_gie Apprentice
Joined: 31 Aug 2004 Posts: 158
|
Posted: Wed Apr 20, 2011 5:51 pm Post subject: Grub: "offline" installation |
|
|
Hi all,
I need to setup a new system but don't have physical access to it yet. So I've set up everything with the sata hard drive in a USB enclosure. The only thing remaining is installing grub on it.
I'm not sure how to proceed though. When installing grub, you need to tell it where to install itself, but also where to find its configuration files. Should I just do this? (with hd2 being the drive, connected by usb for now):
Code: | # grub
grub> root (hd2,0)
grub> setup (hd2)
grub> quit |
Will grub be able to boot when the drive is inserted into the new system and becomes /dev/sda and hd0?
Thanks |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Apr 20, 2011 7:02 pm Post subject: |
|
|
this grub.conf should cover the options, assume root is on partition 3 and that the build computer sees the usb drive as sdc
third choice should allow test boot after selecting the usb as boot drive in bios
Quote: | default 0
timeout 10
#splashimage (hd0,0)/boot/grub/splash.xpm.gz
title Gentoo drive installed in and selected as first boot drive on the target system
root (hd0,0)
kernel (hd0,0)/boot/<your kernel name> root=/dev/sda3
title Gentoo usb drive selected as first boot drive on the target system
root (hd0,0)
kernel (hd0,0)/boot/<your kernel name> rootdelay=10 root=/dev/sda3
title Gentoo usb drive selected as first boot drive on the build system
root (hd0,0)
kernel (hd0,0)/boot/<your kernel name> rootdelay=10 root=/dev/sdc3
|
_________________ Defund the FCC. |
|
Back to top |
|
|
cach0rr0 Bodhisattva
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Sat Apr 23, 2011 2:45 am Post subject: |
|
|
it's also worth pointing out here, when you first boot this system up, with grub in the MBR you'll have access to a basic minimalistic grub shell, from which you can do darn near everything you need if it doesn't work "out of the box" (e.g. modify root, do your setup, etc)
to that same end, when you DO get to the grub menu, it's easy enough to hit 'e', edit the kernel command-line, hit enter, hit 'b' to boot - soon as doing this yields a magic functional combination for you, you know well enough what changes you need to make to grub. _________________ Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash |
|
Back to top |
|
|
Aquous l33t
Joined: 08 Jan 2011 Posts: 700
|
Posted: Sat Apr 23, 2011 7:28 am Post subject: Re: Grub: "offline" installation |
|
|
big_gie wrote: | Will grub be able to boot when the drive is inserted into the new system and becomes /dev/sda and hd0? | It should be - I think grub is smart enough not to hard-code its own drive number in the MBR. |
|
Back to top |
|
|
threeheadedpuppy n00b
Joined: 24 Oct 2009 Posts: 9
|
Posted: Sun May 01, 2011 6:32 pm Post subject: |
|
|
I'm trying to do something similar to the OP, and I get grub error 17 when it boots up on the new system that I've tried to pre-prepare...
Is grub definitely clever enough to not hard code the location of the stage files in the MBR - for instance, if I install grub onto my USB drive on the test rig:
Code: | grub-install --no-floppy --root-directory=. /dev/sdc |
When I put this USB drive into the intended target machine, the USB is not /dev/sdc anymore, it could be anything, depending on how many drives that system has.
For a bootable USB drive, that can work on any machine (without having to fixup the grub.conf/MBR before hand, on the USB drive), is GRUB the best option? |
|
Back to top |
|
|
judepereira Apprentice
Joined: 19 Jan 2008 Posts: 179 Location: Portage, yes, somewhere out there
|
Posted: Tue May 03, 2011 2:31 am Post subject: |
|
|
That's not your problem actually, in the BIOS, just tell it that your USB is your first hard drive, and it will always be sda1, regardless of the multi million drives already installed in the system hardware. _________________ Jude Pereira
(http://judepereira.com) |
|
Back to top |
|
|
threeheadedpuppy n00b
Joined: 24 Oct 2009 Posts: 9
|
Posted: Tue May 03, 2011 7:59 am Post subject: |
|
|
Hm this is not always possible in all different kinds of bios though, for instance my laptop only gives me one option - 'boot from usb' tickbox. Whether this causes the usb to be recognized as /dev/sda1 is anyones guess (maybe it is, and something else is the problem?) |
|
Back to top |
|
|
judepereira Apprentice
Joined: 19 Jan 2008 Posts: 179 Location: Portage, yes, somewhere out there
|
|
Back to top |
|
|
|