From owner-freebsd-questions@FreeBSD.ORG Wed Nov 11 00:22:33 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 277A51065679 for ; Wed, 11 Nov 2009 00:22:33 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id DA13E8FC08 for ; Wed, 11 Nov 2009 00:22:32 +0000 (UTC) Received: from r55.edvax.de (port-92-195-97-236.dynamic.qsc.de [92.195.97.236]) by mx01.qsc.de (Postfix) with ESMTP id 6F43A3D6B8; Wed, 11 Nov 2009 01:22:30 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id nAB0MUg8005004; Wed, 11 Nov 2009 01:22:30 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 11 Nov 2009 01:22:30 +0100 From: Polytropon To: Peter Steele Message-Id: <20091111012230.ddd3acc5.freebsd@edvax.de> In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394F772@MBX03.exg5.exghost.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394F75F@MBX03.exg5.exghost.com> <20091111003430.a95d79c8.freebsd@edvax.de> <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394F772@MBX03.exg5.exghost.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" Subject: Re: Renaming USB device X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2009 00:22:33 -0000 On Tue, 10 Nov 2009 17:47:38 -0600, Peter Steele wrote: > I have a bootable FreeBSD image on a USB stick that clones > itself on the target system's hard drive, creating partitions > and other configuration as defined in the cloning logic. > The /etc/fstab on the USB image is hard coded to mount > root (/) from /dev/da0s1a. However, other systems where > the hard drives use the same prefix as the USB stick, > the fstab on the stick is incorrect (it would need to be > /dev/da4s1a on systems with four SCSI drives since those > disks would be names da0-da3). > > So what we really want is a way to solve this problem-- > Have a generic bootable USB drive that doesn't need to > have a custom fstab for different kinds of systems. In this case, labelling the USB stick would be a good chioce. The /etc/fstab entries then refer to those labels instead of device names (that could change). You can use generic labels as well as UFS labels here; even a reference to the UFSID would be possible, as well as independant from da detection order. For the target hard disk, which sometimes is ad (ATA disks), sometimes da (SCSI and SATA disks), a conditional based upon dmesg could be a good way to automate the process of finding out where to install to. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...