Linux LVM users
 help / color / mirror / Atom feed
From: Arshavir Grigorian <ag@m-cam.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] reducing lv
Date: Thu, 03 Feb 2005 18:13:46 -0500	[thread overview]
Message-ID: <4202B02A.8010206@m-cam.com> (raw)
In-Reply-To: <1413507193.20050203195625@e-liberty.pl>

Piw wrote:

>NiHao Arshavir,
>
>Wednesday, February 2, 2005, 12:23:10 AM, you wrote:
>
>  
>
>>Hi,
>>    
>>
>
>  
>
>>I have a very large LV across 4 pv-s (2 disks - /dev/hdb, /dev/hdd + 2
>>partitions on different sisks - /dev/hda2, /dev/hdc2).
>>Is there any way to determine how the data on the lv is stored and 
>>whether it would be possible to consolidate the data on 1 disk + 2 
>>partitions (/dev/hdb, /dev/hda2, /dev/hdc2) and replace the other disk
>>(/dev/hdd).
>>I am running Reiserfs.
>>    
>>
>
>  
>
>>Thanks for any pointer on how to do this.
>>Arshavir
>>    
>>
>
>Hi
>
>It depends...
>0. first check, if any of you PV has free extents.
># pvdisplay
>   - check how many 'Allocated PE' has /dev/hdd
>   - check is sum of 'Free PE' from other 3 PV is greater then that.
>
>If  yes,  it  will  be easy (other PV can store all the PE from hdd).
>look at scenario 1.
>
>If no, it will still be easy, but filesystem shrnking will be needed.
>look at scenario 2.
>
>scenario 1.
>So other PVs can take all data... ok... we will use pvmove to do that.
>
>1. Check, if there is any PV that can take all the PE in one move.
>ie. you have 10 allocated PE in hdd, and other PV has 13, 8, 5 PEs free.
>
>if yes, simply:
>pvmove /dev/hdd /dev/hdx (hdx has more free PEs then hdd allocated PEs)
>
>if no:
>If you  have  to  move  to 2 or 3 PVs (ie. hdd use 10 PE, other PVs has
>7,  5, 3 free) you  have  to do some trick - (correct me if i'm wrong,
>but LVM still cannot move PE to multiple PV in one run?).
>You have to manually move fragments of source PV to other PVs.
>#pvmove /dev/hdd:1-7 /dev/1st.target
>#pvmove /dev/hdd:8-10 /dev/2nd.target
>
>And thats all.
>
>scenario 2.
>First  you  have  to  shirink  filesystem, to regain free PEs in Volume
>Group.
>1. Check PE size in your VG (pvdisplay - 'PE Size (KByte)')
>2. Check number of 'Allocated PE' in hdd
>3. check number of 'Free PE' in others PV
>4. allocated - free = gives you how much PE U have to relese
>5. multiple number of PE to release by size of 1 PE
>6. now you know how many KB you have to regain.
>7. multiple it by 1.1 - to gain safty margin #1
>8. now make sure that (free space in filesystem > KB to release)
>9. umount lv
>9. shrink filesystem
># resize_reiserfs -f -s -(KB to release)K /dev/vg/lv
>10. multiple (KB to release) by 0.95 to gain safety margin #2
>11. shrink lv
># lvreduce -L -(KB to release)K /dev/vg/lv
>12. expand filesystem to regain space lost for safe margin #2
># resize_reiserfs /dev/vg/lv
>
>13. recalculate if now U have enought free PE to reallocate all PE form
>hdd. If yes, go to scenario 1, if no, back to beginning of scenario 2.
>
>When you finish, U can do:
>lvextend  -L  +(numer of free PEs) /dev/vg/lv
>to regain PE used to safty margin #1.
>
>good luck :)
>
>PS.  If  U  can get lots of free space in filesystem, use bigger safty
>margins (ie. 1.2 first, 0.9 second) - space isnt lost, and give U more flexibility.
>--
>Piw
>Jabb with me at piw@e-liberty.pl M0r3 1nf0 4t http://www.jabberpl.org/
>
Thank you so very much for such detailed instructions.
I will give it try and will report back with any success/failure.

Arshavir

      reply	other threads:[~2005-02-03 23:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01 23:23 [linux-lvm] reducing lv Arshavir Grigorian
2005-02-03 18:56 ` Piw
2005-02-03 23:13   ` Arshavir Grigorian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4202B02A.8010206@m-cam.com \
    --to=ag@m-cam.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox