Difference between revisions of "Partitioning"

From ArchWiki
Jump to: navigation, search
m
Line 1: Line 1:
[[Category:File systems]]
+
[[Category:Storage]]
 
{{i18n|Partitioning}}
 
{{i18n|Partitioning}}
{{Article summary start}}
+
 
{{Article summary text|An overview of disk partitioning tools, best practices, and additional considerations.}}
+
{{Article summary start|Summary}}
 +
{{Article summary text| An overview of disk partitioning tools, best practices, and additional considerations.}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|fstab}}
 
{{Article summary wiki|fstab}}
Line 9: Line 10:
 
{{Article summary end}}
 
{{Article summary end}}
  
''Disk partitioning is the act of dividing a hard disk drive into multiple virtual hard disk drives, referred to as partitions, to treat one physical disk drive as if it were multiple disks.''
+
Disk partitioning is the act of dividing a hard disk drive into multiple virtual hard disk drives, referred to as partitions, to treat one physical disk drive as if it were multiple disks.
 +
-[[Wikipedia:Disk partitioning]]
 +
 
 +
==Partitioning tools==
 +
 
 +
To control the actual partition scheme type:
 +
{{bc|# fdisk -l}}
 +
 
 +
* fdisk - Terminal partitioning toolsincluded in Linux. Available in the package {{Pkg|util-linux}}.
 +
* cfdisk - A terminal partitioning tool written with ncurse libraries. Available in the package {{Pkg|util-linux}}.
 +
* 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.
 +
 
 +
==File system==
 +
[[Wikipedia:File system]]
  
: — [[Wikipedia:Disk partitioning]]
+
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.
 +
The most commons are:
 +
* NTFS - File system used by windows. Mountable with many utilities (e.g. [[NTFS-3G]] )
 +
* FAT32 - File system used to store files, used by most USB or removable Devices. Mountable with {{ic|mount}} or other utilities (e.g [[Thunar#Thunar_Volume_Manager]] )
 +
* ext2/ext3/ext4 - File system used for GNU/Unix partitions.
  
{{Tip|[[Beginners' Guide#Prepare hard drive]] gives a detailed instruction on how to set hard disk partition at installation. Also you can get a lot info about file system types.}}
+
==Partitions in a GNU/Unix system==
  
==Overview==
+
The recommended partitions are 4:
 +
* / (root)
 +
* /home
 +
* /boot
 +
* [[swap]]
 +
But you can add also:
 +
* /usr
 +
* /var
  
''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.
+
===/ (root)===
 +
The {{ic|/}} 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.
  
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.''
+
===/home===
 +
The {{ic|/home}} partition stores, in different folders, personal files. Very useful for backup, and it can be shared with other Linux distro (Not recommended becuase of possible incompatibilies.
  
==Partitioning schemes==
+
===/boot===
 +
The {{ic|/boot}} partiton is only required during the boot, it stores files of the Boot Manager (as [[Grub]]. Journaling is not required, and a separate {{ic|/boot} partition is needed if installing a software RAID0(stripe) system.
  
=== All-in-one ===
+
===[[Swap]]===
{{Expansion}}
+
The {{ic|swap}} paertition provides memory that can be used as virtual RAM. It's recommended for PCs with 1Gb or less of physical RAM.
One partition holds everything.
+
  
===Separate /boot===
+
===/usr===
* Only needed during boot and kernel upgrades (when regenerating the initial ramdisk)
+
The {{ic|/usr}} partition stores file that are shared by all users. A {{ic|/usr}} partition is very useful because it can be shared with others Linux OS.
* Not required for normal system operation
+
* Journaled filesystem not required
+
* Needed if installing a software RAID0(stripe) system.
+
  
===Separate /home===
+
===/var===
* Facilitates backups and multi-booting
+
The {{ic|/var}} partition stores cache and log files. It is frequently read or written.
* /home often requires the most disk space (for desktop users) and may need to be expanded at a later date
+
  
===Separate /var===
 
* Frequently read/written (logs, cache)
 
* Avoid running out of disk space due to flunky logs, etc.
 
  
===Separate /usr===
+
==Partitioning during installation==
{{Note|Requires a mkinitcpio hook, as /usr is expected to be available at boot.}}
+
The partitiong process is clearly explained here: [[Beginners' Guide#Prepare hard drive]].
* Can be shared between multiple systems
+
  
==Considerations==
+
That is only a short summary.
 +
The available options are:
 +
# Auto-Prepare
 +
# Manually Partition Hard Drives
 +
# Manually Configure block devices, filesystems and mountpoints
 +
# Rollback last filesystem changes
  
* Partition sizes <!-- separate section, or combined with schemes? -->
+
===Auto-Prepare===
* File systems
+
The Auto-Prepare options formats the entire Hard Disk and divides it into 4 partitions:
* LVM
+
-/boot (ext2 file system) with a size of 100Mb (editable)
 +
-Swap with a size of 256Mb (editable)
 +
-/home
 +
-/
  
==Creating new partitions==
+
For {{ic|/home}} and {{ic|/}} 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 {{ic|/}} partition.
{{Expansion}}
+
Any of the partitioning tools can be used to create new partitions.
+
  
==Resizing partitions==
+
N.B Using the "Auto-Prepare" option all files on the Hard disk will be deleted.
{{Expansion}}
+
  
== Partitioning tools ==
+
===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.
  
* fdisk & cfdisk
+
===Manually Configure block devices, filesystems and mountpoints===
* GNU Parted
+
With this option the user can manage the partition, setting file system and, overall, the role of each partition ({{ic|/}}, {{ic|/home}}, {{ic|/boot}}, {{ic|Swap}}, {{ic|/var}} or {{ic|/usr}}).
* QtParted & GParted
+

Revision as of 14:22, 7 June 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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

Disk partitioning is the act of dividing a hard disk drive into multiple virtual hard disk drives, referred to as partitions, to treat one physical disk drive as if it were multiple disks.

-Wikipedia:Disk partitioning

Partitioning tools

To control the actual partition scheme type:

# fdisk -l
  • fdisk - Terminal partitioning toolsincluded in Linux. Available in the package util-linux.
  • cfdisk - A terminal partitioning tool written with ncurse libraries. Available in the package util-linux.
  • 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.

File system

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. The most commons are:

  • NTFS - File system used by windows. Mountable with many utilities (e.g. NTFS-3G )
  • FAT32 - File system used to store files, used by most USB or removable Devices. Mountable with mount or other utilities (e.g Thunar#Thunar_Volume_Manager )
  • ext2/ext3/ext4 - File system used for GNU/Unix partitions.

Partitions in a GNU/Unix system

The recommended partitions are 4:

  • / (root)
  • /home
  • /boot
  • swap

But you can add also:

  • /usr
  • /var


/ (root)

The / 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.

/home

The /home partition stores, in different folders, personal files. Very useful for backup, and it can be shared with other Linux distro (Not recommended becuase of possible incompatibilies.

/boot

The /boot partiton is only required during the boot, it stores files of the Boot Manager (as Grub. Journaling is not required, and a separate {{ic|/boot} partition is needed if installing a software RAID0(stripe) system.

Swap

The swap paertition provides memory that can be used as virtual RAM. It's recommended for PCs with 1Gb or less of physical RAM.

/usr

The /usr partition stores file that are shared by all users. A /usr partition is very useful because it can be shared with others Linux OS.

/var

The /var partition stores cache and log files. It is frequently read or written.


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:

  1. Auto-Prepare
  2. Manually Partition Hard Drives
  3. Manually Configure block devices, filesystems and mountpoints
  4. Rollback last filesystem changes

Auto-Prepare

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) -/home -/

For /home and / 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 / partition.

N.B Using the "Auto-Prepare" option all files on the Hard disk will be deleted.

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 (/, /home, /boot, Swap, /var or /usr).