Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Oct 2016 18:22:14 -0600
From:      jd1008 <jd1008@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Filesystem Label Ambiguity
Message-ID:  <5802C836.1060607@gmail.com>
In-Reply-To: <86pon1dwze.fsf@WorkBox.Home>
References:  <c183f0a0-4459-228a-edb8-bcd8d393ca20@fastmail.com> <86pon1dwze.fsf@WorkBox.Home>

next in thread | previous in thread | raw e-mail | index | archive | help


On 10/15/2016 05:16 PM, Brandon J. Wandersee wrote:
> 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 <label>` on the
> unmounted partition.
>
> As for your second question, I'm pretty sure the one that will be
> mounted if you run mount(8) or put an entry in /etc/fstab will be
> whichever was first detected on start-up.
>
+1
Also you can use
sudo /sbin/e2label /dev/????  <new label>   (of course,  while unmounted).




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5802C836.1060607>