title: Extending a Logical Volume on RHEL7
body: <p>I am using a RHEL7 box, created by our in-house vm-provisioning system.</p>
  
  <p>They create logical volumes for the likes of /var, /home, swap etc. using 2 pools of space.  I was attempting to follow the examples and descriptions of how to add some of that un-allocated space to a volume from <a href="https://www.tecmint.com/extend-and-reduce-lvms-in-linux/" rel="nofollow noreferrer">https://www.tecmint.com/extend-and-reduce-lvms-in-linux/</a>, and am stuck getting 'resize2fs' to operate as expected.</p>
  
  <p>using lvdisplay - I got the appropriate volume:</p>
  
  <pre><code>      --- Logical volume ---
    LV Path                /dev/rootvg/lvvar
    LV Name                lvvar
    VG Name                rootvg
    LV UUID                WGkYI1-WG0S-uiXS-ziQQ-4Pbe-rv1H-0HyA2a
    LV Write Access        read/write
    LV Creation host, time localhost, 2018-06-05 16:10:01 -0400
    LV Status              available
    # open                 1
    LV Size                2.00 GiB
    Current LE             512
    Segments               1
    Allocation             inherit
    Read ahead sectors     auto
    - currently set to     8192
    Block device           253:5
  </code></pre>
  
  <p>I found the associated volume group with vgdisplay:</p>
  
  <pre><code>  --- Volume group ---
    VG Name               rootvg
    System ID
    Format                lvm2
    Metadata Areas        1
    Metadata Sequence No  8
    VG Access             read/write
    VG Status             resizable
    MAX LV                0
    Cur LV                7
    Open LV               7
    Max PV                0
    Cur PV                1
    Act PV                1
    VG Size               &lt;49.00 GiB
    PE Size               4.00 MiB
    Total PE              12543
    Alloc PE / Size       5120 / 20.00 GiB
    Free  PE / Size       7423 / &lt;29.00 GiB
    VG UUID               5VkgVi-oZ56-KqMk-6vmf-ttNo-EMHG-quotwk
  </code></pre>
  
  <p>I decided to take 4G from the Free PE's and extended the space with:</p>
  
  <pre><code>lvextend -l +1024 /dev/rootvg/lvvar
  </code></pre>
  
  <p>which answered as expected:</p>
  
  <pre><code>  Size of logical volume rootvg/lvvar changed from 2.00 GiB (512 extents) to 6.00 GiB (1536 extents).
    Logical volume rootvg/lvvar successfully resized.
  </code></pre>
  
  <p>But when I try to use resize2fs - I get this:</p>
  
  <pre><code># resize2fs /dev/mapper/rootvg-lvvar
  resize2fs 1.42.9 (28-Dec-2013)
  resize2fs: Bad magic number in super-block while trying to open /dev/mapper/rootvg-lvvar
  </code></pre>
  
  <p>I'm sure it's something dumb I'm missing - can anyone push me in the right direction here?</p>