How to grow a filesystem sitting on a LUKS volume with it remains open?

Solution Verified - Updated -

Issue

  • I need to grow a filesystem sitting on a LUKS encrypted volume whose backing device is a logical volume luks_lv sitting on a volume group luks_vg as shown below:
# df
Filesystem           1K-blocks     Used Available Use% Mounted on
/dev/dm-3              6190656   141304   5735000   3% /luks                             <<<<

# lsblk
NAME                                                   MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sdc                                                      8:32   0   10G  0 disk  
└─sdc1                                                   8:33   0   10G  0 part  
  └─luks_vg-luks_lv (dm-2)                             253:2    0    6G  0 lvm   
    └─luks-a9b47d2a-2daf-4a86-83cf-784ee707f294 (dm-3) 253:3    0    6G  0 crypt /luks   <<<<

# vgs
  VG       #PV #LV #SN Attr   VSize  VFree
  luks_vg    1   1   0 wz--n- 10.00g 4.00g                                               <<<<

# lvs
  LV      VG       Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert
  luks_lv luks_vg  -wi-ao----  6.00g                                                     <<<<
# 
  • I ran resize2fs to resize the filesystem after extending the logical volume on which the filesystem was sitting. However it said 'Nothing to do!' as shown below:
# lvextend luks_vg/luks_lv -L +1G
  Extending logical volume luks_lv to 7.00 GiB
  Logical volume luks_lv successfully resized

# resize2fs /dev/mapper/luks-a9b47d2a-2daf-4a86-83cf-784ee707f294 
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 1572352 blocks long.  Nothing to do!
  • How to grow a filesystem sitting on a LUKS volume with it remains open?

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • LUKS

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content