Friday, October 9, 2009

LVM: Deleting LVM Partition

I have a LVM Partitioned in such manner:

[root@ideathon ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
13G 3.4G 8.4G 29% /
/dev/cciss/c0d0p1 190M 15M 166M 8% /boot
none 3.9G 0 3.9G 0% /dev/shm
/dev/mapper/VolGroup00-lvfs
2.0G 65M 1.9G 4% /home/fstop
/dev/mapper/VolGroup00-lvfsrecord
7.9G 158M 7.4G 3% /home/fstop/records
/dev/mapper/VolGroup00-lvfslog
2.0G 44M 1.9G 3% /home/fstop/logs
/dev/mapper/VolGroup00-lvfstomcat
1008M 77M 881M 8% /home/fstop/tomcat
/dev/mapper/VolGroup00-lvmydata
58G 84M 56G 1% /home/fstop/mysql/data
/dev/mapper/VolGroup00-lvmylog
20G 74M 19G 1% /home/fstop/mysql/logs
/dev/mapper/VolGroup00-lvfsarchive
6.0G 45M 5.6G 1% /home/fstop/archive

Now What I want is: How to delete LVM partition?

Solution:

Say, I want to remove the following LVM partition:


/dev/mapper/VolGroup00-lvmydata
58G 84M 56G 1% /home/fstop/mysql/data

So I will follow the following commands:

#umount /home/fstop/mysql/data

It may run successfully but if it shows error like:

Cannot umount: device is busy

Then You need to run fuser command to kill the process held by some other processes.

Just running:

#fuser /home/fstop
/home/fstop: 28406c 28425c 28453c 28479c 28526c 28592c 28644c 28740c
#fuser -ku /home/fstop

Using the above switches you can kill the process which is holding the file and free the file/folders.

Try running df command again:


[root@ideathon ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
13G 3.4G 8.4G 29% /
/dev/cciss/c0d0p1 190M 15M 166M 8% /boot
none 3.9G 0 3.9G 0% /dev/shm
/dev/mapper/VolGroup00-lvfs
2.0G 65M 1.9G 4% /home/fstop
/dev/mapper/VolGroup00-lvfsrecord
7.9G 158M 7.4G 3% /home/fstop/records
/dev/mapper/VolGroup00-lvfslog
2.0G 44M 1.9G 3% /home/fstop/logs
/dev/mapper/VolGroup00-lvfstomcat
1008M 77M 881M 8% /home/fstop/tomcat

/dev/mapper/VolGroup00-lvmylog
20G 74M 19G 1% /home/fstop/mysql/logs
/dev/mapper/VolGroup00-lvfsarchive
6.0G 45M 5.6G 1% /home/fstop/archive

(to be contd..)

No comments:

Post a Comment