Re: resize LVM (ext3)

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



On Wed, Oct 29, 2008 at 12:58:32PM +0100, David Hláčik wrote:
<snip>
>    1. How can i be sure that i will shrink ext3 to exact size 80GB and that

dev=/dev/system/home
resize2fs $dev 80G

Then, to be sure of the real size:
blks=$(tune2fs -l $dev | awk -F: '/Block size/ { print $2/512 }')
fssize=$(tune2fs -l $dev |
  awk -v bs=$blks -F: '/Block count/{print $2*bs}')

Now, $fssize has the complete size in bytes. Verify it:
echo $fssize

Now, for lvresize:
lvresize -L 80G system/home

Verify that the printed target size matches the wanted value.

>    3. Or can i just use lvreduce and my ext3 will shrink automatically?

NO! lvreduce doesn't care about what's inside, and will happily lose
data.

>    4. Do i need to umount system/home when resizing?

Yes, and you must do a full fsck also:

e2fsck -f /dev/system/home

Regards,
Luciano Rocha

-- 
lfr
0/0

Attachment: pgpSKhDZ2gLHL.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux