GENEXT2FS(8) | System Manager's Manual | GENEXT2FS(8) |
genext2fs - ext2 filesystem generator for embedded systems
genext2fs [ options ] [ output-image ]
genext2fs generates an ext2 filesystem as a normal (non-root) user. It does not require you to mount the image file to copy files on it, nor does it require that you become the superuser to make device nodes.
The filesystem image is created in the file output-image. If not specified, it is sent to stdout.
By default, the maximum number of inodes in the filesystem is the minimum number required to accommodate the initial contents. In this way, a minimal filesystem (typically read-only) can be created with minimal free inodes. If required, free inodes can be added by passing the relevant options. The filesystem image size in blocks can be minimised by trial and error.
genext2fs -b 1440 -d src /dev/fd0
All files in the src directory will be written to /dev/fd0 as a new ext2 filesystem image. You can then mount the floppy as usual.
genext2fs -b 1024 -d src -D device_table.txt flashdisk.img
This example builds a filesystem from all the files in src, then device nodes are created based on the contents of the file device_table.txt. Entries in the device table take the form of:
<name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
where name is the file name and type can be one of:
f A regular file d Directory c Character special device file b Block special device file p Fifo (named pipe)
An example device file follows:
# name type mode uid gid major minor start inc count /dev d 755 0 0 - - - - - /dev/mem c 640 0 0 1 1 0 0 - /dev/tty c 666 0 0 5 0 0 0 - /dev/tty c 666 0 0 4 0 0 1 6 /dev/loop b 640 0 0 7 0 0 1 2 /dev/hda b 640 0 0 3 0 0 0 - /dev/hda b 640 0 0 3 1 1 1 16 /dev/log s 666 0 0 - - - - -
This device table creates the /dev directory, a character device node /dev/mem (major 1, minor 1), and also creates /dev/tty, /dev/tty[0-5], /dev/loop[0-1], /dev/hda, /dev/hda1 to /dev/hda15 and /dev/log socket.
This manual page was written by David Kimdon <dwhedon@debian.org>, for the Debian GNU/Linux system (but may be used by others). Examples provided by Erik Andersen <andersen@codepoet.org>.
August 19, 2006 |