On Tue, Apr 10, 2012 at 6:00 AM, Stroller
<strol...@stellar.eclipse.co.uk> wrote:
>
> On 9 April 2012, at 13:04, Canek Peláez Valdés wrote:
>>>> …
>>>> This means ext4 mandatory if you want to use it, and this (usually)
>>>> means GRUB2, which is still considered beta.
>>>
>> …
>> Interesting. Do you have extents enabled in the filesystem? Mine does:
>>
>> # tune2fs -l /dev/sda4 | grep features
>> Filesystem features:      has_journal ext_attr resize_inode dir_index
>> filetype needs_recovery extent sparse_super large_file uninit_bg
>
> # df -Th
> Filesystem     Type      Size  Used Avail Use% Mounted on
> rootfs         rootfs    228G  5.8G  211G   3% /
> /dev/root      ext4      228G  5.8G  211G   3% /
> devtmpfs       devtmpfs  875M  212K  875M   1% /dev
> rc-svcdir      tmpfs     1.0M   60K  964K   6% /lib64/rc/init.d
> cgroup_root    tmpfs      10M     0   10M   0% /sys/fs/cgroup
> shm            tmpfs     876M     0  876M   0% /dev/shm
> # tune2fs -l /dev/root | grep extent
> Filesystem features:      has_journal ext_attr resize_inode dir_index 
> filetype needs_recovery extent flex_bg sparse_super large_file huge_file 
> uninit_bg dir_nlink
>
>> I was under the impression that GRUB legacy could not read ext4
>> filesystems with extents enabled; that was the primary reason I
>> migrated to GRUB2. I believe there is a patch for GRUB legacy which
>> adds ext4+extents support, but I don't think Gentoo applies it.
>
> No idea where it comes from, but you can see for yourself now you know to 
> look.

OK, I went out and did my homework. GRUB legacy upstream doesn't
support ext4 partitions (using extents, of course; without extents,
they can be mounted as ext3), but Gentoo (as almost any other
distribution under the sun) applies a patch to support it. Actually,
it applies 37 patches, contained in grub-0.97-patches-1.12.tar.bz2,
one of them called 850_all_grub-0.97_ext4.patch, which says:

Gentoo bug #250829 - Include support for booting from ext4 partitions.

This is the respun and tested patch adapted from
http://code.google.com/p/grub4ext4/ so that it will apply with the rest of the
Gentoo patches.

Tested with:
/boot on ext2
/boot on ext3
/boot on ext4
/ on ext4 (no seperate /boot)

Patch ported by Diego E. Pettenò (flameeyes)
Testing by Robin H. Johnson (robbat2)

Signed-off-by:  Diego E. 'Flameeyes' Pettenò <flamee...@gentoo.org>
Signed-off-by: Robin H. Johnson <robb...@gentoo.org>

So mistery solved: GRUB legacy in Gentoo supports ext4, but it differs
from upstream. When I was doing research for converting my filesystem
to ext4, everywhere I looked it said that GRUB legacy doesn't support
ext4... because it doesn't. Gentoo patches the sources, but upstream
GRUB legacy does not support ext4.

So I can finally stop telling people to migrate to GRUB2 if they want
to use ext4. Thanks Stroller.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Reply via email to