Bug 450992

Summary: SCSI disk online resize
Product: Red Hat Enterprise Linux 5 Reporter: Watanabe Takashi <wtnb>
Component: kernelAssignee: Rob Evers <revers>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: akarlsso, coughlan, iannis, ktokunag, mchristi, prarit, thenzl
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-19 18:33:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
online resize support for SCSI disk none

Description Watanabe Takashi 2008-06-12 05:14:31 UTC
Description of problem:
on resizeing open'd SCSI disk, new size information will not apply even if I
rescan SCSI disk device.

Version-Release number of selected component (if applicable):
kernel-2.6.18-92.el5

How reproducible:
always

Steps to Reproduce:
(iSCSI example)
1. (target) setup LVM + iSCSI target
     - pvcreate, vgcreate, lvcreate
     - (install scsi-target-utils package)
     - service tgtd start
     - tgtadm --lld iscsi --mode target --op new --tid 1 -T iqn.2008-06.xxx:test1
     - tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg/lv
     - tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
2. (initiator) attach the target volume, mkfs, mount
     - (install iscsi-initiator-utils)
     - service iscsi start
     - iscsiadm -m discovery -t st -p (target IP)
     - iscsiadm -m node -T iqn.2008-06.xxx:test1 -l
     - mkfs.ext3 /dev/sdX
     - mount /dev/sdX /mnt
3. (target) resize LVM device and apply change to target daemon
     - lvextend -L new-size /dev/vg/lv
     - tgtadm --lld iscsi --mode logicalunit --op delete --tid 1 --lun 1
     - tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg/lv
4. (initiator) rescan device
     - echo 1 > /sys/block/sdX/device/rescan
     - cat /proc/partitions
        looks good.
5. (initiator) resize2fs /dev/sdX

Actual results:
# resize2fs /dev/sdb
resize2fs 1.39 (29-May-2006)
The filesystem is already 5242880 blocks long.  Nothing to do!

Expected results:
# resize2fs /dev/sdb
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/sdb is mounted on /mnt; on-line resizing required
Performing an on-line resize of /dev/sdb to 10485760 (4k) blocks.
The filesystem on /dev/sdb is now 10485760 blocks long.

Additional info:
device size information exists in device capacity and in-core inode when device
opened/mounted.
LVM changes both of them, but SCSI changes only device capacity.

attached patch will fix this behaviour.

Thanks.

Comment 1 Watanabe Takashi 2008-06-12 05:14:31 UTC
Created attachment 309029 [details]
online resize support for SCSI disk

Comment 2 Prarit Bhargava 2008-06-16 12:17:52 UTC
Kei, is this a feature request?

P.

Comment 3 Keiichiro Tokunaga 2008-06-16 20:41:13 UTC
Reading the title and descriptions, it sounds like a bug to me.  (Feature
requrests must have a prefix "FEAT" in the title.)

Watanabe-san, can you tell us if it's a feature request or not?

Comment 4 Watanabe Takashi 2008-06-17 01:10:51 UTC
OK, This is a feature request.

some RAID box(like Eternus) have "online LUN expansion" feature and it may be
supported(?) by indivisual driver. I think online-resize would better be
supported by sd_mod or higher layer.

Thank you.

Comment 5 Watanabe Takashi 2008-06-17 05:08:15 UTC
Why is this entry restricted to Fujitsu Confidential Group??
Can I uncheck that checkbox?

Comment 6 RHEL Program Management 2009-02-16 15:44:30 UTC
Updating PM score.

Comment 8 Rob Evers 2013-02-27 18:29:22 UTC
(In reply to comment #0)
> Description of problem:
> on resizeing open'd SCSI disk, new size information will not apply even if I
> rescan SCSI disk device.
> 
> Version-Release number of selected component (if applicable):
> kernel-2.6.18-92.el5
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> (iSCSI example)
> 1. (target) setup LVM + iSCSI target
>      - pvcreate, vgcreate, lvcreate
>      - (install scsi-target-utils package)
>      - service tgtd start
>      - tgtadm --lld iscsi --mode target --op new --tid 1 -T
> iqn.2008-06.xxx:test1
>      - tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b
> /dev/vg/lv
>      - tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
> 2. (initiator) attach the target volume, mkfs, mount
>      - (install iscsi-initiator-utils)
>      - service iscsi start
>      - iscsiadm -m discovery -t st -p (target IP)
>      - iscsiadm -m node -T iqn.2008-06.xxx:test1 -l
>      - mkfs.ext3 /dev/sdX
>      - mount /dev/sdX /mnt
> 3. (target) resize LVM device and apply change to target daemon
>      - lvextend -L new-size /dev/vg/lv
>      - tgtadm --lld iscsi --mode logicalunit --op delete --tid 1 --lun 1
>      - tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b
> /dev/vg/lv
> 4. (initiator) rescan device
>      - echo 1 > /sys/block/sdX/device/rescan

The iscsi subsystem may not update all the initiator host information.
Please try:

iscsiadm -m session -R

>      - cat /proc/partitions
>         looks good.
> 5. (initiator) resize2fs /dev/sdX