The grub legacy (grub 0.97) supported LBA access, but since it was processing in 32-bit, it could only access up to 2 TiB.
By applying patches of the reference site below, it became accessible with 48-bit LBA and supported disks over 2 TiB. However, it didn't support the 64bit feature of ext4, so it couldn't access the recently created ext4 filesystem.
So I modified those patches based on the latest debian package that supports the 64bit feature of ext4.
- Required packages:
packaging-dev
,lzip
/ Preparation:sudo apt-get build-dep grub
(# in some directory)
git clone --depth 1 https://gist.github.com/h-yamamo/3556e57415541235f9c7c37a90642079
apt-get -d source grub
tar xf grub_0.97.orig.tar.gz
cd grub-0.97
tar xf ../grub_0.97-82.debian.tar.xz
tar xvf ../3556e57415541235f9c7c37a90642079/debian.tlz
(# you may edit debian/changelog and/or something others)
debuild -uc -us
By executing the following command while connected to the Internet, depends packages are also installed. (Specify the deb file name with an absolute path or a relative path.)
For example, run with root
privileges like this:
apt-get --no-install-recommends install ./grub-legacy_0.97-82+0~ext1_amd64.deb
If grub2
packages are installed, they will be removed.
Just installing the grub-legacy package does not set it up. The easiest way to set it up is to run the following command on the running debian OS.
Run with root
privilege:
grub-install '(hd0)'
For GPT disk supported by this extension, it works as follows:
-
Embed
stage1
image in the MBR (LBA 0) of the first disk. -
For
stage1_5
image, where to embed is determined by the following priorities.
- BIOS boot partition (
EF02
) found within 2 TiB
Embed stage1_5
in the beginning of its partition.
- First partition start after LBA 72
Embed stage1_5
after LBA 40.
- Other then those above
Don't use stage1_5
.
- At boot time,
/boot/grub/stage2
is finally executed.
- Using grub http://hyamamo.s292.xrea.com/geo-bay-3897/grub/grub.html (Japanese)
(old URL: http://www.geocities.jp/bay3897/grub/
old old URL: http://www.geocities.co.jp/SiliconValley-Bay/3897/grub/)