From owner-freebsd-stable@FreeBSD.ORG Sat May 3 16:31:55 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 929A237B401 for ; Sat, 3 May 2003 16:31:55 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F95543F85 for ; Sat, 3 May 2003 16:31:54 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (bshkjo@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.8p1/8.12.8) with ESMTP id h43NVpB5082971 for ; Sun, 4 May 2003 01:31:52 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.8p1/8.12.8/Submit) id h43NVpuJ082970; Sun, 4 May 2003 01:31:51 +0200 (CEST) Date: Sun, 4 May 2003 01:31:51 +0200 (CEST) Message-Id: <200305032331.h43NVpuJ082970@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <200305032035.h43KZmLO006552@h68-144-29-132.cg.shawcable.net> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.8-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: Why is swap device reported with wrong name? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2003 23:31:55 -0000 Geoffrey T. Falk wrote: > I just added an old drive to use as a swap disk on ad1 on my 4.8-STABLE > system. Why is the name reported as "/dev/rad1s1b"? /dev has both > devices. > > bork% swapinfo > /dev/rad1s1b 130944 5304 125640 4% Interleaved > > /etc/fstab has: > /dev/ad1s1b none swap sw 0 0 The kernel doesn't store the path names of the swap devices, but only the device number (major/minor). So, the swapinfo command goes through /dev and looks for a device with that major and minor number. If you look carefully, you see that ad1s1b and rad1s1b are really the same device (hardlinked): crw-r----- 2 root operator 116, 0x00020009 Apr 11 23:43 /dev/ad1s1b crw-r----- 2 root operator 116, 0x00020009 Apr 11 23:43 /dev/rad1s1b The swapinfo command displays the first one which it finds, which may be either of the two. (Directory entries are not sorted on disk. Only ls sorts them for output.) The devices starting with r* (formerly known as raw devices) exist for compatibility only. Regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. Man had always assumed that he was more intelligent than dolphins because he had achieved so much... the wheel, New York, wars, and so on, whilst all the dolphins had ever done was muck about in the water having a good time. But conversely the dolphins believed themselves to be more intelligent than man for precisely the same reasons. -- Douglas Adams, "The Hitchhikers Guide To The Galaxy"