Re: ada drive numbering
- Reply: Andrea Venturoli : "Re: ada drive numbering"
- In reply to: Andrea Venturoli : "ada drive numbering"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 09 Feb 2025 22:54:21 UTC
On 9/02/2025 12:03 am, Andrea Venturoli wrote:
> Hello.
>
> I've got a 13.4 box with three SSD and one HDD.
> Usually the SSDs are ada0-ada2 and the HDD is ada3.
> However, from time to time, at boot, HDD becomes ada2 and one SSD
> becomes ada3.
>
> This is annoying and I'd like to avoid it.
> Is there any way to achieve this?
>
> Of course I've searched, but everyone seems to suggest I use labels
> instead of plain device nodes.
> While this makes sense, it does not solve everything, as some scripts
> are not under my control (e.g. Nagios on another machine that checks
> ada2 for remaining life).
>
> Thanks in advance.
>
> bye
> av.
>
Yes it can be a difficult situation. Though the key issue that you
have, is that nagios isn't configured sensibly given the apparent race
condition that your machine is experiencing.
If you can influence the outcome. You have a couple of choices, I use
tunefs to embed the "label", and "glabel status" reveals who's who.
Perhaps, if you really must tie to a specific disk you might consider
the disk id. There may be a clue here (from glabel status)
diskid/DISK-VB57b25b68-76daa0ce N/A ada4
gptid/3e129018-9378-11ee-82e6-0800271cff22 N/A
diskid/DISK-VB57b25b68-76daa0cep1
ufsid/656f301369a4891a N/A
diskid/DISK-VB57b25b68-76daa0cep1
To "see" all the labels, you need to review sysctl's
kern.geom.label.disk_ident.enable: 1
kern.geom.label.gptid.enable: 1
kern.geom.label.gpt.enable: 1
kern.geom.label.ufs.enable: 1
kern.geom.label.ufsid.enable: 1
I'd advise against hard-coding device names, as Bob indicates there's a
race condition; and using some form of label is adventurous during disk
failure/remediation.
Cheerio, Dewayne