Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub: "offline" installation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
big_gie
Apprentice
Apprentice


Joined: 31 Aug 2004
Posts: 158

PostPosted: Wed Apr 20, 2011 5:51 pm    Post subject: Grub: "offline" installation Reply with quote

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
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Wed Apr 20, 2011 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat Apr 23, 2011 2:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Aquous
l33t
l33t


Joined: 08 Jan 2011
Posts: 700

PostPosted: Sat Apr 23, 2011 7:28 am    Post subject: Re: Grub: "offline" installation Reply with quote

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
View user's profile Send private message
threeheadedpuppy
n00b
n00b


Joined: 24 Oct 2009
Posts: 9

PostPosted: Sun May 01, 2011 6:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
judepereira
Apprentice
Apprentice


Joined: 19 Jan 2008
Posts: 179
Location: Portage, yes, somewhere out there

PostPosted: Tue May 03, 2011 2:31 am    Post subject: Reply with quote

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
View user's profile Send private message
threeheadedpuppy
n00b
n00b


Joined: 24 Oct 2009
Posts: 9

PostPosted: Tue May 03, 2011 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
judepereira
Apprentice
Apprentice


Joined: 19 Jan 2008
Posts: 179
Location: Portage, yes, somewhere out there

PostPosted: Tue May 03, 2011 8:28 am    Post subject: Reply with quote

Well I had done something like this, https://forums.gentoo.org/viewtopic-t-668792-postdays-0-postorder-asc-start-0.html , that was detected and worked in the two laptops and six pcs that i tested it in.
_________________
Jude Pereira
(http://judepereira.com)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum