What is the name of the filesystem used for swap space?
feedback
|
migrated from stackoverflow.com Dec 8 '10 at 4:56
This question came from our site for professional and enthusiast programmers.
|
The problem is, for Unix and Linux, swap is not a filesystem because it does not contain files, file metadata, and/or a file directory hierarchy. What swap is, is a memory mapped area of disk. That memory mapped area of disk might be a partition, or a file, but within it are not files, but pages. For Linux, a swap partition on a PC formatted hard disk has a partition ID of 82. Once mkswap is run on it, the area inside is identified by having the text "SWAP_SPACE" or "SWAPSPACE2" in the last 10 bytes of the first page (usually 512 bytes). If a file is used, the internal structure is the same, but the file should be created without any holes (unfragmented). The dd command is used for this. | |||
|
feedback
|
|
Whatever the OS, the swap space isn't a file system as it doesn't contain files in the first place but pages. It isn't either structured hierarchically, if at all, like most filesystems are. | |||
|
feedback
|
|
You can read some notes about the makeup of the swap file here: | |||
|
feedback
|
