From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 24 19:09:55 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BC88197; Thu, 24 Oct 2013 19:09:55 +0000 (UTC) (envelope-from outbackdingo@gmail.com) Received: from mail-oa0-x22a.google.com (mail-oa0-x22a.google.com [IPv6:2607:f8b0:4003:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B74B23B6; Thu, 24 Oct 2013 19:09:55 +0000 (UTC) Received: by mail-oa0-f42.google.com with SMTP id k14so2891656oag.1 for ; Thu, 24 Oct 2013 12:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=noI8hKN35QDmnCnLkPnnuxKVvS5Bk34ImchDGsEpE5U=; b=ytPs/CYG2a0H5enMCt9P84pXpnk4bAGNjcp7bn9bTAq1sS44lgBtw9D6cBcTbNZNa/ kR/rt4R8qu8VdzTeRLh4UkgnQI7sbn7NZpgGnCL9/6nsLWvsNXUp/EiFdQFgkmR3GQNc qkp5XkYebW95YYN+dWqmUvUYVazYuSqK2RimQRILNepv36kMvm6LmBiJV6fRtwhoUPwI 5z7DjYb7XLrPiw9PI/W7Zr+ef/Meo1oh+5B2L1Z1TcKmUx1pp8a4P7PAW0afTL4WaxX2 WBQL0W/VodM5si2/ntXRm7WLR5+kI9kE9HyURXPR2h4w4yKaSlFWpi723PnQE9Ugy6SW 1K4Q== MIME-Version: 1.0 X-Received: by 10.182.142.229 with SMTP id rz5mr3336186obb.12.1382641794264; Thu, 24 Oct 2013 12:09:54 -0700 (PDT) Received: by 10.76.19.115 with HTTP; Thu, 24 Oct 2013 12:09:54 -0700 (PDT) In-Reply-To: References: <1382192148.119437035@f257.i.mail.ru> <1382286899.92499.110.camel@revolution.hippie.lan> Date: Thu, 24 Oct 2013 15:09:54 -0400 Message-ID: Subject: Re: determine drive's SAS port From: Outback Dingo To: Alan Somers Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Alexey Egorov , freebsd-hackers@freebsd.org, Ian Lepore X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 19:09:55 -0000 On Mon, Oct 21, 2013 at 12:42 PM, Alan Somers wrote: > On Sun, Oct 20, 2013 at 10:34 AM, Ian Lepore wrote: > > On Sat, 2013-10-19 at 18:15 +0400, Alexey Egorov wrote: > >> Hello all, > >> > >> I have a server with LSI HBA card, and when I remove drive I can see > following messages in log: > >> > >> (da0:mps0:0:5:0): lost device - 0 outstanding, 2 refs > >> (da0:mps0:0:5:0): removing device entry > >> > >> Is there a way to determine physical port (number "5" in > "(da0:mps0:0:5:0)") when drive is inserted? (I need this to be able to > create device symlinks based on physical port). > >> > >> Thanks in advance. > > > > I don't have hardware like that to play with, but when I plug in an > > eSata drive I get devd events like this: > > > > root@dpnand:/root # cat /var/run/devd.pipe > > !system=DEVFS subsystem=CDEV type=CREATE cdev=pass2 > > !system=DEVFS subsystem=CDEV type=CREATE cdev=ada0 > > !system=DEVFS subsystem=CDEV type=CREATE cdev=ad0 > > !system=DEVFS subsystem=CDEV type=CREATE cdev=ada0p11 > > !system=DEVFS subsystem=CDEV type=CREATE cdev=ad0p11 > > !system=DEVFS subsystem=CDEV type=CREATE cdev=diskid/DISK-10MS109LT74Z > > !system=DEVFS subsystem=CDEV type=CREATE cdev=ufsid/51fabc51ea1a923b > > !system=DEVFS subsystem=CDEV type=CREATE > cdev=gptid/c057d696-fae3-11e2-b79c-5404a6f2f88a > > !system=DEVFS subsystem=CDEV type=CREATE cdev=diskid/DISK-10MS109LT74Zp11 > > ^C > > > > The pass2 dev appears in a camcontrol devlist, like this: > > > > root@dpnand:/root # camcontrol devlist > > at scbus0 target 0 lun 0 (pass2,ada0) > > at scbus2 target 0 lun 0 (pass0,da0) > > at scbus2 target 0 lun 1 (pass1,da1) > > > > Would the camcontrol bus/target/lun output give you the number you're > > looking for? It's a pity there isn't a devd event with more info in it > > (similar to what you get when usb devices come and go), but perhaps with > > some scripting you can make the connection between events and devices. > > > > -- Ian > > > > > > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > If your disk is connected to a SAS expander, then you can use either > SES or SMP commands to figure out the port to which a drive is > connected. But it sounds like your disks are connected directly to > the HBA? If that's the case, the problem is much harder. I don't > think that there is a standard way to get it, and the FreeBSD kernel > doesn't currently help much. mps(4) accepts some custom ioctls to > look up configuration information. To learn how to use them, ask your > LSI FAE for the "Fusion-MPT 2.0 Message Passing Interface (MPI) > Specification Guide". The best solution would be to update the kernel > to report physical path information for da disks. I think that > information is currently reported only for disks connected to a SES > enclosure. > I need to replace a disk connected to a SAS expander also now, there are 44 drives. How do i use this ses to determine the drive, can i make its light blink ?? > > -Alan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >