From owner-freebsd-questions@freebsd.org Sat Oct 15 23:16:31 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A0AC13FA9 for ; Sat, 15 Oct 2016 23:16:31 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDE8B86B for ; Sat, 15 Oct 2016 23:16:30 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: by mail-io0-f176.google.com with SMTP id r30so155551272ioi.1 for ; Sat, 15 Oct 2016 16:16:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=W+xX+qijHsQaUBT10qr2IZxCQkCRbl4z5wDBZ5OwL2s=; b=lLDHO8gmf4GVwFjZOR1vFLCF3rM8IsE49Ls2t3icveFT9BPPGO/PC2xrzK5anoessD dCHljy2L3YRi9969TAIPfvd5Z35eER2U+Vc6GqtGtGjDt7qFTM/hsr0rY5yyQBg9XHf9 R3TshZPfjiVy6MIxuMlnK05sY7T9SNTr/kQZJ/5JULrSSEWfXk/YInNtCpEBJEu2LMMq NQH5U1P3GwCB0khLjE2rEH5Qx4xqk6vKZK0s3c1P6tWFWqWhvjUQ+5OUz30yujQN3wD8 npX2RSu11IpA++5aUZlcKeEoKD5vHomPJVVauWANVoRM5p60IEqG9iNBq2dPC0Rd1kJE 6vRA== X-Gm-Message-State: AA6/9RmM+8QUMSYf0+r2Sz0r5v6TItIatz2jqX0+vl++DxSVMillfpzj++0ChJ/xPRIChA== X-Received: by 10.107.7.135 with SMTP id g7mr17825150ioi.15.1476573383863; Sat, 15 Oct 2016 16:16:23 -0700 (PDT) Received: from WorkBox.Home (75-161-202-132.mpls.qwest.net. [75.161.202.132]) by smtp.gmail.com with ESMTPSA id i190sm2191691itf.8.2016.10.15.16.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Oct 2016 16:16:22 -0700 (PDT) Received: from localhost (WorkBox.Home [local]) by WorkBox.Home (OpenSMTPD) with ESMTPA id 4735c0c5; Sat, 15 Oct 2016 18:16:21 -0500 (CDT) References: User-agent: mu4e 0.9.16; emacs 24.5.1 From: Brandon J. Wandersee To: "Jason C. Wells" Cc: freebsd-questions@freebsd.org Subject: Re: Filesystem Label Ambiguity In-reply-to: Date: Sat, 15 Oct 2016 18:16:21 -0500 Message-ID: <86pon1dwze.fsf@WorkBox.Home> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 23:16:31 -0000 Jason C. Wells writes: > Let's say I have three disks and each of them has a partition labelled > "volume3" i.e. /dev/ufs/volume3. > > How can I determine which of those is currently mounted? > > How does the system determine which of those to mount at boot time? Short answer: Don't do this. Long answer: The only thing I can think of is to check /dev/diskid/*. The one filesystem that *does not* have a node /dev/diskid/* will be the one that's mounted. Of course you'd then have to figure out what the ID number of each disk/partition is, which is exactly what unique partition/filesystem labels were invented to avoid. If this more than hypothetical, and you have filesystems that already have labels, they can be changed by running `tunefs -L