2

I'm trying to tune my filesystem for some operations I have to do involving huge numbers of files. Then I got confused about what FS I'm even using.

tune2fs -l /dev/vda1 contains:

Filesystem magic number:  0xEF53

So that means it's either ext2, ext3 or ext4 because they share the same magic number.

blkid /dev/vda1 says:

/dev/vda1: UUID="c38b3343-603a-49d3-85e0-88af1c8617c5" TYPE="ext3" PARTUUID="1bf082a8-01"

/etc/fstab contains:

UUID=c38b3343-603a-49d3-85e0-88af1c8617c5 / ext3 (...)

mount (and /proc/mounts) says:

/dev/vda1 on / type ext3 (rw,relatime,errors=remount-ro,data=ordered)

Definitely seems like I'm using ext3.

But then, out of the middle of nowhere:

liam@lorenz /sys/fs % ls
cgroup  ext4  pstore

liam@lorenz /sys/fs % ls ext4
features  vda1

liam@lorenz /sys/fs % cd /proc/fs

liam@lorenz /proc/fs % ls
ext4 jbd2 nfsd

liam@lorenz /proc/fs % ls ext4
ext4

What is going on? It's been ext3 since this VM was built and was never converted or mounted as ext4.

uname -a:

Linux lorenz 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux
2

What is going on is that ext4 is ext3 is ext2. That is to say, they are the same filesystem, just with newer features enabled. Which features are enabled are described in the superblock. Since the ext4 driver supports all previous features, it can be used to mount all older filesystems with less features enabled. The kernel kept the original code for the ext2 and ext3 modules around so it can be used to mount older filesystems without the newer features enabled, but the ext4 module can also be used and most modern distributions build the kernel with a configuration option that sets it to use the ext4 driver for all 3 flavors of filesystem rather than carrying around the older, less capable code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.