61

What do these terms mean exactly?

  1. partition
  2. volume
  3. drive

On Windows, one may say drive C: or partition C:. On Linux I'm not sure what should be used for partitions because they don't have a name.

  • 2
    I'll be glad if you can give me definition links. I think there's not comparable definitions in Wikipedia. – user44920 Aug 22 '13 at 5:13
  • Something I found practically useful with a very nice example. Its probably a bit old but explains the basics well - tldp.org/HOWTO/LVM-HOWTO/benefitsoflvmsmall.html – Zaid Khan Aug 20 '16 at 4:00
56

The term drive refers to a physical storage device such as a hard disk, solid-state disk, removable USB flash drive etc. In Unix-like operating systems devices are represented by special file system objects called device nodes which are visible under the /dev directory.

Storage devices are labeled under /dev according to the type of device followed by a letter signifying the order in which they were detected by the system. In Linux prior to kernel version 2.6.20 the prefix hd signified an IDE device, so for instance the device files /dev/hda, /dev/hdb and /dev/hdc corresponded to the first, second and third IDE device respectively. The prefix sd was originally used for SCSI devices, but is now used for all PATA and SATA devices, including devices on a IDE bus. If there are more than 26 such devices in the system, devices from the 27th onwards are labeled /dev/sdAa, /dev/sdAb and so on.

A physical storage device can be divided into multiple logical storage units known as partitions. Each partition will show up under /dev as a separate device node. A number after the device letter signifies the number of the partion, so for example the device node files /dev/sda1 and /dev/sda2 refer to the first and second partition of the first PATA device. Note that on PCs using MBR partitioning, due to the limit of four primary paritions and the way extended partitions are handled the partition numbering can slightly differ from the actual partition count.

Other Unix-like systems may refer to disks and partitions in other ways. For example, FreeBSD uses /dev/adaX (where X is one or more digits) to refer to PATA disks and /dev/adaXpY (where X and Y are both one or more digits) to refer to partitions on PATA disks.

