I have read that GRUB can read ext2 filesystems and has modules for doing this. What is the location of the mod on a Redhat system and how about if the /boot partition is ext3/ext4 or other filesystem type?

3 Answers
3

The grub ext2 module also understands ext3 and ext4, as the differences are minimal. The module itself is built into the grub core.img file ( when you are using ext[234] for /boot ), which is normally copied into the sectors following the master boot record, before any partitions start, and the code in the master boot record just loads those subsequent sectors.

@Adrian, they are relatively small, incremental changes that don't require many changes to the code to still be able to read. The only change that really takes any work at all is understanding extents.
–
psusiDec 26 '12 at 17:58

To answer the part of your question that's in the subject line, the executable code for this is kept in the initrd image. The initrd image can be loaded directly into the kernel at boot time, which is how the chicken/egg problem is solved for getting the code for reading ext partitions without needing to read the partition.

Regarding the filesystem choice for /boot.

Ext3 is backwards compatible with ext2 and primarily introduces journaling.

Ext4 is a major revision to the ext filesystem, brings many new features, and is not reversible without restoration of data and rebuilding the filesystem.

I don't really see a need to worry about using ext3/4 on /boot. I usually don't even bother with a separate /boot on my virtual machines and it works just fine as a part of my ext4 partitions. I wouldn't worry about using ext2 without journaling on /boot either, as you're not likely to have outstanding write operations going on in the /boot filesystem during a power cut unless you're upgrading your kernel.

The modules are kept in the usual place: /lib/modules//kernel/fs/. They're compiled into the initrd image for use by the kernel at boot time.

Update: Haven't found an official RedHat statement, but it's noted in Michael Jang's book that RHEL 6 no longer ext2 for /boot as ext4 is perfectly adequate and now the default filesystem for /boot. The Jang book also states that there are effectively NO differences between ext2 vs. ext3 except for journaling.