[CentOS] Freeing pv space for snapshots

Fri Jan 5 04:40:01 UTC 2007
Alvin Chang <alvin.chang at gmail.com>

On 05/01/07, Aleksandar Milivojevic <alex at 8-p.ca> wrote:
> I've used it, and it works correctly (and it is available in CentOS
> 4.4).  It shrinks file system as it should.  The only things Paul should
> be careful is to first shrink file system, than logical volume and to
> correctly calculate file system size and by how many extents he can
> shrink logical volume.  If he shrinks logical volume too much, he might
> end up loosing data.  Running fsck in non-destructive mode (fsck -N)
> and/or attempting to mount file system read-only after he shrinks
> logical volume might be a good idea to test all is OK.
A little technique you can use is:
1. shrink the file system to the size slightly less than what you really want
2. reduce LV to the size that is what you really want
3. expand the file system to the size of the LV (usually the resize
program can be told to expand the file system to maximum available
space automatically on the LV.)

-- 
Alvin Chang Yu-Ming