Home » Differences between volume, partition and drive

Differences between volume, partition and drive

Solutons:


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 an 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 partition. 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 partitions 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.

  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

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.

Related Solutions

Joining bash arguments into single string with spaces

[*] I believe that this does what you want. It will put all the arguments in one string, separated by spaces, with single quotes around all: str="'$*'" $* produces all the scripts arguments separated by the first character of $IFS which, by default, is a space....

AddTransient, AddScoped and AddSingleton Services Differences

TL;DR Transient objects are always different; a new instance is provided to every controller and every service. Scoped objects are the same within a request, but different across different requests. Singleton objects are the same for every object and every...

How to download package not install it with apt-get command?

Use --download-only: sudo apt-get install --download-only pppoe This will download pppoe and any dependencies you need, and place them in /var/cache/apt/archives. That way a subsequent apt-get install pppoe will be able to complete without any extra downloads....

What defines the maximum size for a command single argument?

Answers Definitely not a bug. The parameter which defines the maximum size for one argument is MAX_ARG_STRLEN. There is no documentation for this parameter other than the comments in binfmts.h: /* * These are the maximum length and maximum number of strings...

Bulk rename, change prefix

I'd say the simplest it to just use the rename command which is common on many Linux distributions. There are two common versions of this command so check its man page to find which one you have: ## rename from Perl (common in Debian systems -- Ubuntu, Mint,...

Output from ls has newlines but displays on a single line. Why?

When you pipe the output, ls acts differently. This fact is hidden away in the info documentation: If standard output is a terminal, the output is in columns (sorted vertically) and control characters are output as question marks; otherwise, the output is...

mv: Move file only if destination does not exist

mv -vn file1 file2. This command will do what you want. You can skip -v if you want. -v makes it verbose - mv will tell you that it moved file if it moves it(useful, since there is possibility that file will not be moved) -n moves only if file2 does not exist....

Is it possible to store and query JSON in SQLite?

SQLite 3.9 introduced a new extension (JSON1) that allows you to easily work with JSON data . Also, it introduced support for indexes on expressions, which (in my understanding) should allow you to define indexes on your JSON data as well. PostgreSQL has some...

Combining tail && journalctl

You could use: journalctl -u service-name -f -f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal. Here I've added "service-name" to distinguish this answer from others; you substitute...

how can shellshock be exploited over SSH?

One example where this can be exploited is on servers with an authorized_keys forced command. When adding an entry to ~/.ssh/authorized_keys, you can prefix the line with command="foo" to force foo to be run any time that ssh public key is used. With this...

Why doesn’t the tilde (~) expand inside double quotes?

The reason, because inside double quotes, tilde ~ has no special meaning, it's treated as literal. POSIX defines Double-Quotes as: Enclosing characters in double-quotes ( "" ) shall preserve the literal value of all characters within the double-quotes, with the...

What is GNU Info for?

GNU Info was designed to offer documentation that was comprehensive, hyperlinked, and possible to output to multiple formats. Man pages were available, and they were great at providing printed output. However, they were designed such that each man page had a...

Set systemd service to execute after fstab mount

a CIFS network location is mounted via /etc/fstab to /mnt/ on boot-up. No, it is not. Get this right, and the rest falls into place naturally. The mount is handled by a (generated) systemd mount unit that will be named something like mnt-wibble.mount. You can...

Merge two video clips into one, placing them next to each other

To be honest, using the accepted answer resulted in a lot of dropped frames for me. However, using the hstack filter_complex produced perfectly fluid output: ffmpeg -i left.mp4 -i right.mp4 -filter_complex hstack output.mp4 ffmpeg -i input1.mp4 -i input2.mp4...

How portable are /dev/stdin, /dev/stdout and /dev/stderr?

It's been available on Linux back into its prehistory. It is not POSIX, although many actual shells (including AT&T ksh and bash) will simulate it if it's not present in the OS; note that this simulation only works at the shell level (i.e. redirection or...

How can I increase the number of inodes in an ext4 filesystem?

It seems that you have a lot more files than normal expectation. I don't know whether there is a solution to change the inode table size dynamically. I'm afraid that you need to back-up your data, and create new filesystem, and restore your data. To create new...

Why doesn’t cp have a progress bar like wget?

The tradition in unix tools is to display messages only if something goes wrong. I think this is both for design and practical reasons. The design is intended to make it obvious when something goes wrong: you get an error message, and it's not drowned in...