[stgt] make initiators "rescan" the device?

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu Oct 30 01:04:55 CET 2008


On Wed, 29 Oct 2008 12:26:58 +0100
Tomasz Chmielewski <mangoo at wpkg.org> 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).

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.


> 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.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list