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

Re: [linux-lvm] lvreduce nightmare


On Thu, May 17, 2012 at 06:13:50PM -0500, Ray Morris wrote:
> > resize2fs /dev/vg0/data 100G
> > lvreduce -L -100G -n /dev/vg0/data*
> A 100 GB filesystem needs a block device of around 110 GB.  So this
> cut off the end of your filesystem. (The device needs to hold the
> journal as well as the FS, for example.)

I normally do as you suggest and resize2fs smaller, lvreduce and
then resize2fs again. This is due to paranoia though - I'm sure that
I normally see it match up with the lvreduce size exactly.

Surely OP's actual problem is that he has an FS with 2+ TB of data
on it that he resize2fs'd down *to* 100G when he actually wanted to
resize2fs it down *by* 100G? He said:

> >  I tried to reduce the VG and this is what it looked like before I
> > tried to reduce it
> > 
> > Filesystem                       Size  Used Avail   Use% Mounted on
> > /dev/mapper/vg0-data         2.2T  1.7T  433G  80%  /data

Anyway I suspect your advice is still accurate though since you're
advising what to do when someone reduces an LV to very slightly
smaller than it needs to be to hold a ~100G FS and what he's
actually done is resize2fs and lvreduce a 2+TB FS into only 100G.
Hopefully all the data is still there and it's just the pointers
that are broken..  nasty.

> resize2fs to smaller size than you wish to end up with. 
> see resize2fs -M 

Ooh, I hadn't spotted that option. That certainly would reduce my
paranoia in future about making mistakes similar to this.


http://bitfolk.com/ -- No-nonsense VPS hosting

Attachment: signature.asc
Description: Digital signature

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