Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the difference between a Partition and a Volume in Redhat Linux 5?

share|improve this question

migrated from stackoverflow.com Jul 16 '10 at 9:41

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 1 down vote accepted

A partition in Linux, is the same things as in other PC OS: a disk contains a partition table that contains the definition of the sliced sub-parts of the drive. The number of partition is limited by the BIOS/PC architecture.

Take a modern SATA drive /dev/sda. If you have 4 partitions they will be called:

  • /dev/sda1
  • /dev/sda2
  • /dev/sda3
  • /dev/sda4

You can create a file-system on those partitions (or on the whole drive).

In Linux, there is a volume manager, called LVM that let the kernel handle drives logically and not just physically. And the logic in LVM can do far more than juste separate a single drive into smaller parts. It can create a single volume over multiple drives, create snapshot, extend a volume, reduce it's size and more.

Two SATA disks (/dev/sda and /dev/sdb) of 300 Gb can be used to create a single volume of 600 Gb. You can turn partition or whole disk into physical volume handled by LVM:

pvcreate /dev/sda1
pvcreate /dev/sdb1

From those physical volumes you create a volume group:

vgcreate MyGroup /dev/sda1 /dev/sda2

So, MyGroup span over two drives. An almost infinite number of volumes can be created from there:

lvcreate --name VolumeMP3 --size 500Gb /dev/MyGroup
lvcreate --name Smaller --size 50Gb /dev/MyGroup

Volume can be used as old fashion partitions:

mkfs.ext4 /dev/MyGroup/Smaller
mount /dev/MyGroup/Smaller /mnt

During installation, RedHat handle those steps for you.

The downside of using LVM it's harder to repair a disk if you lose LVM internal data. So, it's better to backup the content of a volume than the disks themself (like using dd(1)).

share|improve this answer
    
Awesome answer!! Speechless...so well explained...it was just right for my level of knowledge!! Thanks :) –  strut Jul 23 '10 at 20:38

A partition is a given space on a hard drive designated by entering its offset and size into a partition table. A volume is an amount of storage which usually has filesystem structures on it to allow storing files.

A partition may be a volume, but is not required to be one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.