Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Extended file attributes: ext4
Date: Tue, 10 Apr 2012 17:03:31
Message-Id: CADPrc82BvOsV0h2rQbaRFd8z0LQOu=qQA6u7Mbh-tNsYdtG5rQ@mail.gmail.com
In Reply to: Re: [gentoo-user] Extended file attributes: ext4 by Stroller
1 On Tue, Apr 10, 2012 at 6:00 AM, Stroller
2 <stroller@××××××××××××××××××.uk> wrote:
3 >
4 > On 9 April 2012, at 13:04, Canek Peláez Valdés wrote:
5 >>>> …
6 >>>> This means ext4 mandatory if you want to use it, and this (usually)
7 >>>> means GRUB2, which is still considered beta.
8 >>>
9 >> …
10 >> Interesting. Do you have extents enabled in the filesystem? Mine does:
11 >>
12 >> # tune2fs -l /dev/sda4 | grep features
13 >> Filesystem features:      has_journal ext_attr resize_inode dir_index
14 >> filetype needs_recovery extent sparse_super large_file uninit_bg
15 >
16 > # df -Th
17 > Filesystem     Type      Size  Used Avail Use% Mounted on
18 > rootfs         rootfs    228G  5.8G  211G   3% /
19 > /dev/root      ext4      228G  5.8G  211G   3% /
20 > devtmpfs       devtmpfs  875M  212K  875M   1% /dev
21 > rc-svcdir      tmpfs     1.0M   60K  964K   6% /lib64/rc/init.d
22 > cgroup_root    tmpfs      10M     0   10M   0% /sys/fs/cgroup
23 > shm            tmpfs     876M     0  876M   0% /dev/shm
24 > # tune2fs -l /dev/root | grep extent
25 > 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
26 >
27 >> I was under the impression that GRUB legacy could not read ext4
28 >> filesystems with extents enabled; that was the primary reason I
29 >> migrated to GRUB2. I believe there is a patch for GRUB legacy which
30 >> adds ext4+extents support, but I don't think Gentoo applies it.
31 >
32 > No idea where it comes from, but you can see for yourself now you know to look.
33
34 OK, I went out and did my homework. GRUB legacy upstream doesn't
35 support ext4 partitions (using extents, of course; without extents,
36 they can be mounted as ext3), but Gentoo (as almost any other
37 distribution under the sun) applies a patch to support it. Actually,
38 it applies 37 patches, contained in grub-0.97-patches-1.12.tar.bz2,
39 one of them called 850_all_grub-0.97_ext4.patch, which says:
40
41 Gentoo bug #250829 - Include support for booting from ext4 partitions.
42
43 This is the respun and tested patch adapted from
44 http://code.google.com/p/grub4ext4/ so that it will apply with the rest of the
45 Gentoo patches.
46
47 Tested with:
48 /boot on ext2
49 /boot on ext3
50 /boot on ext4
51 / on ext4 (no seperate /boot)
52
53 Patch ported by Diego E. Pettenò (flameeyes)
54 Testing by Robin H. Johnson (robbat2)
55
56 Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@g.o>
57 Signed-off-by: Robin H. Johnson <robbat2@g.o>
58
59 So mistery solved: GRUB legacy in Gentoo supports ext4, but it differs
60 from upstream. When I was doing research for converting my filesystem
61 to ext4, everywhere I looked it said that GRUB legacy doesn't support
62 ext4... because it doesn't. Gentoo patches the sources, but upstream
63 GRUB legacy does not support ext4.
64
65 So I can finally stop telling people to migrate to GRUB2 if they want
66 to use ext4. Thanks Stroller.
67
68 Regards.
69 --
70 Canek Peláez Valdés
71 Posgrado en Ciencia e Ingeniería de la Computación
72 Universidad Nacional Autónoma de México