Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2 and new drive
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
mgnut57
Apprentice
Apprentice


Joined: 12 Jan 2008
Posts: 190

PostPosted: Fri Jul 07, 2017 5:48 pm    Post subject: Grub2 and new drive Reply with quote

I am replacing an existing drive with a larger drive, and in the process, moving (where possible) to ext4. This also entails replacing grub-legacy with grub2, since grub-legacy doesn't support ext4.

With grub-legacy, when installing on a second drive, you could configure it with the "device" command such that at boot time, it would look for the stage1 files on hd0 (and not hd1).

Is there an equivalent issue with grub2? For example, after running
Code:
grub2-install /dev/sdc

then removing /dev/sda and rebooting, will the new grub2 installation still look for the next stages on /dev/sdc (which now doesn't exist)? If so, how do I handle this?
Back to top
View user's profile Send private message
ChrisADR
n00b
n00b


Joined: 06 Jul 2017
Posts: 11
Location: Peru

PostPosted: Fri Jul 07, 2017 6:00 pm    Post subject: Reply with quote

Hi,

after installing grub the configuration is made through

Code:


grub-mkconfig -o /boot/grub/grub.cfg



If you are going to use ext4 maybe you should change the GRUB_CMDLINE_LINUX variable in /etc/default/grub

The wiki is a good place to start

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader

hope it helps,
Back to top
View user's profile Send private message
mgnut57
Apprentice
Apprentice


Joined: 12 Jan 2008
Posts: 190

PostPosted: Fri Jul 07, 2017 6:26 pm    Post subject: Reply with quote

Thanks for the reply.

I have already generated a new cfg file using the command you specified. I also edited the copy on my second (soon to be only) drive, changing the entries which had "hd2" to "hd0" and setting the correct partitions in the "msdosX" names.

The question which remains is: when I remove my original drive and try to boot off my new drive, where will Grub2 look for the grub configuration file? Will it look for this file on a second drive, and on which partition? Or does it scan them all?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43178
Location: 56N 3W

PostPosted: Fri Jul 07, 2017 7:36 pm    Post subject: Reply with quote

mgnut57,

to grub-legacy, all the extX filesystems are ext2. It only reads them.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ChrisADR
n00b
n00b


Joined: 06 Jul 2017
Posts: 11
Location: Peru

PostPosted: Sat Jul 08, 2017 10:24 pm    Post subject: Reply with quote

I'm not 100% sure, but if I'm not wrong...

when you install grub in the drive, it takes de first X(don't remember the exact number right now) segments of that one and saves some configurations for the BIOS to boot it. Actually, after installing GRUB on the drive it should start looking that first partition and then looking for the kernels that you may have on your /boot partition.

Hope it helps, if not, just let me know and I'll double check the information, I'm just remembering something I read a couple of months ago
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