What do these terms mean exactly?
- partition
- volume
- 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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityWhat do these terms mean exactly?
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.
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.
/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 drive is a physical block disk.
For example: /dev/sda
.
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
.
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:
mount
, each line has the format of "A on B type C", does A mean a volume or a partition?
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.
Jan 21, 2016 at 2:02
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.
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.
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.