Skip to content

            Lost ?  |  Need an account:
 
LVM Removal PDF Print E-mail
(4 votes, average 3.50 out of 5)
Written by Tom Hirt   
Friday, 22 May 2009 12:51

 

Logical Volume Removal


In this KB, we will show you how to remove a logical volume.  We will assume you already have a logical volume (LV) created on your system.  If you do not already have a LV, and you need help creating your first LV, please see our LVM Configuration KB for details.

Removing a logical volume is a three step process:

  1. Unmount the LV
  2. Remove the LV
  3. Update /etc/fstab

Note: Make sure you unmount the file system before removing the LV.  Forcing the removal of a LV before it is unmounted could have unknown consequences on your system.

In the following example, we will remove the logical volume TCPDumpLV.  Lets get started!

  1. Begin by listing all the logical volumes on the system

    [root@Linux01 ~]# lvs
    LV VG Attr LSize Origin Snap% Move Log Copy% Convert
    TCPDumpLV TCPDumpVolGRP -wi-ao 2.00G

    LogVol00 VolGroup00 -wi-ao 1.00G
    LogVol01 VolGroup00 -wi-ao 1.94G
    LogVol02 VolGroup00 -wi-ao 1.00G

    LogVol03 VolGroup00 -wi-ao 2.00G
    LogVol04 VolGroup00 -wi-ao 3.94G
    [root@Linux01 ~]#

  2. Let's find out where TCPDumpLV is mounted

    [root@Linux01 ~]# df -kh
    Filesystem
    Size
    Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol04
    3.9G 2.2G 1.6G 59% /
    /dev/sda1
    99M
    12M 82M 13% /boot
    tmpfs
    1006M
    0 1006M 0% /dev/shm
    /dev/mapper/VolGroup00-LogVol00 992M 41M 901M 5% /home
    /dev/mapper/VolGroup00-LogVol02 992M 69M 872M 8% /tmp
    /dev/mapper/VolGroup00-LogVol03
    2.0G
    150M 1.7G 8% /var
    /dev/mapper/TCPDumpVolGRP-TCPDumpLV
    2.0G
    568M 1.4G 30% /Data
    Note: TCPDumpLV is mounted on /Data

  3. Unmount TCDDumpLV

    [root@Linux01 /]# umount /Data
    [root@Linux01 /]#

  4. Remove the logical volume

    [root@Linux01 /]# lvremove /dev/TCPDumpVolGRP/TCPDumpLV
    Do you really want to remove active logical volume "TCPDumpLV"? [y/n]: y
    Logical volume "TCPDumpLV" successfully removed
    [root@Linux01 /]#

  5. Verify the logical volume has been removed

    [root@Linux01 ~]# lvs
    LV VG Attr LSize Origin Snap% Move Log Copy% Convert
    LogVol00 VolGroup00 -wi-ao 1.00G
    LogVol01 VolGroup00 -wi-ao 1.94G
    LogVol02 VolGroup00 -wi-ao 1.00G

    LogVol03 VolGroup00 -wi-ao 2.00G
    LogVol04 VolGroup00 -wi-ao 3.94G
    [root@Linux01 ~]#

  6. Update /etc/fstab to reflect the removal of the file system

    /dev/mapper/TCPDumpVolGRP-TCPDumpLV /Data
    ext3 defaults 0 0

 

Nice work, you now know how to remove a logical volume!


Add this page to your favorite website
AddThis Social Bookmark Button
Comments
Add New Search
Anonymous |05/02/2012 03:50:06
It's really wonderful i followed it step by step & remove lv's at my office production system.Thanks a lot!! :D
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Tuesday, 02 June 2009 07:49
 

Forum Activity

Author:
Author: kenny22
Jan.24.12
Author: AaronRiley
Jan.15.12

Online Stats

Guests Online: 99
Members Online: 0