There are misconceptions behind your questions.
- Swap is not mounted.
- Mounting isn't limited to partitions.
A partition is a slice¹ of disk space that's devoted to a particular purpose. Here are some common purposes for partitions.
- A filesystem, i.e. files organized as a directory tree and stored in a format such as ext2, ext3, FFS, FAT, NTFS, …
- Swap space, i.e. disk space used for paging (and storing hibernation images).
- Direct application access. Some databases store their data directly on a partition rather than on a filesystem to gain a little performance. (A filesystem is a kind of database anyway.)
- A container for other partitions. For example, a PC extended partition, or a disk slice containing BSD partitions, or an LVM physical volume (containing eventually logical volumes which can themselves be considered partitions), …
Filesystems present information in a hierarchical structure. Here are some common kinds of filesystems:
- Disk-backed filesystems, such as ext2, ext3, FFS, FAT, NTFS, …
- The backing need not be directly on a disk partition, as seen above. For example, this could be an LVM logical volume, or a loop mount.
- Memory-backed filesystems, such as Solaris and Linux's tmpfs.
- Filesystems that present information from the kernel, such as
sysfs on Linux.
- Network filesystems, such as NFS, Samba, …
- Application-backed filesystems, of which FUSE has a large collection. Application-backed filesystems can do just about anything: make an FTP server appear as a filesystem, give an alternate view of a filesystem where file names are case-insensitive or converted to a different encoding, show archive contents as if they were directories, …
Unix presents files in a single hierarchy, usually called “the filesystem” (but in this answer I'll not use the word “filesystem” in this sense to keep confusion down). Individual filesystems must be grafted onto that hierarchy in order to access them.³
You make a filesystem accessible by mounting it. Mounting associates the root directory of the filesystem you're mounting with a existing directory in the file hierarchy. A directory that has such an association is known as a mount point.
- For example, the root filesystem is mounted at boot time (before the kernel starts any process²) to the
- The proc filesystem over which some unix variants such as Solaris and Linux expose information about processes is mounted on
/proc, so that
/proc/42/environ designates the file
/42/environ on the proc filesystem, which (on Linux, at least) contains a read-only view of the environment of process number 42.
- If you have a separate filesystem e.g. for
/home/john/myfile.txt designates the file whose path is
/john/myfile.txt from the root of the home filesystem.
Under Linux, it's possible for the same filesystem to be accessible through more than one path, thanks to bind mounts.
A typical Linux filesystems has many mounted filesystems. (This is an example; different distributions, versions and setups will lead to different filesystems being mounted.)
/: the root filesystem, mounted before the kernel loads the first process. The bootloader tells the kernel what to use as the root filesystem (it's usually a disk partition but could be something else such as an NFS export).
/proc: the proc filessytem, with process and kernel information.
/sys: the sysfs filesystem, with information about hardware devices.
/dev: an in-memory filesystem where device files are automatically created by udev based on available hardware.
/dev/pts: a special-purpose filesystem containing device files for running terminal emulators.
/dev/shm: an in-memory filesystem used for internal purposes by the system's standard library.
- Depending on what system components you have running, you may see other special-purpose filesystems such as
binfmt_misc (used by the foreign executable file format kernel subsystem),
fusectl (used by FUSE),
nfsd (used by the kernel NFS server), …
- Any filesystem explicitly mentioned in
/etc/fstab (and not marked
noauto) is mounted as part of the boot process.
- Any filesystem automatically mounted by HAL (or equivalent functionality) following the insertion of a removable device such as a USB key.
- Any filesystem explicitly mounted with the
¹ Informally speaking here.
² Initrd and such are beyond the scope of this answer.
³ This is unlike Windows, which has a separate hierarchy for each filesystem, e.g.