FUJITA Tomonori schrieb:
On Wed, 29 Oct 2008 12:26:58 +0100
Tomasz Chmielewski <mangoo@xxxxxxxx> wrote:
Sometimes, I need to resize the device on the target.
Technically, I do this as follows:
lvextend -L+5G /dev/san14/blah1
tgt-admin --update tid=20 -v -f
What does exactly 'tgt-admin --update tid=20 -v -f' do? Please explain
what tgtadm operations are performed. Please do so at all times (hint:
I don't understand how tgt-admin works).
Basically, it disconnects all initiators, removes the target, and adds
it again. Removing the lun and adding it again would be enough, as you
also write below.
Well, unless you delete a logical unit and add it again, tgtd doesn't
know the new size. So probably, we need to a new interface to notify
tgtd of the change.
However, the initiators won't see the change unless we "rescan" the
device, i.e.:
echo 1 > /sys/block/sdah/device/rescan
Unless you use 2.6.28-rc kernel, it doesn't work, I think.
It works for me with 2.6.18 kernels.
This is a boring thing to do when we have more initiators connected to
that target.
Also, the initiators will likely have a different device used for that
target (/sys/block/<DEVICE>/device/rescan), making the thing even more
boring.
Is it possible to send a reset/rescan to all initiators connected to a
given target, which would trigger the initiator to rescan the device
(and its size)?
A scsi device can notify initiators of such event via UA (unit
attention), google "CAPACITY DATA HAS CHANGED". tgt has the mechanism
to handle UA so it's easy to support it. However, on the initiator
side, Linux doesn't detect such event automatically.
I see.
So let's just hope Linux will detect such events one day ;)
--
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html