On Thursday 30 January 2025 16:55:00 Greenwich Mean Time gevisz wrote:
[snip ...]

> After setting up one of them as a ZFS mirror, I immediately
> got the problem that if I boot my system with additional HDD
> connected to my computer, one of these ZFS mirror disks
> is not detected and the corresponding zpool appears to be degraded.
> 
> I have realized that it was my fault to use /dev/sdb and /dev/sdc
> notations when setting up the ZFS mirror because with more disks
> at the boot time these notations may change.
> 
> I should have used /dev/disk/by-id/ata-WDC_WD5000* notations instead!

With ZFS you should probably have used the unique device ID obtained by 
running:

lsblk -o name,wwn

My ZFS experience is cursory to know it if makes a material difference, but 
according to the Gentoo wiki page this is what OpenZFS prefers:

https://wiki.gentoo.org/wiki/ZFS#Preparing_disk


> Unfortunately, I have not found the way to change these notations
> other than deleting the whole zpool and re-creating it anew with
> the notations /dev/disk/by-id/ata-WDC_WD5000*, which took quite
> a lot of time.
> 
> Presumably, the problem with detecting my ZFS mirror HDDs
> should have disappeared after that because now the disks were
> referred to by their ids but unfortunately it was not the case.
> 
> When I boot my computer with an additional external HDD
> attached to the computer via USB, one of my ZFS mirror HDDs
> is not detected by the system and the corresponding zpool again
> appears to be degraded until I restart my computer in the usual
> setup, that is, without any additional HDD attached to it.
> 
> I have looked into my /dev/disk/by-id/ directory and found out
> that this happens because one of these ZFS mirror HDDs
> does not appear in this directory at all!

When USB drives are plugged in, or the system boots with a USB drive already 
plugged in, they may not be detected in the same order against other connected 
drives and their logical device name can change e.g. from /dev/sdb to /dev/
sdc.

However, this will not stop a HDD from being detected.  Its logical name may 
change, but the disk by-id and wwn will not.


> The situation remained the same even after swapping the
> undetected 500GB WD HDD with the one.
> 
> So, I wonder if it is a fault of
> 1) refurbished WD HDDs

Run smartctl tests to see what they detect.  Any error reported indicates a 
hardware problem.


> 2) my almost 20 years old Ultra-Durable Gigabyte motherboard

Try a different SATA port and cable from what you've been using so far to 
connect the second hard drive.  Either may be faulty.


> 3) the Linux system itself.

Highly unlikely, but booting with a liveUSB will soon confirm this.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to