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/mapper/VolGroup-lv_root
                      49448240 32460396  14481324  70% /
tmpfs                  4030688        0   4030688   0% /dev/shm
/dev/sda1               495844    89383    380861  20% /boot
/dev/dm-3              6190656   141304   5735000   3% /luks  <<<<<<<<<<
# 
# lsblk
NAME                                                   MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sr0                                                     11:0    1 1024M  0 rom   
sdb                                                      8:16   0   40G  0 disk  
└─sdb1                                                   8:17   0   40G  0 part  
  ├─VolGroup-lv_root (dm-0)                            253:0    0 47.9G  0 lvm   /
  └─VolGroup-lv_swap (dm-1)                            253:1    0  7.6G  0 lvm   [SWAP]
sdd                                                      8:48   0   10G  0 disk  
└─sdd1                                                   8:49   0   10G  0 part  
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  <<<<<<<<<<
sda                                                      8:0    0   16G  0 disk  
├─sda1                                                   8:1    0  500M  0 part  /boot
└─sda2                                                   8:2    0 15.5G  0 part  
  ├─VolGroup-lv_root (dm-0)                            253:0    0 47.9G  0 lvm   /
  └─VolGroup-lv_swap (dm-1)                            253:1    0  7.6G  0 lvm   [SWAP]
# 
# vgs
  VG       #PV #LV #SN Attr   VSize  VFree
  VolGroup   2   2   0 wz--n- 55.50g    0 
  luks_vg    1   1   0 wz--n- 10.00g 4.00g
# 
# lvs
  LV      VG       Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert
  lv_root VolGroup -wi-ao---- 47.91g                                             
  lv_swap VolGroup -wi-ao----  7.60g                                             
  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
  • cryptsetup-luks

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.