LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-12-2012, 08:22 AM   #1
busi386
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
Destory or remove Logical Volumes and disk.


Hello All

I am a redhat newbie.

I manage to create a logical volume. I was also able to mount it.

Now how do I destroy or remove it?

I know enough to start with umount -f /APP1

but what do i do after that?
Push comes to shove, its just a virtual disk, so I could simply remove it from virtual box. but i want to get practice on how to properly remove PV and VG

[root@CENTOS /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.2G 3.9G 5.3G 43% /
tmpfs 709M 88K 709M 1% /dev/shm
/dev/sda1 640M 62M 546M 11% /boot
/dev/sda3 2.0G 212M 1.7G 12% /home
/dev/mapper/volume_group_1-APP1
2.0G 67M 1.9G 4% /APP1


[root@CENTOS /]# vgs
VG #PV #LV #SN Attr VSize VFree
volume_group_1 2 1 0 wz--n- 15.99g 13.99g
[root@CENTOS /]#
 
Old 11-12-2012, 08:38 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
From the lvm man page ...

lvremove — Remove a logical volume

pvremove — Remove a physical volume.

vgremove — Remove a volume group.
 
Old 11-12-2012, 09:30 AM   #3
busi386
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
If I may trouble you a bit more...

for some reason I am unable to remove the logical volume APP1.
I do know its there because it warns me that its about to be removed when I attempt to remove the volume group.
Any ideas? I am just trying to increase my understanding. If i really want to get rid of it, the vgremove would do the trick.


[root@CENTOS /]# vgs
VG #PV #LV #SN Attr VSize VFree
volume_group_1 2 1 0 wz--n- 15.99g 13.99g

[root@CENTOS /]# lvremove APP1
Volume group "APP1" not found
Skipping volume group APP1

[root@CENTOS /]# lvremove /APP1
"/APP1": Invalid path for Logical Volume

[root@CENTOS /]# vgremove volume_group_1
Do you really want to remove volume group "volume_group_1" containing 1 logical volu es? [y/n]: yes

Do you really want to remove active logical volume APP1? [y/n]: n
Logical volume APP1 not removed

[root@CENTOS /]# vgs
VG #PV #LV #SN Attr VSize VFree
volume_group_1 2 1 0 wz--n- 15.99g 13.99g

[root@CENTOS /]# lvremove APP1
Volume group "APP1" not found
Skipping volume group APP1

[root@CENTOS /]# lvremove APP1
Volume group "APP1" not found
Skipping volume group APP1

[root@CENTOS /]#
 
Old 11-12-2012, 11:26 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I don't have access to a system with LVM now so cannot test but believe the command is
Code:
lvremove /dev/<VG name>/<LV name>
If so, in your case it would be
Code:
lvremove /dev/volume_group_1/APP1
 
Old 11-12-2012, 11:43 AM   #5
busi386
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thank you.


I have to play around with it a bit more. I did have some ZFS training fore solaris but I forgot it.
I figure that I can play around with LVM as there is not that much of a difference.


out of curiosity, I took a look at the disk management gui. Its soo easy to use.
Such a thing really did not exist in solaris.
As an administrator, which should I be using. My last job we used ssh for everything.

But RHEL is a different beast. I wonder should I just use the gui and make life easier on myself?
At the moment I am unemployed, but that wont be for long because there is a huge demand for unix folks.

What are redhat admins using?

*******************************************************
[root@CENTOS ~]# vgs
VG #PV #LV #SN Attr VSize VFree
volume_group_1 2 1 0 wz--n- 15.99g 13.99g

[root@CENTOS ~]# lvremove /volume_group_1/APP1
"/volume_group_1/APP1": Invalid path for Logical Volume

[root@CENTOS ~]# lvremove /dev/volume_group_1/APP1
Do you really want to remove active logical volume APP1? [y/n]: y
Logical volume "APP1" successfully removed

[root@CENTOS ~]# vgremove volume_group_1
Volume group "volume_group_1" successfully removed
[root@CENTOS ~]# vgs
No volume groups found

[root@CENTOS ~]#
 
Old 11-12-2012, 12:09 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I vaguely recall an LQ thread, maybe three years ago (dunno if it was RH), about a GUI for LVM management and people writing that it was not reliable so better to use the commands directly. Maybe the GUI tool has matured since then. But, if you are contemplating professional use, consider that a) many servers are "headless" and administered solely from the command prompt via ssh and b) GUI admin tools rarely have the full functionality of the underlying commands. Either way, experience of the commands is an asset.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
df not displaying logical volumes dthaler Linux - Newbie 19 04-24-2012 04:28 AM
[SOLVED] Logical volumes not available on reboot Vanyel Linux - Server 11 09-19-2011 10:23 AM
Shrinking the disk partition with Logical Volumes on it problem vofka Linux - General 0 06-17-2009 08:43 AM
Can't delete logical volumes gnoop Linux - Enterprise 6 01-23-2009 11:54 AM
I did not know about logical volumes gezi Linux - Newbie 5 04-27-2005 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration