1819774 Members
3456 Online
109607 Solutions
New Discussion юеВ

lvremove

 
YOGI_3
Frequent Advisor

lvremove

Hello all..
while removing one lv i am getting following error....

# lvremove /dev/vgora02/tst
The logical volume "/dev/vgora02/tst" is not empty;
do you really want to delete the logical volume (y/n) : y
lvremove: Couldn't delete logical volume "/dev/vgora02/tst":
The specified logical volume is open, or
a sparing operation is in progress.
Volume Group configuration for /dev/vgora02 has been saved in /etc/lvmconf/vgora02.conf
#
There is never a wrong time to do the right things
8 REPLIES 8
Devender Khatana
Honored Contributor

Re: lvremove

Hi Yogi,

It seems this file system mounted ?
Can you confirm by bdf.

If yes then unmount it and then try lvremove.

HTH,
Devender
Impossible itself mentions "I m possible"
Leif Halvarsson_2
Honored Contributor

Re: lvremove

Hi,
Is the volume mounted ?
Rajeev  Shukla
Honored Contributor

Re: lvremove

Hi Yogi,
This happens when the logical volume is in use, which could mean that the either it is mounted or if its a raw device then it is used by some database.
Borislav Perkov
Respected Contributor

Re: lvremove

Hi,
If it is not mounted you have lvm data on the disk. you have to use -f option for force removal. or
#lvremove -f /dev/vgora02/tst
Regards,
Borislav

Uday_S_Ankolekar
Honored Contributor

Re: lvremove

If you are sure that logical volume is not in use by any mounted file system then you can delete it by using -f option

lvremove -f /dev/vg0ra02/tst

USA..
Good Luck..
Bill Hassell
Honored Contributor

Re: lvremove

Be VERY careful with the lvremove -f command. A mounted filesystem is only one many uses for a logical volume. It might be used for swap (see swapinfo), it might be a dump area (see lvlnboot -v), or it might be a raw data volume used by Oracle, Sybase, Informix or some other application (see your database admin). With a name likke vgora, I strongly suspect that this belongs to Oracle. Try using both of these commands:

fuser /dev/vgora02/tst
fuser /dev/vgora02/rtst

to see what process(es) have the lvol open.


Bill Hassell, sysadmin
Sandman!
Honored Contributor

Re: lvremove

Make sure you backup the lvol before unmounting and removing it...just in case you need to revert back. And as per Bill's suggestion check whether the filesystem is in use with the fuser utility. Also make sure that you haven't moved into the filesystem that you are trying to unmount otherwise you'll keep getting a busy error.

regards!
Tim D Fulford
Honored Contributor

Re: lvremove

do

fuser /dev/vgora02/tst
fuser /dev/vgora02/rtst

any pids outputted do

ps -fp

This will identify the process accesing it. If you are sure that you no longer need it do

kill

then re-try lvremove.

My suspicion is that people are using it and it MAY be important. be careful..

Tim
-