Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 2009 18:02:44 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        Peter Steele <psteele@maxiscale.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Renaming USB device
Message-ID:  <alpine.BSF.2.00.0911101745400.1838@wonkity.com>
In-Reply-To: <20091111003430.a95d79c8.freebsd@edvax.de>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394F75F@MBX03.exg5.exghost.com> <20091111003430.a95d79c8.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 11 Nov 2009, Polytropon wrote:
> On Tue, 10 Nov 2009 17:19:39 -0600, Peter Steele <psteele@maxiscale.com> wrote:
>> When a system has a USB drive present, the system typically
>> names it /dev/da0. However, if the system has SATA drives
>> hooked to an LSI controller, or if the system has SCSI drives,
>> the same drive prefix is used as is for the USB drive.
>
>> I realize this is something that likely has to be done in the
>> form of a kernel patch, but the question is can it be easily
>> done?
>
> A kernel patch isn't needed and would surely break many working
> subsystems. An option is to use aliases through the means of
> /etc/devfs.conf, e. g.
>
> 	link	da3	usbdisk0

That's fragile for dynamic devices; da3 might not be da3 next time it's 
attached.  You can create a link on device detection through devd.conf 
using ln.  It's also necessary to manually set owner and permissions, 
since devfs.conf settings aren't applied.  Thread about that here:

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=4340+0+archive/2009/freebsd-current/20091101.freebsd-current

> or, if you want to enter the field of partition names in /etc/fstab,
> refer to the disks by their labels, so you don't need to know
> which da device a certain disk or USB stick actually is - it
> gives you independance from the order of detection by the
> system (first detected, first device name).

Labels are an excellent solution in this case.

-Warren Block * Rapid City, South Dakota USA



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