You are not logged in.

#1 2017-06-05 06:34:29

tesla135
Member
Registered: 2013-06-27
Posts: 68

[Solved]Grub won't boot

After a kernel panic... I decided to reinstall arch.

My boot mode is bios.

I did many reinstallations today and yesterday and it does not work.

On my last installation, my partitions system:

Mount      Size      Type                   Partition

/dev/sda1  200M      #BIOS boot             /boot
/dev/sda2  8.1G      #Linux swap
/dev/sda3  416.7G    #Linux filesystem      /home/
/dev/sda4  40.6G     #Linux filesystem      /

Then

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda4

mount /dev/sda4 /mnt

mkdir /mnt/home
mount /dev/sda3 /mnt/home


mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

swapon /dev/sda2

pacstrap /mnt base
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt


mkinitcpio -p linux

pacman -S grub
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

No errors until here. But after I reboot system.... grub loads for a fraction of a second and it reboots, it does this like an infinite loop.

Last edited by tesla135 (2017-06-05 17:08:15)

Offline

#2 2017-06-05 13:25:05

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [Solved]Grub won't boot

I don't use grub so my knowledge is restricted to what I can read from the wiki.

Check what disklabel your disk has been formatted with (GPT or MBR). Then follow their specific instructions in the wiki:
https://wiki.archlinux.org/index.php/GRUB#BIOS_systems

From what I could understand from reading the wiki your should have a 1-2MiB brub partition and is not to be formatted. The flag for bios on your boot partition is only needed if you have GPT disklabel.

Edit:
It could also be so simple as formatting your specific boot partition in fat32 instead of ext4.

Edit2: Did a strike through. I read it a bit quick. The bios_grub flag should be pointed at the 1-2MiB grub partition if you are using GPT partition label.

Last edited by olegabrielz (2017-06-05 13:41:03)


Be aware of my Newbie Powers

Offline

#3 2017-06-05 14:31:57

tesla135
Member
Registered: 2013-06-27
Posts: 68

Re: [Solved]Grub won't boot

Ok. it's formatted as GPT. I forgot to tell that  I used  cfdisk to create/delete root partition and boot partition( home partition must be untouched because I hava data in this partition).
In cfdisk I can only set type of boot partition but not the flag.

@olegabrielz I will try your version, but I need to know if  I can keep my data safe if I use parted to set the bios_grub flag to /dev/sda.

Offline

#4 2017-06-05 15:09:49

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [Solved]Grub won't boot

Your data is safe. Set a flag for a partition does not change partitions or their content. But you need to free up 1-2MiB (preferrable in the beginning of the disk) to create the unformatted grub partition. This partition is in addition to your boot partition. Then set the bios_grub flag on the grub partition. I don't know if it matters, but you may also have to use fat32 on your boot partition.

Edit: Is there a particular reason for you to choose bios and not EFI boot?

Last edited by olegabrielz (2017-06-05 15:35:27)


Be aware of my Newbie Powers

Offline

#5 2017-06-05 17:06:54

tesla135
Member
Registered: 2013-06-27
Posts: 68

Re: [Solved]Grub won't boot

"Edit: Is there a particular reason for you to choose bios and not EFI boot?"

Yes, my system is not using efi.

Well, it finally worked. I found that bios boot partion is different from /boot partition.
So, I created the bios partition, unformatted and unmounted, just with that bios_grub flag and it worked. smile

@olegabrielz thank you very much. smile

Last edited by tesla135 (2017-06-05 17:07:14)

Offline

#6 2017-06-05 17:33:22

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [Solved]Grub won't boot

You're welcome. I'm glad it worked out. Enjoy!!


Be aware of my Newbie Powers

Offline

#7 2017-06-07 15:44:39

vegangaro
Member
Registered: 2017-06-07
Posts: 8

Re: [Solved]Grub won't boot

You dont need to reinstall all back to correct grub behavior

Just boot arch live cd  and correct grub with:

# mount /dev/sdxY /mnt        #Your root partition.
# mount /dev/sdxZ /mnt/boot   #Your boot partiton (if you have one).
# arch-chroot /mnt
# grub-mkconfig -o /boot/grub/grub.cfg


C++ and KDE = PRAISE THE SUN!

Offline

Board footer

Powered by FluxBB