[linux-lvm] Find Correct LE Size of ext4 Partition (16TB)

Sebastian Walter sebastian.walter at fu-berlin.de
Tue Oct 8 09:06:14 UTC 2013


Dear List,

For extending an ext4 partition to some additional TBs, I extended the
underlying logical volume (LV) to fill the entire physical volume of the
disk. This was about 19.4 TB. While trying to extend the ext4 partition
to fill the hole LV, I realized that the ext4 size limit is still at
16TB. So I set the partition to 16TB. Now I'm wasting space on the LV
which I would like to again be reduced to the minimum size of the
partition (16TB).

Has anyone an idea to exactly calculate the amount of logical extends
(LE) needed for holding the 16TB partition? I'm sure there are some
bytes needed for overhead, journaling, etc. Maybe we can read it from
one of these outputs:

This is the partition:
tune2fs -l /dev/storage/storage
tune2fs 1.42.8 (20-Jun-2013)
Filesystem volume name:   storage
Last mounted on:          /mnt/storage/mnt/storage
Filesystem UUID:          9c05fe79-6a1b-484e-980d-788a6cf5b99c
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index
filetype needs_recovery extent sparse_super large_file uninit_bg
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              2147483648
Block count:              4294967295
Reserved block count:     42909770
Free blocks:              229845414
Free inodes:              1929998857
First block:              0
Block size:               4096
Fragment size:            4096
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         16384
Inode blocks per group:   512
Filesystem created:       Tue Sep 18 14:50:21 2007
Last mount time:          Tue Oct  8 04:00:16 2013
Last write time:          Tue Oct  8 04:00:16 2013
Mount count:              24
Maximum mount count:      36
Last checked:             Sat Oct  6 14:50:58 2012
Check interval:           15552000 (6 months)
Next check after:         Thu Apr  4 14:50:58 2013
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      675a96e5-faf3-4576-af10-713007ac8387
Journal backup:           inode blocks

This is the Logical Volume (vgdisplay -v):
--- Logical volume ---
  LV Name                /dev/storage/storage
  VG Name                storage
  LV UUID                KQtBJN-RXzo-UUhT-MeiR-Ack8-QB2x-g9aPOT
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                19.18 TB
  Current LE             5027838
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:24

And this is the Volume Group (vgdisplay):
  --- Volume group ---
  VG Name               storage
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  174
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               19.77 TB
  PE Size               4.00 MB
  Total PE              5181438
  Alloc PE / Size       5181438 / 19.77 TB
  Free  PE / Size       0 / 0
  VG UUID               ZalMV7-fZqp-mBA3-aYzi-iADF-VDWV-YIifQr

What I would like to know is the correct *extents* parameter for
lvreduce. Any help is greatly appreciated!

Sebastian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5045 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20131008/1ccdf4f3/attachment.p7s>


More information about the linux-lvm mailing list