Skip to contentSkip to conversation

Online resizing devices

DISCUSSION Andy 2 participants 2 messages Jul 5, 2005

lore
Share & tools
lore

Andy

author
#0 lore raw

I'd like to do an online resize of and XFS filesystem on a non-partitioned device. But, I always have to reboot to do so.

Say I have a sdc with 16777216 blocks and expand it on the SAN to have 17825792 blocks, and rescan the device.

The xfs_growfs does not see the size, nor does blockdev --getsz /dev/sdc, however, the I know the rescan worked because /sys/block/sdc/size now is 17825792 instead of 16777216.

Is there some reason for this? Is there a fix for it? I'm not using any volume management stuff yet but would like to be able to grow our filesystems without having to reboot to do so.

Andy

#1 lore raw
Quoted 10 lines · Andy

I'd like to do an online resize of and XFS filesystem on a non-partitioned device. But, I always have to reboot to do so.

Say I have a sdc with 16777216 blocks and expand it on the SAN to have 17825792 blocks, and rescan the device.

The xfs_growfs does not see the size, nor does blockdev --getsz /dev/sdc, however, the I know the rescan worked because /sys/block/sdc/size now is 17825792 instead of 16777216.

I've wondered why this is so too occasionally. AFAICT, we are doing everything correctly from the filesystem point of view, we are just not being told of the larger device size when we query it. So, it was interesting to hear that sysfs reports the correct size..

Quoted 1 line

From a quick look through the code - it seems sysfs reports the

value from the struct genhd ->capacity field (get_capacity and set_capacity from <linux/genhd.h>). Whereas the other block device interfaces are looking at the struct block_device bd_inode ->i_size field. So, it kinda looks like a coherency issue between those two beasts - someone more familiar with the block layer may be able to suggest a fix (Christoph/Jens/Al/...).

Quoted 3 lines

Is there some reason for this? Is there a fix for it? I'm not using any volume management stuff yet but would like to be able to grow our filesystems without having to reboot to do so.

I'm not aware of a fix, and the last time I looked using a volume manager doesn't resolve this issue either.

cheers.

Signature · 1 line
Nathan