Lvremove: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 12: Line 12:


<pre>
<pre>
umount /dev/VolGroup00/MyLV1
umount /dev/<volume-group-name>/<logical-volume-name>
</pre>
 
Remove the logical volume with <tt>lvremove</tt>.
 
The command has a "dry run mode" (-t):
 
<pre>
lvremove /dev/<VG_name>/<LV_name>
</pre>
</pre>


<pre>
<pre>
lvremove -t /dev/<VG_name>/<LV_name>
umount /dev/docker_vg/docker-pool
</pre>
</pre>


Example:
Then remove the logical volume:


<pre>
<pre>
[root@rhel-test lvm]# lvremove -t /dev/rhel_rhel-test/docker-pool
lvremove [-v] /dev/<volume-group-name>/<logical-volume-name>
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
Do you really want to remove active logical volume docker-pool? [y/n]: y
  Logical volume "docker-pool" successfully removed
</pre>
</pre>
This command actually removes it:


<pre>
<pre>
lvremove [-v] /dev/VolGroup00/MyLV1
lvremove /dev/docker_vg/docker-pool
</pre>
</pre>

Latest revision as of 18:03, 23 May 2017

Internal

Overview

Removes a logical volume from a volume group.

Gather statistics on the free space before removing, and also on the size of the logical volume to be removed with vgs and lvs.

Unmount the volume if necessary (or shutdown the service that is using it, as it is the case with Docker):

umount /dev/<volume-group-name>/<logical-volume-name>
umount /dev/docker_vg/docker-pool

Then remove the logical volume:

lvremove [-v] /dev/<volume-group-name>/<logical-volume-name>
lvremove /dev/docker_vg/docker-pool