Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

making a predictable passX name

1 view
Skip to first unread message

G. Paul Ziemba

unread,
Jun 24, 2011, 10:57:29 AM6/24/11
to
Is there a way to set up a constant name for a /dev/passX
device? (Or maybe there is a better way to solve the problem)

% uname -r
8.2-PRERELEASE

% pkg_info | grep amanda-server
amanda-server-3.2.1,1 The Advanced Maryland Automatic Network Disk Archiver (serv)

I'm setting up a Dell Powervault 122T with LTO2 drive to operate
with amanda. I seems to me that chg-robot is the best choice of
changer.

chg-robot uses mtx, which seems to require the name of the /dev/passX
device corresponding to the changer (attached as /dev/ch0).
Therefore, I'm trying to create a link with a constant name
that points to the arbitrary /dev/passX name. I plan to use this
constant name in the amanda config file.

I can manually run "camcontrol periphlist ch0" and obtain the
matching pass device name, so in theory I can write a small
script to create a link such as /dev/ch0.pass -> /dev/passX
and then specify /dev/ch0.pass in the amanda config file.

I wrote the following in /etc/devd.conf:

attach 100 {
device-name "ch[0-9]+";
action "camcontrol periphlist $device-name|grep pass|sed -e 's/:.*\$//'|xargs -I PASS ln -s /dev/PASS /dev/$device-name.pass; logger added ch pass link";
};

detach 100 {
device-name "ch[0-9]+";
action "rm /dev/$device-name.pass; logger removed ch pass link";
};

I also tried the above with just the "logger" parts in the actions.

However, the actions do not seem to be invoked when the ch0 device
is attached (power-on + camcontrol rescan + messages in /var/log/messages).
Maybe devd does not get an "attach" event when ch attaches?

Is there another way to trigger on the attach/detach events for /dev/chX?
Or a way to hard-wire assignment of the /dev/passX names?

Many thanks for your advice.


--
G. Paul Ziemba
FreeBSD unix:
7:56AM up 41 days, 11:37, 34 users, load averages: 0.60, 0.66, 0.63
_______________________________________________
freebs...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi...@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

Alfred Bartsch

unread,
Jun 24, 2011, 12:13:48 PM6/24/11
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can achieve this behaviour via editing /boot/device.hints:

...
# SCSI tape peripherals
#
hint.scbus.0.at="mpt0"
hint.scbus.0.bus="0"
#
# Drive
hint.sa.0.at="scbus0"
hint.sa.0.target="4"
hint.sa.0.lun="0"
hint.pass.0.at="scbus0"
hint.pass.0.target="4"
hint.pass.0.lun="0"
# Changer
hint.ch.0.at="scbus0"
hint.ch.0.target="4"
hint.ch.0.lun="1"
hint.pass.1.at="scbus0"
hint.pass.1.target="4"
hint.pass.1.lun="1"
#

all You have to know is:
- - the SCSI driver (in our case mpt) with its associated bus number (0)
- - target and lun of drive and changer
it is then possible to freely choose a pass device number, in this example:

SCSI_ID 0:4:0 gets pass0 (drive), SCSI_ID 0:4:1 gets pass1 (changer)

changes take effect after reboot, HTH.

- --
Alfred Bartsch
Data-Service GmbH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4Et7wACgkQ5QGe2JdVf3gsrwCguAGB3JaOB2OQA6BQbstwgnaE
K8YAn0F+m+S1UN6SR6WlMuPqxQmtktyi
=WyTG
-----END PGP SIGNATURE-----

G. Paul Ziemba

unread,
Jun 24, 2011, 7:58:29 PM6/24/11
to
bar...@dssgmbh.de (Alfred Bartsch) writes:

Aha. I only looked at the man page for pass(4); I should have
looked at scsi(4).

Thanks!

--
G. Paul Ziemba
FreeBSD unix:

4:56PM up 41 days, 20:37, 32 users, load averages: 0.89, 0.77, 0.69

0 new messages