From: Patrick Mansfield <patmans@us.ibm.com>
To: linux-scsi@vger.kernel.org,
James Bottomley <James.Bottomley@steeleye.com>
Subject: examples using sysfs attributes to scan and delete scsi_devices
Date: Tue, 8 Jul 2003 13:41:47 -0700 [thread overview]
Message-ID: <20030708134147.A32189@beaverton.ibm.com> (raw)
In-Reply-To: <20030708134016.A32161@beaverton.ibm.com>; from patmans@us.ibm.com on Tue, Jul 08, 2003 at 01:40:16PM -0700
Some sample usage of the delete and scan attributes.
The system has one fastt200 (disk array) with 32 LUNs (4:0:0:*),
10 disk drives (4:0:1-10:0).
[root@elm3b79 root]# ls -l /sysfs/bus/scsi
total 0
--w------- 1 root root 0 Jul 8 13:28 delete
drwxr-xr-x 2 root root 0 Jul 8 04:04 devices
drwxr-xr-x 5 root root 0 Jul 8 04:04 drivers
--w------- 1 root root 0 Jul 8 13:08 scan
[root@elm3b79 root]# ls /sysfs/bus/scsi/devices
0:0:0:0 4:0:0:0 4:0:0:14 4:0:0:2 4:0:0:25 4:0:0:30 4:0:0:8 4:0:4:0
0:0:1:0 4:0:0:1 4:0:0:15 4:0:0:20 4:0:0:26 4:0:0:31 4:0:0:9 4:0:5:0
0:0:2:0 4:0:0:10 4:0:0:16 4:0:0:21 4:0:0:27 4:0:0:4 4:0:1:0 4:0:6:0
0:0:3:0 4:0:0:11 4:0:0:17 4:0:0:22 4:0:0:28 4:0:0:5 4:0:10:0 4:0:7:0
0:0:4:0 4:0:0:12 4:0:0:18 4:0:0:23 4:0:0:29 4:0:0:6 4:0:2:0 4:0:8:0
0:0:5:0 4:0:0:13 4:0:0:19 4:0:0:24 4:0:0:3 4:0:0:7 4:0:3:0 4:0:9:0
# delete a few scsi_devices from the disk array
[root@elm3b79 root]# echo "4 0 0 25" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/delete
0+1 records in
0+1 records out
[root@elm3b79 root]# echo "4 0 0 1" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/delete
0+1 records in
0+1 records out
[root@elm3b79 root]# echo "4 0 0 3" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/delete
0+1 records in
0+1 records out
[root@elm3b79 root]# ls /sysfs/bus/scsi/devices
0:0:0:0 4:0:0:0 4:0:0:15 4:0:0:20 4:0:0:27 4:0:0:5 4:0:10:0 4:0:7:0
0:0:1:0 4:0:0:10 4:0:0:16 4:0:0:21 4:0:0:28 4:0:0:6 4:0:2:0 4:0:8:0
0:0:2:0 4:0:0:11 4:0:0:17 4:0:0:22 4:0:0:29 4:0:0:7 4:0:3:0 4:0:9:0
0:0:3:0 4:0:0:12 4:0:0:18 4:0:0:23 4:0:0:30 4:0:0:8 4:0:4:0
0:0:4:0 4:0:0:13 4:0:0:19 4:0:0:24 4:0:0:31 4:0:0:9 4:0:5:0
0:0:5:0 4:0:0:14 4:0:0:2 4:0:0:26 4:0:0:4 4:0:1:0 4:0:6:0
# Rescan a target, in this particular case a REPORT LUN scan occurs
[root@elm3b79 root]# echo "4 0 0 -" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/scan
0+1 records in
0+1 records out
[root@elm3b79 root]# ls /sysfs/bus/scsi
delete devices drivers scan
[root@elm3b79 root]# ls /sysfs/bus/scsi/devices
0:0:0:0 4:0:0:0 4:0:0:14 4:0:0:2 4:0:0:25 4:0:0:30 4:0:0:8 4:0:4:0
0:0:1:0 4:0:0:1 4:0:0:15 4:0:0:20 4:0:0:26 4:0:0:31 4:0:0:9 4:0:5:0
0:0:2:0 4:0:0:10 4:0:0:16 4:0:0:21 4:0:0:27 4:0:0:4 4:0:1:0 4:0:6:0
0:0:3:0 4:0:0:11 4:0:0:17 4:0:0:22 4:0:0:28 4:0:0:5 4:0:10:0 4:0:7:0
0:0:4:0 4:0:0:12 4:0:0:18 4:0:0:23 4:0:0:29 4:0:0:6 4:0:2:0 4:0:8:0
0:0:5:0 4:0:0:13 4:0:0:19 4:0:0:24 4:0:0:3 4:0:0:7 4:0:3:0 4:0:9:0
# Rescan an entire adapter
[root@elm3b79 root]# echo "4 - - -" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/scan
0+1 records in
0+1 records out
# some failure cases
[root@elm3b79 root]# echo "4 0 0 88" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/delete
dd: writing `/sysfs/bus/scsi/delete': No such device
0+1 records in
0+0 records out
[root@elm3b79 root]# echo "4 0 88" > /root/xx; dd if=/root/xx of=/sysfs/bus/scsi/delete
dd: writing `/sysfs/bus/scsi/delete': Invalid argument
0+1 records in
0+0 records out
-- Patrick Mansfield
next prev parent reply other threads:[~2003-07-08 20:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-08 20:40 [PATCH] add sysfs attributes to scan and delete scsi_devices Patrick Mansfield
2003-07-08 20:41 ` Patrick Mansfield [this message]
2003-07-08 20:47 ` Christoph Hellwig
2003-07-08 22:36 ` Patrick Mansfield
2003-07-08 20:50 ` James Bottomley
2003-07-08 21:13 ` Christoph Hellwig
2003-07-08 22:24 ` Patrick Mansfield
2003-07-13 13:43 ` Christoph Hellwig
2003-07-09 20:27 ` [PATCH] take 2 " Patrick Mansfield
2003-07-09 20:29 ` and some example usage of the attributes Patrick Mansfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030708134147.A32189@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox