Bug 671581 - unable to online resize a filesystem containing a snapshot
Summary: unable to online resize a filesystem containing a snapshot
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-21 22:16 UTC by Corey Marthaler
Modified: 2018-12-09 16:43 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-08 18:46:57 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Corey Marthaler 2011-01-21 22:16:33 UTC
Description of problem:
There's a chicken and egg issue here. You can't resize an LV containing a snap unless it's deactivated, but then you obviously can't do an online resize if it's not active.

[root@grant-01 ~]# lvs -a -o +devices
  LV      VG         Attr   LSize   Origin Snap%  Devices
  origin  grant      -wi-a- 100.00m               /dev/sdb1(0)

[root@grant-01 ~]# mkfs.ext4 /dev/grant/origin
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@grant-01 ~]# mount /dev/grant/origin /mnt/ext/

[root@grant-01 ~]# df -h
Filesystem                Size  Used Avail Use% Mounted on
/dev/mapper/grant-origin   97M  5.6M   87M   7% /mnt/ext

[root@grant-01 ~]# lvcreate -s grant/origin -n snap1 -L 50M
  Rounding up size to full physical extent 52.00 MiB
  Logical volume "snap1" created

[root@grant-01 ~]# lvextend -L +200M -r /dev/grant/origin
  Snapshot origin volumes can be resized only while inactive: try lvchange -an

[root@grant-01 ~]# umount /mnt/*

[root@grant-01 ~]# vgchange -an grant
  0 logical volume(s) in volume group "grant" now active

[root@grant-01 ~]# lvextend -L +200M -r /dev/grant/origin
  Logical volume origin must be activated before resizing filesystem


Version-Release number of selected component (if applicable):
2.6.32-71.el6.x86_64

lvm2-2.02.72-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
lvm2-libs-2.02.72-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
lvm2-cluster-2.02.72-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
udev-147-2.29.el6    BUILT: Tue Aug 31 16:44:10 CDT 2010
device-mapper-1.02.53-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
device-mapper-libs-1.02.53-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
device-mapper-event-1.02.53-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
device-mapper-event-libs-1.02.53-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010
cmirror-2.02.72-8.el6_0.4    BUILT: Thu Dec  9 09:46:33 CST 2010

Comment 1 RHEL Program Management 2011-04-04 01:58:37 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 2 Milan Broz 2011-05-30 15:31:22 UTC
fsadm should probably ask if it can deactivate LV, then resize it, activate again and resize fs.

I think we should extend fsadm for this but definitely it is not urgent thing, moving to 6.3 for now.

Comment 3 Zdenek Kabelac 2012-01-04 09:21:10 UTC
This is more complicated issue - and since we don't have even upstream solution yet, postponing past 6.3 release now.

For resizing we need active device - since we don't have user-space implementation of kernel drivers to know mapping of inactive device.

Eventually the problem might be solved by switching to newer kind of snapshots via thinp target - but this is not yet upstream supported.

Comment 5 RHEL Program Management 2012-07-10 06:07:53 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-10 23:56:20 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 7 RHEL Program Management 2012-12-14 06:55:48 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.


Note You need to log in before you can comment on or make changes to this bug.