Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] grub2 install error: no post-MBR gap
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
cfgauss
Guru
Guru


Joined: 18 May 2005
Posts: 550
Location: USA

PostPosted: Tue Jun 30, 2015 11:01 pm    Post subject: [SOLVED] grub2 install error: no post-MBR gap Reply with quote

I've been using grub-0.97, GRUB Legacy, to boot my BIOS/MBR system and thought I'd upgrade to grub2 as I assumed that GRUB Legacy would eventually be removed from portage.

I'm following the Wiki instructions and get this error:
Code:
# grub2-install /dev/sda
Installing for i386-pc platform.
grub2-install: warning: this msdos-style partition label has no post-MBR gap; embedding won't be possible.
grub2-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub2-install: error: will not proceed with blocklists.


Here's my partition:
Code:
# fdisk -l /dev/sda
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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: 0x00044ae8

Device     Boot    Start        End    Sectors   Size Id Type
/dev/sda1  *           1     250000     250000 122.1M 83 Linux
/dev/sda2         250001   31250000   31000000  14.8G 82 Linux swap / Solaris
/dev/sda3       31250001 3907029167 3875779167   1.8T 83 Linux

where /boot is mounted on /dev/sda1 and / is mounted on /dev/sda3.

Any debugging hints and/or advice would be gratefully received.

[SOLVED] As indicated below, grub2 requires repartitioning of at least /dev/sda1 so I've opted to wait to install grub2 until I can partition a new hard disk from scratch. [/SOLVED]


Last edited by cfgauss on Wed Jul 01, 2015 2:52 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Tue Jun 30, 2015 11:19 pm    Post subject: Reply with quote

Interesting, you got a 2TB disk that has 512-byte native sectors? I'd thought all disks that large should have "advanced format".
But that's sort of besides the point, it looks like you have the first partition starting right after the MBR, no sectors to spare for putting in stage 1.5... So you can't embed stage 1.5.

So you have to use blocklists to tell where stage 2 is... So either use blocklists (ugly) or you'll need to repartition your hard drive.

The reason why I mentioned Advanced Format is that normally you'd have 4KiB sectors. Not putting your partition boundaries on 4K sector boundaries would kill performance. And even worse - if you had an SSD you want to put on erase page boundaries. The recent version of fdisk tends to partition on 1MiB boundaries to make sure that both of these requirements are automatically met, which isn't much wasted space on a 2TB (or even 2GB, but it's much more noticeable) disk. If you're worried about wasting 1MiB on a 2TB disk... you got bigger problems. Older versions of fdisks put them on cylinder boundaries which at least left a whole cylinder to make sure disks started on cylinder boundaries. In either case, that "wasted space" on that first 1MiB is actually not completely wasted...

Grub stage 1.5 fits there.

[Edit: additional boundaries]
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Wed Jul 01, 2015 12:39 am    Post subject: Reply with quote

redo the boot partition, move start 1 to start 2048

and if it's 512e with actual 4K physical sectors you should move the others to multiple of 2048 as well...
Back to top
View user's profile Send private message
cfgauss
Guru
Guru


Joined: 18 May 2005
Posts: 550
Location: USA

PostPosted: Wed Jul 01, 2015 1:38 am    Post subject: Reply with quote

frostschutz wrote:
redo the boot partition, move start 1 to start 2048
and if it's 512e with actual 4K physical sectors you should move the others to multiple of 2048 as well...

I've never changed my initial partitioning after installing Gentoo.
What program could carry out this realignment without damaging the data?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Wed Jul 01, 2015 3:03 am    Post subject: Reply with quote

I used gparted which seems to work. I'm not sure how to make it perfectly set partitions at exact boundaries. It may be enough to move enough space for stage 1.5 in any case.

Normally fdisk can detect the emulated 512 byte sector disks (and 4K real sector) in the "optimal" setting, which it did not here. It must be an older disk?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
cfgauss
Guru
Guru


Joined: 18 May 2005
Posts: 550
Location: USA

PostPosted: Wed Jul 01, 2015 3:17 am    Post subject: Reply with quote

eccerr0r wrote:
I used gparted which seems to work. I'm not sure how to make it perfectly set partitions at exact boundaries. It may be enough to move enough space for stage 1.5 in any case.

Thanks. I may give that a try after I muster up enough courage.
eccerr0r wrote:
Normally fdisk can detect the emulated 512 byte sector disks (and 4K real sector) in the "optimal" setting, which it did not here. It must be an older disk?

It's a Samsung 2TB HD204UI, purchased from Newegg on 7/9/2012.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Wed Jul 01, 2015 1:34 pm    Post subject: Reply with quote

Yeah it looks like that drive is one of the few that are actually AF/4K drives but does not report it properly. With partitions placed on 4K sector boundaries you should see some improvement in disk I/O throughput.

In either case I think it's safe enough just to move your boot partition's start sector (shrink + move) so you can solve the immediate problem at hand (since I suspect backing up your boot partition should not be too hard); but realigning the larger partitions to 4K boundaries is a bit more risky. Getting a full backup first is always a good idea. I'd get a new disk and partition the new disk on correct boundaries and copy to that new disk.

I'd not recommend using gparted on SSDs if anyone ends up finding this thread because their SSDs ended up with the same grub problem.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
cfgauss
Guru
Guru


Joined: 18 May 2005
Posts: 550
Location: USA

PostPosted: Wed Jul 01, 2015 2:17 pm    Post subject: Reply with quote

eccerr0r wrote:
...I'd get a new disk and partition the new disk on correct boundaries and copy to that new disk...

I think I'll take that road. Is there any reason not to get, say, a 4 or 6 TB drive?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Wed Jul 01, 2015 3:50 pm    Post subject: Reply with quote

http://www.ibm.com/developerworks/library/l-gpt/
_________________
Defund the FCC.
Back to top
View user's profile Send private message
stqn
n00b
n00b


Joined: 07 Apr 2015
Posts: 49

PostPosted: Thu Jul 02, 2015 11:57 pm    Post subject: Reply with quote

cfgauss wrote:

Thanks. I may give that a try after I muster up enough courage.

gparted has never caused me any trouble and I have several times resized partitions with it. Just tell it to leave 1 or 2 MiB before the partition, and you should be done…
Back to top
View user's profile Send private message
cfgauss
Guru
Guru


Joined: 18 May 2005
Posts: 550
Location: USA

PostPosted: Fri Jul 03, 2015 4:51 pm    Post subject: Reply with quote

DONAHUE wrote:
http://www.ibm.com/developerworks/library/l-gpt/

Many thanks. This is a wonderful and clear exposition of MBR/GPT in the Linux context by the developer of rEFInd and GPT fdisk.
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