Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2005-07-20 11:18:59
Size: 577
Editor: anonymous
Comment:
Revision 6 as of 2005-08-07 06:13:04
Size: 2755
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Partitioning is a means to divide a single hard drive into many logical drives. A partition is a contiguous set of blocks on a drive that are treated as an independant disk. A partition table  is an index that relates sections of the hard drive to partitions. Partitioning is a means to divide a single hard drive into many logical drives. A partition is a contiguous set of blocks on a drive that are treated as an independent disk. A partition table is an index that relates sections of the hard drive to partitions.
Line 4: Line 4:
==== Definitions ====
 * Primary partition - A disk can have up to 4 primary partitions. It cannot have more that 4 due to limitations of the disk primary partition table. To get around this limitation, an extended partition may be used.
 * Extended partition - A special primary partition that is subdivided into logical partitions. There can be no more than 1 extended partition on a disk.
 * Logical partition - A partition residing on an extended partition

==== Partition Naming ====
{{{
   /dev/hda1 The 1st primary partition
   /dev/hda2 The 2nd primary partition
   /dev/hda3 The 3rd primary partition
   /dev/hda4 An extended partition
   /dev/hda5 The 1st logical partition
   /dev/hda6 The 2nd logical partition
   etc...
}}}

In this example, /dev/hda4 is the extended partition. All the logical partitions reside on an extended partition.

==== LVM ====
If you're not sure what size to make your partitions, using a small ext3 {{{/boot}}} partition and lvm2-based partitions for the rest can be a good idea. The advantage of lvm is that it makes resizing more practical. In the DebianInstaller partition manager each logical volume is treated as if it were a disk in which you make partitions.

I assign a single partition per logical volume. Then when I want to increase the size of a partition, I umount the donor and recipient partitions, resize (shrink) the donor partition, resize (shrink) the donor logical volume, resize (grow) the recipient logical volume, resize (grow) the recipient partition, and finally remount. This may sound the same as with e2fsresize on regular partitions, but it's not.

Ext2/3 partition cannot be moved, so you can only gain space by shrinking the preceding partition, deleting the partition to grow, and recreating it larger, or by removing the following partition, increasing the size of the current partition, and recreating the following partition. With lvm2 the space comes from whatever logical volume you choose to shrink. lvm handles the details of where on the disk the partition blocks actually are.

Good Luck! -DD


=== See Also ===
 * DiskPartitioning
 * ["Fdisk"]
 * ["SoftwareRAID"] on debian

=== External Links ===
Line 7: Line 41:
 * ["Fdisk"]

 * ["SoftwareRAID"] on debian

Partitioning is a means to divide a single hard drive into many logical drives. A partition is a contiguous set of blocks on a drive that are treated as an independent disk. A partition table is an index that relates sections of the hard drive to partitions.

Definitions

  • Primary partition - A disk can have up to 4 primary partitions. It cannot have more that 4 due to limitations of the disk primary partition table. To get around this limitation, an extended partition may be used.
  • Extended partition - A special primary partition that is subdivided into logical partitions. There can be no more than 1 extended partition on a disk.
  • Logical partition - A partition residing on an extended partition

Partition Naming

   /dev/hda1      The 1st primary partition
   /dev/hda2      The 2nd primary partition
   /dev/hda3      The 3rd primary partition
   /dev/hda4      An extended partition
   /dev/hda5      The 1st logical partition
   /dev/hda6      The 2nd logical partition
   etc...

In this example, /dev/hda4 is the extended partition. All the logical partitions reside on an extended partition.

LVM

If you're not sure what size to make your partitions, using a small ext3 /boot partition and lvm2-based partitions for the rest can be a good idea. The advantage of lvm is that it makes resizing more practical. In the DebianInstaller partition manager each logical volume is treated as if it were a disk in which you make partitions.

I assign a single partition per logical volume. Then when I want to increase the size of a partition, I umount the donor and recipient partitions, resize (shrink) the donor partition, resize (shrink) the donor logical volume, resize (grow) the recipient logical volume, resize (grow) the recipient partition, and finally remount. This may sound the same as with e2fsresize on regular partitions, but it's not.

Ext2/3 partition cannot be moved, so you can only gain space by shrinking the preceding partition, deleting the partition to grow, and recreating it larger, or by removing the following partition, increasing the size of the current partition, and recreating the following partition. With lvm2 the space comes from whatever logical volume you choose to shrink. lvm handles the details of where on the disk the partition blocks actually are.

Good Luck! -DD

See Also