[mythtv-users] LVM and ext3, reduction?

Robin Hill myth at robinhill.me.uk
Sat Oct 28 09:25:06 UTC 2006


On Fri Oct 27, 2006 at 10:18:46PM -0400, Ben Curtis wrote:

> So question #1.  Say I fill up my 320, add the 50 gigs, and use 10 gigs of
> it.  I later delete a few shows that are physically stored on the 320,
> freeing up 20 gigs.  Can I do this:
> 
> pvmove /dev/hda3
> 
> And then reduce the size by 50G, where hda3 is the drive containing the 50
> gigs?  I would like the end result to be no data on hda3.
> 
I don't see why not - I've never done it myself but it's meant to work
this way.

> Next question, I don't quite get how to do the shrink, I understand the
> commands to be:
> 
> e2fsck -f /dev/volume_group/logical_volume XXXXXXX
> resize2fs /dev/volume_group/logical_volume
> lvresize -L YYYYYYY /dev/volume_group/logical_volume
> 
> where XXXXX is the block size of the final volume, and YYYYY is the MB
> size of the final volume.  But how do you find out what the block size
> would be?
> 
Not sure why you need the XXXXXX there - it's just a normal ext3
filesystem at that point.  Won't do any harm though I guess.  You'll
also need to tell resize2fs what size you want it to resize to
(otherwise that command won't do anything).  And finally, for your
YYYYYY, just use the opposite of your first command, -50G.  So you now
have:

e2fsck -f /dev/volume_group/logical_volume
resize2fs /dev/volume_group/logical_volume 320G
lvresize -L -50G dev/volume_group/logical_volume

Of course, the 320G is probably not quite right - you'll have to check
exactly what the available size is pre adding the extra space, or what
it is afterwards less 50G I guess.

HTH,
        Robin

-- 
     ___        
    ( ' }     |       Robin Hill        <myth at robinhill.me.uk>  |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20061028/626cb01b/attachment.pgp 


More information about the mythtv-users mailing list