[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shrink lvm to get spare space



On Sun, Apr 26, 2009 at 04:50:16PM -0500, Boyd Stephen Smith Jr. wrote:
> In <[🔎] 20090426181517.GA9437@m364d1.ece.northwestern.edu>, Zhengquan Zhang 
> wrote:
> >on on of my systems I have
> >Filesystem            Size  Used Avail Use% Mounted on
> >/dev/mapper/debian-root
> >                      224G   12G  200G   6% /
> >
> >Now I would like to shrink / by 30G so that I have 30G for another OS. I
> >wonder if this kind of shrinking is possible. I am using ext3.
> 
> 1. Shrink the filesystem.  (For ext3, must be unmounted, so you'll have to 
> this from a rescue OS.)
> 2. Shrink the logical volume.  (I *think* this requires it to be unmounted, 
> so again, a rescue OS is needed.)

I understand the above two steps. I will use resize2fs and lvreduce for
that.

> 3. Shrink the physical volume.  (I'm not even sure LVM supports this.  If 
> this is your only physical volume, and you are using the extents toward the 
> end, I don't think you'll be able to move the data.)

Could you please explain a little bit why I need to do this? Will there
be space unformatted after I do the first two steps?

> 4. Shrink the partition.  (I'm comfortable with fdisk, but gparted is the 
> recommendation I've heard the most.)

If I don't do this, will there be spare space unformatted after I do the
first two steps?

> 
> Long story made short: Don't give LVM space you will ever want back.

I was in a bit of rush when trying LVM out the first time. I will
remember this on the next system.


THanks!

-- 
Zhengquan


Reply to: