Difference between revisions of "Partitioning"

From gr0x0rd
Jump to navigation Jump to search
(Created page with "== Installing Gentoo - Partitioning == Linux has a very simple yet elegant tool to set up the partitions on your hard drive called fdisk. This is similar to the legacy dos-based…")
 
Line 6: Line 6:
  
 
Devices detected on the IDE subsystem are prefixed with ''hd'', whereas devices on the SATA subsystem are prefixed with ''sd''. If you are virtualizing Gentoo, chances are the virtual hard disk controller is IDE/ATA, so your virtual hard disk will be recognized as ''/dev/hda''. Most new systems utilize SATA drives so that is what we will use as an example in this guide. The first device detected via a SATA connection would be designated ''/dev/sda''.
 
Devices detected on the IDE subsystem are prefixed with ''hd'', whereas devices on the SATA subsystem are prefixed with ''sd''. If you are virtualizing Gentoo, chances are the virtual hard disk controller is IDE/ATA, so your virtual hard disk will be recognized as ''/dev/hda''. Most new systems utilize SATA drives so that is what we will use as an example in this guide. The first device detected via a SATA connection would be designated ''/dev/sda''.
 +
 +
''A note on partitions''
 +
 +
While many partitioning configurations are possible, this guide focuses on partitioning the primary hard disk into three partitions: a '''boot partition''', a '''swap partition''', and a '''root partition'''.
 +
 +
The '''boot partition''' is a small partition that houses your system boot manager, such as GRUB or LILO, and the Linux kernel. While it is possible to have the boot manager and kernel on the same partition as the root, it isn't advisable since if the partition becomes corrupt, or you overwrite your files, your system can no longer boot. Keeping a small, separate boot partition is an excellent way to ensure you'll be able to boot and perform maintenance on your system no matter what happens.
 +
 +
The '''swap partition''' is an area dedicated as a work area for the kernel. Its equivalent in Windows would be the pagefile, otherwise known as "virtual memory", which Windows will expand as it sees fit (often to the point of filling your disk). Obviously, the more swap space available to the kernel, the easier it will be for it to manage the swap space. Choosing the size of the swap partition also depends on how much RAM is installed in your system. If you don't have a lot of RAM, a bigger swap partition is advisable. In this example, we'll use a swap partition size of half a gigabyte: 512M.
 +
 +
To start fdisk and being partitioning your hard disk,
 +
'''#''' fdisk /dev/sda
 +
...where ''/dev/sda'' is the alias the system has assigned for your hard disk.

Revision as of 11:49, 16 November 2010

Installing Gentoo - Partitioning

Linux has a very simple yet elegant tool to set up the partitions on your hard drive called fdisk. This is similar to the legacy dos-based fdisk.exe application, with the exception that it is very fast, supports almost all hard disk devices, and actually works.

Before you can start partitioning, you need to determine what the system recognized your hard drive as during bootup. As you are probably aware, there are two primary hard drive types: IDE and SATA. IDE hard drives have a wide ribbon cable about 2 inches wide and a standard power connector, where SATA drives have a smaller cable attachment and different type of power connector. To accommodate multiple hard drives, the Linux kernel enumerates devices using letters. The first drive found on a subsystem is designated as a, the next b, and so on.

Devices detected on the IDE subsystem are prefixed with hd, whereas devices on the SATA subsystem are prefixed with sd. If you are virtualizing Gentoo, chances are the virtual hard disk controller is IDE/ATA, so your virtual hard disk will be recognized as /dev/hda. Most new systems utilize SATA drives so that is what we will use as an example in this guide. The first device detected via a SATA connection would be designated /dev/sda.

A note on partitions

While many partitioning configurations are possible, this guide focuses on partitioning the primary hard disk into three partitions: a boot partition, a swap partition, and a root partition.

The boot partition is a small partition that houses your system boot manager, such as GRUB or LILO, and the Linux kernel. While it is possible to have the boot manager and kernel on the same partition as the root, it isn't advisable since if the partition becomes corrupt, or you overwrite your files, your system can no longer boot. Keeping a small, separate boot partition is an excellent way to ensure you'll be able to boot and perform maintenance on your system no matter what happens.

The swap partition is an area dedicated as a work area for the kernel. Its equivalent in Windows would be the pagefile, otherwise known as "virtual memory", which Windows will expand as it sees fit (often to the point of filling your disk). Obviously, the more swap space available to the kernel, the easier it will be for it to manage the swap space. Choosing the size of the swap partition also depends on how much RAM is installed in your system. If you don't have a lot of RAM, a bigger swap partition is advisable. In this example, we'll use a swap partition size of half a gigabyte: 512M.

To start fdisk and being partitioning your hard disk,

# fdisk /dev/sda

...where /dev/sda is the alias the system has assigned for your hard disk.