Translation(s): English - Italiano
ext4 (fourth extended filesystem) is a journaling file system for Linux, developed as the successor to ext3.
Contents
Compatibility
ext4 is the default filesystem for Debian since Debian 8 Jessie (2018-06-17).
ext2 and ext3 filesystems can be upgraded to ext4 (but not the other way around).
It is not possible to mount ext4 filesystems with the ext3 kernel driver (with some exceptions).
File system check
ext4 is a journaling file system, meaning it maintains a journal of operations not yet committed to disk, and is able to prevent some amount of data loss after a system crash or power failure. If an ext4 filesystem is determined "unclean" on boot (traces of remaining operations in the journal), the system will run fsck and attempt to repair the filesystem, and write uncommited blocks to the lost+found/ directory. At the very least, the filesystem will be restored to a working state.
With systemd, the old method touch /forcefsck no longer works to force a filesystem check on next boot. Instead you have to edit /etc/default/grub and add fsck.mode=force to your kernel command line:
GRUB_CMDLINE_LINUX="fsck.mode=force"
Then do an update-grub and reboot. Afterwards, remove the fsck.mode=force option and update-grub again.
Old Debian releases
ext4 was introduced in kernel 2.6.28. Previous kernels had a development/experimental implementation of ext4 (ext4dev). Old Debian releases (i.e. Lenny, kernel 2.6.26 and earlier) don't support ext4, or only support it in an experimental, read-only mode:
tune2fs -E test_fs /dev/XXX mount -t ext4dev -o ro /dev/XXX /mnt/ZZZ
See also
Manual pages: mkfs.ext4.8, tune2fs.8, resize2fs.8, e4defrag.8
CategoryKernel | CategoryStorage | CategorySystemAdministration