Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB reinstalling
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
nanostallmann
n00b
n00b


Joined: 12 Oct 2014
Posts: 26

PostPosted: Sun Aug 30, 2015 11:25 am    Post subject: GRUB reinstalling Reply with quote

Hi all,
I have re-installed winzozz and now I want re-installing the bootloader (grub) in the MBR of an hd.
For doing this:
- I boot the systemrescuecd
- mount the /dev/sda3 in /mnt/custom
-
Code:
mount -o rbind /dev /mnt/custom/dev

-
Code:
mount -t proc none /mnt/custom/proc

-
Code:
mount -o bind /sys /mnt/custom/sys

-
Code:
mount -o bind /tmp /mnt/custom/tmp

-
Code:
chroot /mnt/custom /bin/bash


and then I tryed to reinstall grub:
- first with the script
Code:
grub-install /dev/sda

Code:
grub-setup /dev/sda

- later with grub directly:
Code:

            #grub
            >root (hd0,2)
            >setup (hd0)

in both cases the prompt give a "success output", but, in both cases when I rebooted the winzozz start again....!?!?

Any suggestion?

thank you and regards!
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sun Aug 30, 2015 12:00 pm    Post subject: Reply with quote

hmm

well i only have old bios box.

and there are newer uefi thing which makes things a bit different, never used those.

so you need to check if its bios or uefi in your bios ...

well for the bios thing: check which partition is active / which harddrive is active in the bios.
afaik fdisk can toggle that boot flag.

Code:
fdisk /dev/sda

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00037d4b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *           63   1028159   1028097  502M 83 Linux
/dev/sda2       231729152 250068991  18339840  8,8G 83 Linux
/dev/sda3         1032190 231729151 230696962  110G  5 Extended
/dev/sda5         1034240 214951935 213917696  102G 8e Linux LVM

Partition table entries are not in disk order.

Command (m for help): q


just as an example of my box here. /dev/sda1 here has the star, which makes it active
Back to top
View user's profile Send private message
nanostallmann
n00b
n00b


Joined: 12 Oct 2014
Posts: 26

PostPosted: Sun Aug 30, 2015 12:57 pm    Post subject: Reply with quote

tw04l124 wrote:
hmm

well i only have old bios box.

and there are newer uefi thing which makes things a bit different, never used those.

so you need to check if its bios or uefi in your bios ...

well for the bios thing: check which partition is active / which harddrive is active in the bios.
afaik fdisk can toggle that boot flag.

Code:
fdisk /dev/sda

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00037d4b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *           63   1028159   1028097  502M 83 Linux
/dev/sda2       231729152 250068991  18339840  8,8G 83 Linux
/dev/sda3         1032190 231729151 230696962  110G  5 Extended
/dev/sda5         1034240 214951935 213917696  102G 8e Linux LVM

Partition table entries are not in disk order.

Command (m for help): q


just as an example of my box here. /dev/sda1 here has the star, which makes it active


Yes the Bios is set for Legacy & UEFI,
the fdisk outputs that the partintions are up but... I noticed that there are two partition with "*" (bootable flag).
It's correct? or it's needed that winzozz partion is marked as "non bootable" ?

....
Update:
I removed the boot flag from winzozz partition... and re-did the grub-install...
but nothing.... the winzozz start again....
....
very noise...
...
regards,

thank you for reply


Last edited by nanostallmann on Sun Aug 30, 2015 1:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Aug 30, 2015 1:15 pm    Post subject: Reply with quote

nanostallmann,

The bootable flag is for your BIOS. BIOSes vary.
Some don't check it at all
Some check that its set on exactly one partition.
Others check that it is set os one or more partitions.

They all (eventually) read LBA 0 from the boot drive and jump to the start address.

It follows that either LBA 0 is not being written at all, or its not being written on the drive you have selected in the BIOS to boot from.

Windows is vey possessive about the boot flag but Linux doesn't care.

If this were a boot flag issue, you would get messages from the BIOS about no Operating System found.
_________________
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
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Sun Aug 30, 2015 1:48 pm    Post subject: Reply with quote

The first available sector of the hard drive is the 64'th sector. This is not use anymore. The first available sector is 2048 since long ago now. Maybe Grub have not enough space to write it's data in the MBR, because there is not enough space after the first 512 bytes.

You can try to save data from partition sda1, than delete it with Fdisk and recreate it. Fdisk should start it at sector 2048 and finish it at the same end than before. After save the new partitions table and reboot (or use partprobe), you format it and restore the data. Than Grub may install correctly.

I would prefer Grub2 over Grub1. I see that the sectors of your partitions table are not ascending in order with the partitions numbers. I always advoid this. The last sector of partition X is one sector before the first sector of partition X+1. This is possible if you partition manually with Fdisk or Gdisk.
_________________
Paul
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Aug 30, 2015 2:21 pm    Post subject: Reply with quote

Logicien,

Grub has a fallback for that case.
It warns that horrible things will happen as it can't embed some of its code but it still works - Until grub is updated anyway.
_________________
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
nanostallmann
n00b
n00b


Joined: 12 Oct 2014
Posts: 26

PostPosted: Wed Sep 02, 2015 9:20 pm    Post subject: Reply with quote

OK!
the problem was that the BIOS need to be set to legacy only.
thank you
regards
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