Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2005 11:32:04 -0400
From:      Brian Fundakowski Feldman <green@freebsd.org>
To:        Juho Vuori <juho.vuori@kepa.fi>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Finding out names of mountable devices
Message-ID:  <20050512153204.GD2058@green.homeunix.org>
In-Reply-To: <42836020.4050500@kepa.fi>
References:  <42836020.4050500@kepa.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 12, 2005 at 04:54:40PM +0300, Juho Vuori wrote:
> Tried on freebsd-questions without an answer. I suppose this is not 
> doable, but I'll ask here anyway.
> 
> If I plug in e.g. a USB thumb drive, which becomes, say, umass0. 
> Normally something like /dev/da0 will also be created and slices of that 
> device may be mounted. But is there a API for finding out what is the 
> corresponding block device for umass devices? The device driver writes 
> that to syslog, but reading logs for something like that is quite clumsy. 

One easy way is to look for changes in the GEOM topology:

green# sysctl -b kern.geom.conftxt
0 DISK cd0 4627595264 2048 hd 0 sc 0
0 DISK ad0 164696555520 512 hd 16 sc 63
1 MBR ad0s1 164694749184 512 i 0 o 32256 ty 165
2 BSD ad0s1g 141340864512 512 i 6 o 23353884672 ty 7
2 BSD ad0s1f 21474836480 512 i 5 o 1879048192 ty 7
2 BSD ad0s1e 268435456 512 i 4 o 1610612736 ty 7
2 BSD ad0s1d 268435456 512 i 3 o 1342177280 ty 7
2 BSD ad0s1c 164694749184 512 i 2 o 0 ty 0
2 BSD ad0s1b 1073741824 512 i 1 o 0 ty 1
2 BSD ad0s1a 268435456 512 i 0 o 1073741824 ty 7

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green@FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050512153204.GD2058>