Safe lvm reduce

Luciano Rocha strange at nsk.no-ip.org
Tue Oct 16 13:15:09 UTC 2007


On Tue, Oct 16, 2007 at 02:34:39PM +0200, Demeter Tibor wrote:
>  Dear Listmembers !
> 
>  How can i reduce my LVM logical volume from 1.6 TB to 1.3 TB safely ? I 
>  using ext3 filesystem on this volume and i never should yet this.
>  I know my friend is the lvreduce, but how can i reduce the ext3 filesystem 
>  without datalossing.

You need to first reduce the filesystem size with the command resize2fs.

Make sure the filesystem is unmounted (use a rescue cd, if necessary,
but be advised that lvm commads be then prefixed with "lvm "), force
fsck on it (e2fsck -f device), then run resize2fs new_size_in_fs_blocks.

The value of fs_blocks is usually 4096, but depends on the filesystem.
You can find the correct value with dumpe2fs device | grep size:
...
Block size:               4096
...

Afterwards, do the lvm lvresize device -L $((new_size_in_fs_blocks*4))k

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20071016/1e02a26b/attachment-0001.sig>


More information about the fedora-list mailing list