🌐 🇵🇱 Polski · 🇬🇧 EN
Removing logical volumes is just as important as creating them. These are related operations concerning the management of storage space for filesystems in the system. Removal is very straightforward:
Step 1 - Removing a logical volume using the "lvremove" command
# lvremove /dev/vg_group01/SecretData
Do you really want to remove active logical volume SecretData?
[y/n]: y
Logical volume “SecretData” successfully removed
An interesting addition to the lvremove command is the "-t" switch, which allows you to test the removal of a partition before actually deleting it. The "-t" switch is also available for commands that remove volume groups and physical volumes.
Once logical volumes are removed, you can also get rid of the entire volume group.
Step 2 - Use the "vgremove" command to remove a volume group.
# vgremove vg_group01
Do you really want to remove volume group “vg_group01” containing
1 logical volumes? [y/n]: y
Do you really want to remove active logical volume lvol0? [y/n]: y
Logical volume “lvol0” successfully removed
Volume group “vg_group01” successfully removed
This can also be done in another way using the "-f" switch
# vgremove -f VolGroup01
Step 3 - Verify the changes.
# vgdisplay vg_group01
Volume group “vg_group01” not found
Step 4 - Removing currently existing physical volumes
# pvremove /dev/hdb
Labels on physical volume “/dev/hdb” successfully wiped
# pvremove /dev/hdc
Labels on physical volume “/dev/hdc” successfully wiped
Comments