LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 07-05-2011, 06:24 PM   #1
basscakes
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Removing physical drive from LVM logical volume


Hello

I have a 7.9 TB logical volume I've created from 8 1 TB RAID 0 devices. The volume is formatted with XFS so I can resize when ready. However, I think I want to do something that is not possible. I have 2.5 TB free on my logical volume. I'd like to shrink the volume down to be 6 TB by getting rid of 2 of the 1 TB devices in the physical volume. However pvmove seems to require free extents in order to work. Do I need to add 6 TB of storage, pvmove everything onto it, and then decommission the original 8 1 TB physical devices from the volume?

Thanks
 
Old 07-05-2011, 07:31 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
pvmove is just for one disk at a time; just needs enough space elsewhere (another disk) to txfr the content to.
http://tldp.org/HOWTO/LVM-HOWTO/
http://sunoano.name/ws/public_xhtml/lvm.html

Also Section 6.2 & chap 9 http://www.linuxtopia.org/online_boo...ion/index.html
 
Old 07-05-2011, 07:37 PM   #3
basscakes
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks

Thanks for the suggestions. However, I am aware of these commands. I basically want to be able to move all of my data onto 6 physical devices and remove 2 devices without any steps inbetween. I don't want to have to move stuff around or create a new drive. I was hoping that LVM would let me just shrink my volume and remove drives from the volume since I don't need all the space.
 
Old 07-05-2011, 08:45 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,283

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Quote:
Originally Posted by basscakes View Post
I was hoping that LVM would let me just shrink my volume and remove drives from the volume since I don't need all the space.
What makes you think it won't ?.
Quote:
However pvmove seems to require free extents in order to work.
What makes you think that ?.
 
Old 07-05-2011, 09:12 PM   #5
basscakes
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
syg00 - everything i am reading suggests that you can't remove physical drives from a physical volume without data loss. there appears to be no way to say, take all the data that is on /dev/md0 and /dev/md1 and put it on /dev/md[2-8].

" pvmove allows you to move the allocated physical extents (PEs) on SourcePhysicalVolume to one or more other physical volumes (PVs). " - all of my extends on all physical volumes have been allocated. on the filesystem level, there is 2.5 TB of free space (ie df -h shows 2.5 TB free), but on the volume group level there is no free space.

Code:
 PV         VG         Fmt  Attr PSize    PFree
  /dev/md1   fileserver lvm2 a-   1000.00g    0 
  /dev/md2   fileserver lvm2 a-   1000.00g    0 
  /dev/md3   fileserver lvm2 a-   1000.00g    0 
  /dev/md4   fileserver lvm2 a-   1000.00g    0 
  /dev/md5   fileserver lvm2 a-   1000.00g    0 
  /dev/md6   fileserver lvm2 a-   1000.00g    0 
  /dev/md7   fileserver lvm2 a-   1000.00g    0 
  /dev/md8   fileserver lvm2 a-   1000.00g    0 

  --- Volume group ---
  VG Name               fileserver
  System ID             
  Format                lvm2
  Metadata Areas        8
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                8
  Act PV                8
  VG Size               7.81 TiB
  PE Size               4.00 MiB
  Total PE              2047992
  Alloc PE / Size       2047992 / 7.81 TiB
  Free  PE / Size       0 / 0   
  VG UUID               8ZIKof-TQAJ-cmre-xbO7-er2Q-E9Bi-dmlHrH
 
Old 07-06-2011, 01:03 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
If you read the step-by-step desc here http://linux.die.net/man/8/pvmove, you'll see that actually only the data content gets moved. The std LVM docs are a little loose with the word extents.
You just need enough data space in the destn pv's.
According to the main Description there, you can run more than one pvmove in parallel, so long as they don't share src or destn.
 
  


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
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
LVM - removing a physical volume safely karnaf Linux - General 4 08-09-2010 02:47 PM
Multiple Logical Groups out of a Physical Volume Hi_This_is_Dev Linux - Server 2 04-26-2010 08:31 PM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
LVM: How to create logical (physical) volume with extent sie 32 Mb consistgd Linux - Software 4 11-14-2006 05:03 PM


All times are GMT -5. The time now is 03:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration