Forrest logo
back to the lvm tool

lvm:tldr:68f14

lvm: Initialize a drive or partition to be used as a physical volume.
$ sudo lvm pvcreate ${-dev-sdXY}
try on your machine

The command "sudo lvm pvcreate ${-dev-sdXY}" is used to create a physical volume (PV) for Logical Volume Management (LVM) on a device in Linux.

Here is a breakdown of the command:

  • "sudo": It is a command that gives the user temporary administrative privileges to execute the following command as a superuser or root.
  • "lvm": It is a command-line utility used for managing logical volumes.
  • "pvcreate": It is a specific command within LVM used to initialize a physical volume for LVM use.

"${-dev-sdXY}": This is a placeholder for a specific device path on which you want to create a physical volume. The "dev" refers to the device directory, "sd" denotes SCSI devices, "X" represents a letter indicating the device (a, b, c, etc.), and "Y" refers to a partition number. You need to replace "${-dev-sdXY}" with the actual device path you want to create the physical volume on, for example, "/dev/sda1".

Summing up, this command with the replaced device path would initialize the specified device (${dev-sdXY}) as a physical volume for LVM, making it ready for adding to a volume group and creating logical volumes.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lvm tool