erofs - Linux
Overview
erofs is a command-line tool for manipulating Enhanced Read-Only File Systems (EROFS). An EROFS is a compressed, read-only file system designed for high-performance read operations, often used in embedded systems and other scenarios where fast boot times and minimal storage space are crucial.
Syntax
erofs [options] <command> [<command-args>]
Options/Flags
- -h, –help: Print usage information and exit.
- -V, –version: Print version information and exit.
- -v, –verbose: Enable verbose output.
- -q, –quiet: Suppress all output except for errors.
- -z, –compression-level: Set the compression level (0-9).
- -b, –block-size: Set the block size (default: 4096 bytes).
- -s, –inodes-per-block: Set the number of inodes per block (default: 16).
- -d, –device: Specify the device node or file to operate on.
Examples
Create an EROFS
erofs -z 3 -b 8192 -s 32 -d /dev/sda1 create /path/to/erofs.img
Mount an EROFS
mount -t erofs /path/to/erofs.img /mnt/erofs
Unmount an EROFS
umount /mnt/erofs
Check EROFS integrity
erofs -v check /path/to/erofs.img
Common Issues
- EROFS file system not found: Ensure that the specified device or file exists and is formatted as an EROFS.
- Insufficient space: Ensure that the target device or file has enough space to accommodate the EROFS.
- Permission denied: Check that you have sufficient permissions to create, mount, or unmount the EROFS.
Integration
erofs can be integrated with other tools for advanced tasks, such as:
- mke2fs: Create an EROFS image using a kernel-provided library.
- mkfs.ext4: Create an EROFS image using the ext4 file system library.
- dd: Copy an EROFS image to or from a device or file.
Related Commands
- mount: Mount an EROFS file system.
- umount: Unmount an EROFS file system.
- e2fsck: Check the integrity of an EROFS file system.