The term volume in Linux is related to the Logical Volume Manager (LVM), which can be used to manage mass storage devices. A physical volume is a storage device or partition. A logical volume created by the LVM is a logical storage device which can span multiple physical volumes.

  • What you wrote says: "drive" can refer to both 1) whole hard disk with all it's partitions and 2) a partition. So a drive is the same as a physical volume! right? – user44920 Aug 19 '13 at 6:46
  • 2
    @MinimusHeximus The term "drive" is not (at least generally) used to refer to a single partition. However, a partition is normally exposed as a device node. Note the difference between a (possibly physical) device (which is electrically hooked up to the computer) and the corresponding (possibly set of) device node(s) (which is a logical construct that on *nixes you'll find in /dev). I've edited the answer to hopefully clarify and at least accentuate this difference. – a CVn Aug 19 '13 at 7:17
  • 2
    /dev/null is also a device node. So is /dev/tty and /dev/pts/0. That doesn't necessarily mean there's a physical device on the other end of the name. – a CVn Aug 19 '13 at 8:39
11
  1. A drive is a physical block disk. For example: /dev/sda.

  2. A partition A drive can be divided into some logic block disk. These logic block disk are named partition. For example: /dev/sda1, /dev/sda2.

  3. A volume is also a logic block disk. Volume is a concept involved with partition. A volume can contain many partition. You can take a look at LVM project to understand the concept of a volume. http://sourceware.org/lvm2/.

For example: vg0/lvol0

6

What do these terms mean exactly?

TLDR version:

Volume implies formatting and partition does not. A partition is just any continuous set of storage sectors listed in some table (e.g. MBR/GPT). A volume is a set of sectors belonging to the same filesystem, i.e. an implemented filesystem.

If you've formatted your partitions without an LVM, then each of your partitions is probably occupied by a single volume. In modern usage a drive is the set of all sectors belonging to a single piece of (virtual) hardware, from the perspective of the operating system.

So we partition drives and format partitions and mount volumes.

On Windows, one may say drive C: or partition C:

Actually, on Windows the correct wording is "C volume" though I think they can be renamed if you don't like using letters. MS sometimes refers to mounted volumes as disks or drives, but in their online documentation they are more careful and use "volume".

Full answer:

I'm not sure what should be used for partitions because they don't have a name [tag or label]

(A minor sidenote here is that GPT partitions can be labeled, as can most filesystems)

Conventionally partitions are formatted with a single complete volume and are named after their purpose. So you can call them [purpose + partition], e.g. home partition, boot partition, rootfs partition, etc. On Windows the word "drive" is more common, though officially MS uses the word volume which is probably the most correct. I think calling them drives is a bit sloppy. Read on for why.

Etymologically, "drive" originates from motorized hardware that read various media like tapes, floppies and disks. So the things that held the data-containing media were called 'drives' for short. To emphasize: drives read media, media held data. Though "drive" probably stems from the motorized nature of the hardware, the definition could be stretched to include non-motorized hardware like a flash card reader.

This means technically drives themselves can't be partitioned. The media they contain, such as a cd or magnetic disks or MMC flash memory, can be partitioned. Partitioning only means defining sets of borders (by media sector) in a table. The table typically gets stored in the first few sectors of the storage medium. These table entries may also include other stuff like formatting information, which defines what filesystem a partition uses (if any).

Nowadays "drive" has gained the more abstract meaning of 'physical data container', replacing the word "disk" somewhat. This is probably because:

  • The most common drives tend to have non-removable media, making us think of them as storage containers instead of read/write devices.

  • The advent of non-disk media like flash memory. "Disk" is too specific to a type of technology, e.g. it feels odd talking about disks with a USB stick. This also applies to logical devices (RAID arrays), which have become more common. Instead of using specific words for each type, we call everything a drive.

  • The media/reader distinction wasn't very useful. More often we want to refer to the media, though the OS interfaces with the drive. So it is enough to know that we use drives to access data. Making "drive" an abstract concept for storage media was just part of the evolution of CS jargon.

According to this newer definition, drives can be partitioned. When we refer to an optical disk reader as our E:\ drive we are using the old definition. When we say we're partitioning a drive we are using the newer definition.

A volume is a single accessible storage area with a single file system. --Wikipedia

So a formatted partition may be considered a type of volume. Traditionally a DVD or CD consists of a single volume, as they do not have partitions. But a volume may also consist of multiple drives, or non-continuous parts of a single drive, or both. A partition is by definition a continuous segment of a single drive. Such complex volumes exist on so-called logical or virtual devices/drives, but unless you have a good reason, using logical volume managers isn't worth the hassle.

Lastly, some hardware (e.g. RAID) controllers may present a logical/virtual device directly to the operating system. This means partitions are continuous sectors of a logical device (i.e. from the OS perspective), the partitions could span several physical disks.

To sum up:

  • You can partition storage media, not drives. But(!) "drive" is often used synonymously with storage media. E.g. "partitioning a HDD" is a commonly used phrase, instead of the more correct "partitioning the HDD storage media", or "partitioning the HD".
  • It would be better to say we create partitions on drives, since it can be said that storage resides on or in a drive. Note that data is not partitioned either, "data" is an abstract concept.
  • We mount volumes, not filesystems. A filesystem just describes the abstract format of file/folder storage.
  • A drive (i.e. storage medium) with partitions has a single partition table, but don't assume that every C: or D: 'drive' (volume) on Windows has its own partition table.
  • 1
    (1) "We mount partitions, not filesystems." is it more accurate to say "We mount volumes, not filesystems."? (2) In the output of mount, each line has the format of "A on B type C", does A mean a volume or a partition? – Tim Jan 20 '16 at 4:11
  • (1) my question is: is "mounting a partition" less accurate than "mounting a volume"? (3) new question: An extended partition is divided into logical partitions, while a primary partition doesn't have to. Is a "logical partition" a volume, but not actually a partition? – Tim Jan 20 '16 at 16:25
  • @Tim 3) Seems so. According wikipedia those logical partitions are called volumes. It seems the word partition is specially reserved for the entries in the partition table of the storage medium (i.e. drive). Extended partitions have their own separate MBR that contains the logical volumes. Since those entries are not in the 'main MBR' they are not really partitions in the formal sense. They are "partitions of a partition" or sub-partitions if you like. – jiggunjer Jan 21 '16 at 2:02
  • Thanks. (1) Is it correct that in the following ordering of the concepts, a concept is implemented based on (or above) the concept before it: device, partition, volume, and filesystem? (2) You wrote that "some hardware (e.g. RAID) controllers may present a logical/virtual device directly to the operating system. It is hard to define if partitions created on those drives are called volumes or partitions." Where is the position of a "logical/virtual device" in the list/ordering in (1)? – Tim Jan 21 '16 at 3:35
  • 1
    @Tim I think the concept of volume isn't based on partitions per se. Simply put a volume is storage with a filesystem. A partition can be unformatted, in which case I suppose it is not a volume. If partitions hadnt been invented we'd still have volumes (albeit large ones). Also I'd say drive instead of device. – jiggunjer Jan 21 '16 at 7:35
1

Well, in Linux also partitions do have a name. Suppose you have a HDD, it'll be called sdX (X being a,b and so on depending upon drive numbers) and in turn partitions will be named as sda1, sda2 and so on.

You can look them up in /dev, it'll show all device files of your system.

  • Note: /dev is not a partition. It is a mountpoint for a virtual file system called (IIRC) devfs. – strugee Aug 19 '13 at 6:17
  • yeah, sorry I phrased it wrong. – vknha Aug 19 '13 at 6:19
  • 2
    /dev is these days usually managed by udev, which is the successor to devfs. – Thomas Nyman Aug 19 '13 at 6:20
1

A single volume can be composed of several drives. This is the case when you have a Raid 0 configuration. All of the drives = a single volume.

0

A Disk = A block device = A storage device, e.g. SSD, hard disk

A section of a storage device is called as partition which is in no way filesystem that what is done to it via OS.

As to meaning of the volume, there are 2 types either physical or logical.

A physical volume from the point of view of your computer a physical hard disc.

A logical volume is a logical disc which may spread across multiple physical discs.

The easiest way to think of a physical volume (PV) is that it is a physical partition that has a partition type of “Linux LVM” (type 8e - fdisk or type 8e00 - gdisk) and has been "marked" as a PV using pvcreate -- meaning that it can now be added to a volume group (VG). From the VG, logical volumes (LV) can be created.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy