Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end
Partitioning a hard drive allows one to logically divide the available space into sections that can be accessed independently of one another. Partition information is stored within a hard drive's Master Boot Record.
An entire hard drive may be allocated to a single partition, or one may divide the available storage space amongst multiple partitions. A number of scenarios require creation multiple partitions: dual- or multi-booting, for example, or maintaining a swap partition. In other cases, partitioning is used as a means of logically separating data, such as creating separate partitions for audio and video files. Common partitioning schemes are discussed in detail below.
Users may create up to four primary partitions per hard drive. If additional partitions are required, a single extended partition can be created instead (that is, up to three primary partitions and one extended partition). An extended partition can be further divided into an unlimited number of logical partitions.
From Wikipedia:File system:
- A file system (or filesystem) is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device(s) which contain it. A file system organizes data in an efficient manner and is tuned to the specific characteristics of the device.
Some common file systems are:
- ext2/ext3/ext4 - File system used for GNU/Unix partitions
- FAT32 - File system used to store files, used by most USB or removable Devices. Mountable with
mountor other utilities (e.g Thunar#Thunar Volume Manager)
- NTFS - File system used by windows. Mountable with many utilities (e.g. NTFS-3G)
To control the actual partition scheme type:
# fdisk -l
- fdisk — Terminal partitioning tools included in Linux.
- cfdisk — A terminal partitioning tool written with ncurse libraries.
- GNU Parted — It allows to resize or to copy a partition (fdisk and cfdisk don't have this feature)
- Partitionmanager — Graphical tool written in QT.
- QtParted — Similar to Partitionmanager, available in AUR.
- GParted — Graphical tool written in GTK.
Partitions in a GNU/Unix system
The recommended partitions are / (root), /boot, /home and swap, but you can also add /usr and /var:
/ partition or root partition is necessary and it is the most important. The other partitions can be replaced by it, even thought have different partitions is recommended.
/boot directory contains the kernel and ramdisk images as well as the bootloader configuration file and bootloader stages. It also stores data that is used before the kernel begins executing user-space programs.
/boot is not required for normal system operation, but only during boot and kernel upgrades (when regenerating the initial ramdisk).
If kept on a separate partition,
/boot does not require a journaled file system. A separate
/boot partition is needed if installing a software RAID0 (stripe) system.
/home directory stores personal files in different folders. Keeping it in a separate partition can be very useful for backup: it often requires the most disk space (for desktop users) and may need to be expanded at a later date.
/home partition can also be shared with other Linux systems installed in multi boot, although this is not recommended becuase of possible incompatibilities between user configuration files.
The swap partition provides memory that can be used as virtual RAM. It is recommended for PCs with 1Gb or less of physical RAM.
/usr directory stores file that are shared by all users. A
/usr partition can be useful because it can be shared with others Linux OS.
In order to have a separate /usr partition, a mkinitcpio hook is required, as /usr is expected to be available at boot: see Mkinitcpio#/usr as a separate partition.
/var directory stores cache and log files. It is used for example for caching and logging, and hence frequently read or written. Keeping it in a separate partition avoids running out of disk space due to flunky logs, etc.
Partitioning during installation
The partitiong process is clearly explained here: Beginners' Guide#Prepare hard drive.
That is only a short summary. The available options are:
- Manually Partition Hard Drives
- Manually Configure block devices, filesystems and mountpoints
- Rollback last filesystem changes
The Auto-Prepare options formats the entire Hard Disk and divides it into 4 partitions:
- /boot (ext2 file system) with a size of 100Mb (editable)
- Swap with a size of 256Mb (editable)
/ partitions there are a lot of available files system (the same for both). A ext3 or ext4 file system is recommended and at least a size of 5Gb for the
Manually Partition Hard Drives
With this option the user can edit the partitions with the cfdisk tool. This option can be done before the installation, using other tools.
Manually Configure block devices, filesystems and mountpoints
With this option the user can manage the partition, setting file system and, overall, the role of each partition (