Skip to content

Tinone 71

Stralci dal web

  • HOME
  • About me..
  • News
  • CIAO MAX
  • GALLERIE
    • Comics 2022
    • Fuochi Sant’ Eusebio 2022
    • Fulmini luglio 2021
    • Lago Antrona
    • Ferrara
    • Saline di Comacchio
    • Lido di Pomposa
    • Foto Varie
    • Pietra Ligure 2019
    • Schiranna 2019
    • Laveno Dicembre 2019
    • Incendio Ghirla
    • Forte di Bard Aosta
    • Costa Fascinosa 2023
  • MOTO
    • YAMAHA R1 1999
    • HONDA VTR 1000
    • CBR 600F
    • MUGELLO 2008
  • Privacy Policy
  • Assistenza Remota HopTodesk
  • Home
  • Create and remove physical volumes, assign physical volumes to volume groups, create and delete logical volumes Create and remove physical volumes
  • Linux

Create and remove physical volumes, assign physical volumes to volume groups, create and delete logical volumes Create and remove physical volumes

Admin 11 Febbraio 2013 2 min read

Creating a physical volume in LVM is the first step in the LVM setup. Its the part where you actually tell Red Hat Enterprise Linux that you want a disk to be used for LVM.

pvcreate is the command used to add the physical volumes, or physical partitions.

~] pvcreate /dev/sdb
~] Physical volume “/dev/sdb” successfully created

pvremove is used to disassociate the volume from LVM.

~] pvremove /dev/sdb
~] Labels on physical volume “/dev/sdb” successfully wiped

Assign physical volumes to volume groups

Once that physical volume has been created we can add it to a volume group with the vgcreate or vgextend (if the volume group has already been created).

If the volume group does not exist, you can create it and add physical volumes in one shot:

~] vgextend MyVolGroup /dev/sdc
No physical volume label read from /dev/sdc
Physical volume “/dev/sdc” successfully created
Volume group “MyVolGroup” successfully extended

To assign a new physical volume to an existing volume group we use vgextend:

~] vgextend MyVolGroup /dev/sdc
Volume group “MyVolGroup” successfully extended

Similarly if we want to remove /dev/sdc from that group we would run ”vgreduce”:

~] vgreduce MyVolGroup /dev/sdc
Removed “/dev/sdc” from volume group “MyVolGroup”

Create and delete logical volumes

Logical Volumes have similar commands to create and delete as Volume Groups and Physical Volumes.

To create a new logical volume:

~] lvcreate -L 100M MyVolGroup
Logical volume “lvol0” created

To display the volume after for confirmation:

~] lvdisplay MyVolGroup
— Logical volume —
LV Name /dev/MyVolGroup/lvol0
VG Name MyVolGroup
LV UUID zwLMev-i63w-7Jpk-XuqZ-VGl7-89Ov-WpoewP
LV Write Access read/write
LV Status available
# open 0
LV Size 100.00 MiB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:2

To delete the logical volume you would use the LV Name listed in the results of lvdisplay:

:::bash ~] lvremove /dev/MyVolGroup/lvol0 Do you really want to remove active logical volume lvol0? [y/n]: y Logical volume “lvol0” successfully removed

Continue Reading

Previous: Using iSCSI on Ubuntu 10.04
Next: Iscsi initiator ubuntu server

Related Stories

Vim Cheat Sheet
3 min read
  • Informatica
  • Linux

Vim Cheat Sheet

11 Dicembre 2020
Generate SSL Certificates With LetsEncrypt on Debian Linux
2 min read
  • Informatica
  • Linux

Generate SSL Certificates With LetsEncrypt on Debian Linux

3 Febbraio 2019
Activate LDAP user and group backend for Nextcloud
2 min read
  • Documenti
  • Informatica
  • Linux

Activate LDAP user and group backend for Nextcloud

28 Dicembre 2018
Copyright © All rights reserved. | DarkNews by AF themes.
Cookies
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Sempre abilitato
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
ACCETTA E SALVA