• Re: [gentoo-user] Problem with detecting ZFS HDD

    From Grant Taylor@21:1/5 to gevisz on Thu Jan 30 22:10:01 2025
    On 1/30/25 10:55 AM, gevisz wrote:
    I should have used /dev/disk/by-id/ata-WDC_WD5000* notations instead!

    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.

    I got around this years ago on an Ubuntu system by doing an export
    followed by a slightly special import:

    zpool export tank
    zpool import -d /dev/disk/by-id tank

    You can find more details and specifics in an article that I wrote about installing Ubuntu 16.04 on a ZFS root.

    Link - Ubuntu 16.04 (Xenial) ZFS native root install
    - https://dotfiles.tnetconsulting.net/articles/2016/0327/ubuntu-zfs-native-root.html



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to gevisz on Fri Jan 31 01:20:01 2025
    On 1/30/25 16:58, gevisz wrote:
    Thank you for your reply.

    You're welcome.

    I will look into the link but, as far as I understand,

    Feel free to ask questions, either here or directly to me if you feel
    it's not germane to Gentoo.

    it does not answer the question why one of my ZFS disks does not
    appear in /dev/disk/by-id/ directory when I boot my computer with
    additional disk connected to it.

    I only commented on the part that I quoted.

    Looking back at your original message, if the missing disk doesn't
    appear in dmesg (assuming that dmesg hasn't wrapped) then the system
    isn't seeing the drive for some reason. If the system isn't seeing the
    drive at all, there won't be a sym-link in /dev/disk/by-id etc.

    I can't speculate as to why the disk doesn't show up if the USB drive is attached.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Fri Jan 31 11:24:39 2025
    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.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmecsvcACgkQseqq9sKV Zxl3DRAAhVA7YIT86tzoQbTfAcE7j94BH1Kc8I1kmmh1tupScfcv3Gzi8BTzCvXM DIgOwDfS7F668d+OChlELPl5qRXuL3SHT6tPG2/Ab2Ck8ATbw6JNf5PK9Bo0Mpjd uDvyTpHB3cvaC4YwvDYXcHYkMp4P0f/QOKlilw673jY3yEOvA9l2UMQdLAe9gCPQ Vdh6LaFzVFJs64HmH8s2+Yt00SWh+2X6zx4ELz7hdB8T0METNo8MaJgJbiWvtnQl ExO2vbu/eq9uPy/HTFcIvfMi9CdIDHir4dEBY5GZTv6TZ156hTGO6gpwAnJD5uXQ H3NVdkbfShP2hbTO907XteAu3uVJF1IKY9JUnBJ209Ml0aFyx4DXiarKe7bnBemu vtFvovPKlvhV//4UNs/sH/kHNXOCI1GjNu8h1B+GUk4LRZ/KUY6ihGqYkSdTMd8s 0aew0LisNpnATJZnHYW/LE0BHq/TmwPXTafPLj/UhI645EHv/OEYSjGe6DTlja7z w1Yfic2H44bKqhP2+dktG1kHr4dw1v8fLCyseSwvAE3oQAnwXvOP5vT+e5oGajVm a0tJpxRr8rhmzB8HdJnNVQjYbFa+HTmlvxVCKlxUtk9nkDQsK7xDfn5BWYKD3q/U lA+/EmsTbYijU+Mr8R89TMloOgNQI/W4vgMlTA3XDIKHJq53D3U=
    =Zp8x
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to gevisz on Sun Feb 16 18:00:02 2025
    On 01/02/2025 00:13, gevisz wrote:
    The problem is that after booting with an additional HDD,
    one of these ZFS HDDs does not report any of its disk id:
    nor wwn neighter in the form ata-WDC_WD5000*.

    The situation remained the same even after swapping the
    undetected 500GB WD HDD with the one.
    And now, this makes me think that the problem is indeed with the SATA port.

    I know I'm very late to the party but ...

    As linux boots, it will allocate an sd* address to all the drives it
    sees. So if you've got three drives, but only sda and sdb, then one of
    them hasn't been detected.

    Seeing as /dev/disk/by-id is only a symlink to /dev/sda, /dev/sdb etc,
    from what you say I suspect you won't see the relevant sdx entry in /dev
    That to me seems the obvious way to do things - linux assigns a "random"
    name to the device, so it can read the device, and then symlinks the
    device name to whatever random code got assigned initially.

    As to why, do you have a manual for your mobo? It's an unfortunate fact
    (and I don't know when it started) that a lot of SATA ports nowadays
    don't work a lot of the time. When I was looking for a mobo, there was a
    lot of "if you stick an NVMe in, it will disable SATA4" or whatever.
    Likewise, if you used an external graphics card, depending on what PCIe
    it was, it might disable certain SATA ports. Given that I wanted about
    six *working* sata ports, that was a pain in the proverbial!

    Basically, a lot of things nowadays run over the PCIe bus, and it's very
    common for (a) lanes to be shared between different devices, and (b)
    there's a pecking order - if multiple devices share a lane, only the
    highest up the pecking order will work.

    So of course, sods law probably says you can't even get a SATA expansion
    board, because that will require the hijacked lane and won't work ...

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)