Rich Freeman via plug on 28 Oct 2022 10:31:47 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] RAID1 impending failure questions


On Fri, Oct 28, 2022 at 11:59 AM Walt Mankowski via plug
<plug@lists.phillylinux.org> wrote:
>
> > This is a dangerous assumption and should not ever be trusted. While it is
> > the ideal, both SATA and PATA enumerate disks in the order that they are
> > “seen” by the OS, and this has always been the case. You can get away with
> > assuming SATA port 0 is likely /dev/sda most of the time, but SATA port 5
> > is not always /dev/sdf. It’s better to use UUIDs, labels, or other
> > “smarter” methods to ID disks, especially in a degraded mirror where one
> > mistake can result in major
>
> I'm going to save as much info about the 2 drives as I can before I
> try this. Since the drive isn't failing (yet) I suppose I could try
> just unplugging one of them, but obviously I'd like to try to avoid
> that unless as a last resort.
>

Lots of good stuff in these emails but I just wanted to comment on
this bit.  I second that you should never rely on devices like
/dev/sda either being associated with particular hardware interfaces,
OR even that they will be consistent between reboots.  While the
latter is unlikely to change, it could happen if you add another
interface card, or some interface fails to initialize, or a drive
dies, or even due to a kernel update or whatever.

I second that you should prefer using UUIDs, though I will note that
this isn't so important with mdadm as it stores metadata on the
partition and when assembling a RAID it will typically be configured
to scan all your hard drive partitions looking for metadata.  I think
you can configure mdadm to create a RAID without metadata as more of a
raw block device, in which case getting it right is more important,
but this is best avoided and certainly not a default.

The main situation where you need to worry about UUIDs is if you're
running a filesystem directly on a physical partition, since then
there is no way for the kernel to find it except by UUID, label, or
the device name (which can change).  If you're using mdadm or lvm then
the devices are identified using embedded metadata and then exposed as
logical devices that have persistent names.

-- 
Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug