Difference between revisions of "Pvcreate"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>pvcreate</code><ref>http://man7.org/linux/man-pages/man8/pvcreate.8.html</ref> initialize a disk for use by LVM. Also partition, meta device, or loopback file are supported.
+
<code>pvcreate</code><ref>http://man7.org/linux/man-pages/man8/pvcreate.8.html</ref> initialize a [[disk]] for use by LVM. Also partition, meta device, or loopback file are supported.
  
 +
{{add disk}}
 +
 +
 +
[[lsblk]]
 +
<pre>
 +
pvcreate /dev/sdt
 +
  Physical volume "/dev/sdt" successfully created.
 +
 +
Check:
 +
  blkid | grep sdt
 +
</pre>
  
pvcreate
 
 
<pre>pvcreate /dev/sdb
 
<pre>pvcreate /dev/sdb
 
WARNING: ext4 signature detected on /dev/sdb at offset 1080. Wipe it? [y/n]:
 
WARNING: ext4 signature detected on /dev/sdb at offset 1080. Wipe it? [y/n]:
Line 27: Line 37:
 
</pre>
 
</pre>
  
<pre>
 
pvcreate /dev/dm-24
 
  Physical volume "/dev/dm-24" successfully created.
 
</pre>
 
  
  
<pre>
+
pvcreate /dev/sda234
pvcreate --uuid "FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk" --restorefile /etc/lvm/archive/VG_00050.vg /dev/sdh1
+
  Can't open /dev/sda234 exclusively.  Mounted filesystem?
  Physical volume "/dev/sdh1" successfully created
+
  Can't open /dev/sda234 exclusively.  Mounted filesystem?
</pre>
+
 
:--uuid requires use of --restorefile is compulsory unless the --norestorefile is used
+
== Successful ==
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/mdatarecover<br>
+
pvcreate /dev/[[dm]]-24
See also: [[UUID]] and <code>[[vgcfgrestore]]</code>
+
  Physical volume "/dev/dm-24" successfully created.
 +
 
 +
pvcreate /dev/sdb
 +
  Physical volume "/dev/sdb" successfully created.
 +
 
 +
pvcreate --uuid "FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk" --restorefile /etc/lvm/archive/VG_00050.vg /dev/sdh1
 +
  Physical volume "/dev/sdh1" successfully created
 +
  --uuid requires use of --restorefile is compulsory unless the --norestorefile is used
 +
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/mdatarecover<br>
 +
See also: [[UUID]] and <code>[[vgcfgrestore]]</code>
  
 +
== Related commands ==
 +
* <code>[[blkid]]</code>
 +
* <code>[[pvremove]]</code>
 +
* <code>[[vgcreate]]</code>
 +
* <code>[[pvresize]]</code>
  
 
== Activities ==
 
== Activities ==
Line 51: Line 71:
  
 
== See also ==
 
== See also ==
 +
* {{pvcreate}}
 
* {{lvm commands}}
 
* {{lvm commands}}
 
* {{Linux block devices}}
 
* {{Linux block devices}}
Line 56: Line 77:
  
 
[[Category:Linux]]
 
[[Category:Linux]]
 +
[[Category:LVM]]

Latest revision as of 05:58, 4 April 2021

pvcreate[1] initialize a disk for use by LVM. Also partition, meta device, or loopback file are supported.

pvcreate


lsblk
pvcreate /dev/sdt
  Physical volume "/dev/sdt" successfully created.

Check:
  blkid | grep sdt
pvcreate /dev/sdb
WARNING: ext4 signature detected on /dev/sdb at offset 1080. Wipe it? [y/n]:
 pvcreate /dev/sdc
  Device /dev/sdc excluded by a filter.

Use gdisk to check if GPT partition information is on device and delete it. https://serverfault.com/a/951589


pvcreate /dev/mapper/3600a09803831417a5a244f5665797a47
  Can't open /dev/mapper/3600a09803831417a5a244f5665797a47 exclusively.  Mounted filesystem?


pvcreate /dev/mapper/3600a09803831417a5a244f5665797a47
  Physical volume "/dev/mapper/3600a09803831417a5a244f5665797a47" successfully created.


pvcreate /dev/sda234
 Can't open /dev/sda234 exclusively.  Mounted filesystem?
 Can't open /dev/sda234 exclusively.  Mounted filesystem?

Successful[edit]

pvcreate /dev/dm-24
  Physical volume "/dev/dm-24" successfully created.
pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.
pvcreate --uuid "FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk" --restorefile /etc/lvm/archive/VG_00050.vg /dev/sdh1
  Physical volume "/dev/sdh1" successfully created
 --uuid requires use of --restorefile is compulsory unless the --norestorefile is used
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/mdatarecover
See also: UUID and vgcfgrestore

Related commands[edit]

Activities[edit]

Basic:

  1. Initialize a new disk to be used by Linux LVM with pvcreate command.
  2. Initialize a new multipath disk and make user lvm.conf if properly configured.[2]

Related:

  1. Multipath: remove multipath device unpresented to host

See also[edit]

scan: pvscan vgscan
LVM: lvs lvmscan lvm fullreport lvmreport lvmconfig lvmdump lvmcheck lvm dumpconfig
Scan: pvs vgs lvs pvscan vgscan
PV: pvcreate pvremove pvscan pvremove pvscan pvs pvchange pvck pvdisplay pvresize
LV: lvdisplay lvcreate lvremove, lvresize, lvextend, lvreduce, lvrename
VG: vgdisplay,vgcreate,vgremove, vgextend, vgreduce, vgscan, vgchange, vgrename, vgcfgbackup, vgcfgrestore, vgimportclone, vgck
Check commands: pvck vgck
  • http://man7.org/linux/man-pages/man8/pvcreate.8.html
  • https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/DM_Multipath/multipath_logical_volumes.html
  • Advertising: