3.6. Other Linux Formats

For balance, this section lists formats used on Linux that don't qualify as file systems.

3.6.1. Linux Swap

Linux swap partitions must be formatted before use, although the format is quite simple. It has just two purposes: Marking the partition as okay for swapping with a signature, and keeping a list of bad blocks. Both are kept in the very first block. The block size is the architecture's page size and can be 4K or 8K.

There are two formats. The old one uses a bitmap in the first block to mark bad sectors, which limits it to around 128 MB on 4K-page architectures. Luckily, bad blocks are rare nowadays -- actually, most people won't touch a disk with even a single bad sector with a ten-feet pole. The new format uses a list of block numbers instead of a bitmap, thus lifting the size restriction.

Note that the two formats are known under various names. Sometimes they are called version 0 and 1, sometimes version 1 and 2. Since the new format uses "SWAPSPACE2" as its signature, disktype uses 1 and 2. The page size is determined from the position of the signature; it's at the end of the first page-sized block. The endianness can only be determined for the new (version 2) format, using the sub-version number field.

3.6.2. Linux LVM Physical Volumes

The Logical Volume Manager (LVM) allows file systems to span several disks and to be resized online. This works by adding real disk partitions (called physical volumes) to a pool (called a volume group). Logical volumes can be allocated from the pool in units called physical extents, usually 4 MB in size. The necessary mapping information is stored at the beginning of each physical volume, where it can be detected.

When disktype detects a LVM1 or LVM2 physical volume, it prints some details on the mapping, including the volume group name. The actual LVM mapping data is not interpreted at this time. Still, disktype attempts to detect any file system that happens to start on the first physical extent (LVM's allocation unit) of this physical volume.

3.6.3. Linux RAID Physical Disks

The Linux kernel includes a RAID layer implemented in software. It allows you to build a RAID array from commodity hardware. Recent revisions of Linux (i.e. 2.4.x) store all required information on the disks, enabling auto-detection at boot time. That feature is called "persistent superblocks".

The RAID superblock is stored at the end of the partition, so disktype can only find it if the size of the partition is known. Actual data starts at the beginning of the device, so the file system on the RAID may be detected as well if you hit the first disk of the set.

3.6.4. Debian Split Floppy

The installation system of Debian GNU/Linux splits large files (like the driver module .tar.gz) over several floppies. A special header is put in the boot sector to allow identification of the disks.