From owner-freebsd-scsi@FreeBSD.ORG Fri Jun 24 15:20:04 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B17E1065673 for ; Fri, 24 Jun 2011 15:20:04 +0000 (UTC) (envelope-from pz-freebsd-scsi@ziemba.us) Received: from ziemba.us (osmtp.ziemba.us [208.106.105.149]) by mx1.freebsd.org (Postfix) with ESMTP id D345A8FC17 for ; Fri, 24 Jun 2011 15:20:03 +0000 (UTC) Received: from hairball.ziemba.us (localhost.ziemba.us [127.0.0.1]) by hairball.ziemba.us (8.14.4/8.14.4) with ESMTP id p5OEvUbf014355 for ; Fri, 24 Jun 2011 07:57:30 -0700 (PDT) (envelope-from pz-freebsd-scsi@ziemba.us) Received: (from mailnull@localhost) by hairball.ziemba.us (8.14.4/8.14.4/Submit) id p5OEvURW014354 for freebsd-scsi@freebsd.org; Fri, 24 Jun 2011 07:57:30 -0700 (PDT) (envelope-from pz-freebsd-scsi@ziemba.us) X-Authentication-Warning: hairball.ziemba.us: mailnull set sender to pz-freebsd-scsi@ziemba.us using -f Received: (from news@localhost) by hairball.ziemba.us (8.14.4/8.14.4/Submit) id p5OEvUV2014321 for treehouse-mail-freebsd-scsi@hairball.treehouse.napa.ca.us; Fri, 24 Jun 2011 07:57:30 -0700 (PDT) (envelope-from news) From: "G. Paul Ziemba" To: freebsd-scsi@freebsd.org Date: Fri, 24 Jun 2011 14:57:29 +0000 (UTC) Message-id: Errors-to: "G. Paul Ziemba" Subject: making a predictable passX name X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: paul+usenet@w6yx.stanford.edu List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 15:20:04 -0000 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