Skip to contentSkip to conversation

Current Grub2 & problem with /boot on different drive

DISCUSSION Dean Loros 3 participants 5 messages Sep 20, 2009 – Sep 21, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dean Loros

author
#1 lore raw

Greetings--

Ubuntu has been testing Grub2 for a number of months now & a "interesting" problem has surfaced. If your /boot is on a different drive than the MBR, you will have several minutes of drive use before you get to the Grub2 menu. My current timing is 3min 50sec to menu--this is with a i7-920 system with four internal drives--all SATA-II. My first bug report on Launchpad was dated 8-28-2009 & this had started a few days earlier. Before that date, Grub2 would take only 3~5 seconds to get to menu. Updates after this have not cured this issue. The current "work-around" in the bug report is to re-set MBR & /boot to the first drive. This problem only shows up in multi-boot/multi-drive systems.

During the 3+ minutes, there is constant drive activity. Colin had asked at one time for me to do a debug run which was one of the most painful times I have had in current memory--the system worked for more than 20min without going to menu & required booting with a LiveCD to repair problems from the outside.

It looks like Grub2 needs to scan all the drives for all the supported filesystems several times before it "finds" the /boot that works. I will also note that I do not have any other grub installs other than my main Grub2 install, so there is only one /boot in the system. MBR is on SDA (storage drive)--I also have one install on SDB, my /boot is on SDC with a second install & two more operating systems are on SDD for a total of five operating systems (Two testing Karmic & several other installs).

My thought is: Is there a way to "tag" the Grub2 /boot so time to locate is acceptable? Or is there another way to scan filesystems? Maybe a way to "tag" the type of filesystem in use?

Bug report is: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/420933
With supporting information. IF you need more information or want me to do further testing, please contact me @ ubuntu1user at gmail.com

Thank you for your time in this matter.

Signature · 3 lines
Dean Loros
autocrosser at ubuntuforums.org
Performance by Design Ltd.
#2 lore raw
Quoted 14 lines · Dean Loros

Greetings--

Ubuntu has been testing Grub2 for a number of months now & a "interesting" problem has surfaced. If your /boot is on a different drive than the MBR, you will have several minutes of drive use before you get to the Grub2 menu. My current timing is 3min 50sec to menu--this is with a i7-920 system with four internal drives--all SATA-II. My first bug report on Launchpad was dated 8-28-2009 & this had started a few days earlier. Before that date, Grub2 would take only 3~5 seconds to get to menu. Updates after this have not cured this issue. The current "work-around" in the bug report is to re-set MBR & /boot to the first drive. This problem only shows up in multi-boot/multi-drive systems.

We have theoretically discussed this problem with Robert but weren't sure if instances of it exist. The problem is that (UUID=..) syntax rescans all drives on every access. We devised a solution to split search.mod into search_uuid.mod, search_file.mod and so on but we agreed that it will be done after 1.97 due to amount of changes it requires. I'm ok to implement it, it's not much work but I can't make any promises about my current disponibility.
As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number
2) Modify scripts to hardcode boot device and not use UUID. If you change disk order it will result in boot failure but it may be a local workaround
3) add search -s -u <UUID> as first command of your grub.cfg

#3 lore raw
Quoted 5 lines · Vladimir 'phcoder' Serbinenko

As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number

I'm a little baffled. Why does the disk cache size make a difference here? He has four disks - I'd have thought that 1021 would be plenty.

Signature · 1 line
Colin Watson                                       [[email protected]]
#4 lore raw
Quoted 9 lines · Colin Watson
Quoted 6 lines · Vladimir 'phcoder' Serbinenko

As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number

Quoted 4 lines

I'm a little baffled. Why does the disk cache size make a difference here? He has four disks - I'd have thought that 1021 would be plenty.

1021 is the number of cached 4KiB blocks and is used in hash calculations. If he has a lot of cache misses it will result in long boot times

#5 lore raw
Quoted 8 lines · Vladimir 'phcoder' Serbinenko
Quoted 7 lines · Colin Watson
Quoted 5 lines · Vladimir 'phcoder' Serbinenko

As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number

Quoted 6 lines
Quoted 2 lines

I'm a little baffled. Why does the disk cache size make a difference here? He has four disks - I'd have thought that 1021 would be plenty.

1021 is the number of cached 4KiB blocks and is used in hash calculations. If he has a lot of cache misses it will result in long boot times

Do you have a recommendation for a new value? I can build a test package and ask Dean to try it out.

Signature · 1 line
Colin Watson                                       [[email protected]]