4

Is the ext2 filesystem good for /boot partition? I set ext4 for / root partition, but wasn't sure which filesystem to select for the /boot partition, and I just set ext2. Does it matter in this case?

2
  • Yes, ext2 is perfectly suited for boot.
    – Jan
    Commented Sep 21, 2014 at 21:23
  • 2
    Why not just use ext4? Commented Sep 21, 2014 at 21:29

2 Answers 2

6

It only matters if you're going to use the ancient GRUB, ext4 is only supported by GRUB2.

ext2 is simple, robust and well-supported, which makes it a good choice for /boot.

6
  • Does ext2 use less space compare with ext4, as ext2 does not maintain a journal?
    – Lexx Luxx
    Commented Sep 21, 2014 at 22:24
  • Yes, this is correct.
    – Jan
    Commented Sep 22, 2014 at 6:45
  • 2
    Does Ext2 still acceptable for /boot partition of SSD disk, as Ext2 does not support TRIM? (and TRIM function is very important for SSD disk for efficient performance).
    – Lexx Luxx
    Commented Sep 23, 2014 at 17:43
  • Please open a new question
    – Jan
    Commented Sep 23, 2014 at 21:22
  • @triwo Your /boot partition (1) should not be that large and (2) not change very often, so not using TRIM is unlikely to have any noticeable detrimental effects.
    – cdhowie
    Commented Aug 11, 2018 at 14:38
2

summary: ext2 is a bad choice for /boot, since (unless I'm missing something or am very unlucky) it appears to prevent "normal" update of GRUB2.

details:

Today I was updating a 2010-vintage laptop that

  • runs a Debian distro (LMDE2)
  • shipped with win7, which I dualbooted with an unmanaged Linux /boot partition and a managed (LVM2-on-LUKS) partition:

    $ sudo fdisk -l
    Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    ...
    Device     Boot     Start       End   Sectors  Size Id Type
    /dev/sda1            2048  34818047  34816000 16.6G 27 Hidden NTFS WinRE
    /dev/sda2  *     34818048 239618047 204800000 97.7G  7 HPFS/NTFS/exFAT
    /dev/sda3       239618048 240642047   1024000  500M 83 Linux
    /dev/sda4       240642048 976773119 736131072  351G  5 Extended
    /dev/sda5       240644096 976773119 736129024  351G 83 Linux
    
    
    $ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    /dev/dm-2                     20G   12G  7.2G  62% /
    ...
    /dev/sda3                    485M   73M  387M  16% /boot
    /dev/mapper/LVM2_crypt-home  322G  292G   31G  91% /home
    

I.e., /dev/sda5 ~= /dev/dm-2: it's a LUKS-encrypted partition on which LVM2 manages partitions for root, swap, and home.

$ mount | grep -e '^/dev/'
/dev/sda3 on /boot type ext2 ...
/dev/mapper/LVM2_crypt-root on / type ext4 ...
/dev/mapper/LVM2_crypt-home on /home type ext4 ...

(Note the /dev/sda3 on /boot type ext2 above.) My experience today doing a package update/upgrade (on a debian box, if that makes a difference):

The package manager wanted to update the kernel, GRUB, and libc; to be specific, the packages

base-files
grub-common
grub-pc
grub-pc-bin
grub2-common
linux-compiler-gcc-4.8-x86
linux-headers-3.16.0-4-amd64
linux-headers-3.16.0-4-common
linux-image-3.16.0-4-amd64
linux-kbuild-3.16
linux-libc-dev

Package install appeared to be going well until

Setting up grub-common (2.02~beta2-22+deb8u1) ...
Setting up grub2-common (2.02~beta2-22+deb8u1) ...
Setting up grub-pc-bin (2.02~beta2-22+deb8u1) ...
Setting up grub-pc (2.02~beta2-22+deb8u1) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..

At about this point, my console went to character-mode-graphics to present a dialog with title=Configuring grub-pc and body=

GRUB failed to install to the following devices:

/dev/dm-2

Do you want to continue anyway? If you do, your computer may not start up properly.

Writing GRUB to boot device failed - continue?

I hit button=No, and would now like to know how to {best, least destructively}

  1. update my /boot from ext2
  2. update GRUB2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .