From owner-freebsd-questions@FreeBSD.ORG Fri Sep 3 14:10:51 2010 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 9A69B10657CD for ; Fri, 3 Sep 2010 14:10:51 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.103.93]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9C38FC13 for ; Fri, 3 Sep 2010 14:10:51 +0000 (UTC) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.14.2/8.13.8) with ESMTP id o83EAfOB020540 for ; Fri, 3 Sep 2010 09:10:41 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <201009031410.o83EAfOB020540@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20535.1283523041.1@dc.cis.okstate.edu> Date: Fri, 03 Sep 2010 09:10:41 -0500 From: Martin McCormick Subject: Boot Drive Nomenclature and How to Figure it out X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2010 14:10:51 -0000 I have been writing a script to build a system from a mfsboot startup and it is going well but I want to revisit part of the script that I don't think I did a very good job with. Is there an automatic way to tell which of the devices shown in /dev is a likely system drive? This is before anything is mounted. We can usually figure it out ourselves, but is there a way for a script to figure out automatically which character device could be the one we are going to put the OS on and use as our boot drive? I know this sounds really obvious and you can tell scripts not to use /dev/acdx as they are CDROM devices, but system drives can actually take many different names depending on whether they are RAIDs SCSI IDE, etc. Any good suggestions are appreciated. Martin McCormick