Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2 Problem
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
Carel
n00b
n00b


Joined: 26 Jun 2010
Posts: 15

PostPosted: Sun Oct 06, 2013 9:32 pm    Post subject: Grub2 Problem Reply with quote

Hi, how goes ?

I have a small problem (probably about 512 bytes worth), GRUB won't run after I reboot (Well mostly). I know this as I've tried about fifty times so, it did work for five boots of the fifty rather early on. This merely spurred on my efforts but now they have waned a bit. As I understand it I should have the following :

I have split my drive into two parts 64 meg for /boot and 2G for lvm. The idea being I can fundoodle the drives later. My fstab is below.

Code:

/dev/sda1         /boot
/dev/vga/swap  none
/dev/vga/root    /
/dev/vga/home  /home
/dev/vga/usr     /usr
/dev/vga/var     /var
/dev/vga/srv     /srv
/dev/vga/tmp    /tmp
none                /selinux


Mostly I run off of a live CD and mount the above paths before chrooting, except /boot which is mounted after I've chrooted. I then follow up with a
Code:
 env-update && source /etc/profile
. The five times GRUB did work I'd actually not mounted boot and installed grub into the root partition, if I remember corrently.

GRUB is setup with :
Code:

echo "=sys-boot/grub2.00-p5107-r1" > /etc/portage/package.accept_keywords
emerge sys-boot/grub:2
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg

I've added GRUB_DEFAULT_LINUX_CMD="dolvm rootfstype=ext4" in the /etc/default/grub.cfg file, if I remember correctly.
Some times module=included "lvm ext4 ext2" or --root=PATH with PATH = /, /boot, dev/sda1.

I have tried to check if grub installed on the first few bits with
Code:
 dd if=/dev/sda bs=512 count=1 | xxd
but that said I didn't have xxd, without the pipe to xxd I got wierd C~a#r%cters e%erywh&re and decided not to poke with that again and quickly rebooted. Doing the more tamer
Code:
dd if=/dev/sda bs=512 count=4 skip=383
showed grub at one point now it shows some form of a total. I'm haven't seen any device.map files under /boot/grub. I also get shouted at if I try to add "ext4" to the modules argument in grub2-install. I haven't tried creating my own grub.cfg yet.

My queries are there fore :


  • A lot of Forums mention the use of grub-update/update-grub, has this been replaced by grub-mkconfig ? (The one site implied this.)
  • How do I know if grub installed correctly ? (I suspect the output of grub2-install happily lies to me)
  • How should I go about resolving the problem myself ? (I'm using gentoo to learn linux properly so I don't mind the hang ups I just want to get them fixed in a sensible manner and a way that I won't have to ask the next time, better yet I can answer a fee forum posts next time)
  • How do I tell grub about the wonders of ext 4, does it need this or is it fine if I leave it to initramfs ? (I use genkernel --lvm --install initramfs)


I've tried a few other variations suggested on other forums, I read the gentoo GRUB 2 wiki and followed the handbook twice. I have the feeling I forgot something important or overwrote it. I was hoping that someone with a beard might drop in and loan a little sage like insight.

Split from the Grub sticky as that is really for Grub Legacy - NeddySeagoon
Back to top
View user's profile Send private message
Carel
n00b
n00b


Joined: 26 Jun 2010
Posts: 15

PostPosted: Sun Oct 06, 2013 10:00 pm    Post subject: Reply with quote

(Thanks to the Mod who moved my post, I just saw that I'd posted under GRUB legacy and not Grub 2, Sorry about that)

I just installed grub to /boot under /root partition (within the LVM) and rebooted, this works. Now I question why won't GRUB 2 work on a /dev/sda1, but happily work under /dev/vga-root ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Oct 06, 2013 10:16 pm    Post subject: Reply with quote

Carel,

I retitled the grub legacy sticky after I moved your post. When that thread started grub2 did not exist.
_________________
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
Carel
n00b
n00b


Joined: 26 Jun 2010
Posts: 15

PostPosted: Sun Oct 06, 2013 10:48 pm    Post subject: Reply with quote

(Well you had me for a minute there either way. I posted the update and saw my main question was gone... Oh crumbs !!! is the nice version of what I was thinking for a second there. Thanks for putting me in a better place Mr Seagoon(=Pirate ?) : D)

Co-incidently I've now created a boot partition under LVM and am using that to boot, or at least it seems I am. I'm still curious as to why this would work over loading boot to /dev/sda. from what I understand boot is fired first, then the LVM's and root are fired when one restarts the machine. I shall have to do more reading I suppose.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Oct 07, 2013 5:27 pm    Post subject: Reply with quote

Carel,

I can tell you about the boot sequence but not help with grub2. In my opinion grub2 is solving a problem that no longer exists.
If you use (U)EFI boot modes, you no longer need a boot loader at all. You can make the kernel a valid EFI program and the EFI BIOS will load it.
If you don't have (U)EFI then there is nothing wrong with grub legacy.

The boot sequence goes as follows:-
The BIOS (whatever flavour) sets up the hardware, does some self checks than reads from the HDD
Legacy BIOS reads Logical Block Address (LBA) 0 and executes it.
(U)EFI BIOS reads from the FAT32 EFI partition. and executes what it reads.

For legacy BIOS the content of LBA 0 has to do the rest of the loading.
For legacy grub, it makes BIOS calls to read the grub stage1.5 from the blocks following LBA 0.
This in turn reads /boot to load /boot/grub/stage2
stage2 reads grub.conf to display the menu and find out what to do.
It then loads the kernel and optionally the initrd before passing control to the kernel.

With a (U)EFI BIOS, it reads from the FAT32 filesystem ... which may mean it never reads LBA 0.
In turn, that would explain why installing grub2 to /dev/sda doesn't work.

As you say, more reading required.
_________________
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
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 860

PostPosted: Fri Oct 18, 2013 10:20 am    Post subject: Reply with quote

@NeddySeagoon does that mean it´s useless to migrate?
What about the news message in portage then?
Regards
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Oct 18, 2013 6:00 pm    Post subject: Reply with quote

transsib,

All my systems are pure 64 bit. The kernels do not support 32 bit code, so I can't even install grub.

As my bootloaders work and they are not a security issue, I don't see any reason to update them.
On new systems, which will probably be UEFI, I won't use a boot loader.
_________________
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
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 860

PostPosted: Sat Oct 19, 2013 8:33 pm    Post subject: Reply with quote

Makes me feel like a fool or someone pulled my leg.
Is it possible to revert back to grub legacy at all?
I am confused. My system is pure 64bit too with boot on sda1 and root on sda3.
:wink:
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Sat Oct 19, 2013 8:45 pm    Post subject: Reply with quote

I'm using Lilo to boot my pure 64-bit boxes.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 860

PostPosted: Sat Oct 19, 2013 8:58 pm    Post subject: Reply with quote

How come the install process makes you install grub at all?
My first 64bit install has taken place 2006. Since then I have installed a 64bit Gentoo system many more times.
There was always grub.
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