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

Re: [linux-lvm] lvreduce nightmare



Hi Andy,

Thanks for the mail.

I am not sure if reducing by lvreduce alone is safe and will actually reduce the underneath file system also, look at this sequence ..

lvcreate -n test -L10G vg0

df -h /test/
Filesystem                 Size  Used   Avail Use% Mounted on
/dev/mapper/vg0-test  9.9G  151M  9.2G   2% /test

created some pseudo 2GB files with dd and /test now is 

df -h
Filesystem                Size  Used   Avail Use% Mounted on
/dev/mapper/vg0-test  9.9G  2.2G  7.2G  24% /test

lvreduce -L -1G -n /dev/vg0/test
lvs
LV   VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert
test vg0  -wi-a- 9.00G                     

mount /dev/vg0/test /test/
df -h
Filesystem                 Size  Used  Avail Use% Mounted on
/dev/mapper/vg0-test  9.9G  2.2G  7.2G  24% /test

you see after lvreduce 1G and mount /test again , it still shows /test as 7.2G while as it should be 6.2G

Tariq

On Sun, May 20, 2012 at 4:44 AM, Andy Smith <andy strugglers net> wrote:
Hi tariq,

On Fri, May 18, 2012 at 07:43:40PM +0530, tariq wali wrote:
> so to i guess to do this right i should have
>
> resize2fs /dev/vg0/data 1.6T or (1600G)
>
> and then lvreduce -n data -L 100G /dev/vg0/data ( to reduce the lvm by 100
> )

I believe that will also reduce the LV *to* 100G. You want:

# lvreduce -n data -L-100G

if you want to reduce it *by* 100G.

Nothing like FS/LV shrinking to keep you on your toes..

Cheers,
Andy

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEAREDAAYFAk+4KTsACgkQIJm2TL8VSQvadgCdFfn/WdMLPkSsEdiF/+4Py8Ds
hCcAoIVocvHCvD/4lft601QFLqjPHFPC
=pgU1
-----END PGP SIGNATURE-----

_______________________________________________
linux-lvm mailing list
linux-lvm redhat com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



--
Tariq Wali.


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