Can't Mirror - Error: "can only attach to mirrors and top-level disks"

sebyldino

Cadet
Joined
Aug 29, 2021
Messages
2
Hi,

I have the same error
"Can't Mirror - error: "can only attach to mirrors and top-level disk""
I there something new to solve it?

I'm new in TrueNAS and i have no data on my TrueNAS so i can reinstall it to the begining. I just want to partionate my SSD 250 Go to get boot and jail because i think it's a shame to dedicate a single 250GB for the boot.

Is there a solution?

Thanks
 

Attachments

  • 1630525803709.png
    1630525803709.png
    312 bytes · Views: 252

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Have you followed this process?

As it mentions in that thread, know that you're going "off piste" here, so for a newbie, you're not setting yourself up for the normal/supported experience.
 

gobygoby

Dabbler
Joined
Aug 5, 2014
Messages
45
I got the same "can only attach to mirrors and top-level disks" error message when I tried to add a 3rd SSD to my metadata/special VDEV:

special
mirror-3 ONLINE 0 0 0
gptid/678e5e86-600f-11eb-a20f-9c5c8ebfa54f ONLINE 0 0 0
gptid/3cb15b9a-111b-11ec-9a78-989096a2dc39 ONLINE 0 0 0
 

gobygoby

Dabbler
Joined
Aug 5, 2014
Messages
45
Update: I was able to successfully replace the drives by adding "-o ashift=9" as described here:

 

tom9933

Dabbler
Joined
Nov 20, 2021
Messages
13
Update: I was able to successfully replace the drives by adding "-o ashift=9" as described here:

Just to clarify did you do something like this? zpool replace -o ashift=9 boot-pool gptid/<faulty-rawuuid> gptid/<new-rawuuid>
 

gobygoby

Dabbler
Joined
Aug 5, 2014
Messages
45
Just to clarify did you do something like this? zpool replace -o ashift=9 boot-pool gptid/<faulty-rawuuid> gptid/<new-rawuuid>
It's been a couple of months, so I don't remember the specifics. But when I do these types of CLI commands, I usually create a txt document as I'm working. It's kinda like a scratch pad which allows me to copy/paste commands I find online and then modify and them. I looked up the text document I was using that night and here are a couple lines from it:

zdb -C fishtank | grep ashift
zpool replace -o ashift=9 pool /dev/disk/by-id/diskIdOldBrokebn? /dev/disk/by-id/diskIdNewOK?
zpool replace -o ashift=9 fishtank /dev/gptid/20c4aaab-1129-11ec-a9a4-989096a2dc39 /dev/gptid/4ec6f810-116e-11ec-a9a4-989096a2dc39

So yes, I believe I did use a command similar to the one you outlined.
 

QonoS

Explorer
Joined
Apr 1, 2021
Messages
87
Update: I was able to successfully replace the drives by adding "-o ashift=9" as described here:


boot-pool of USB-Sticks reports ashift=0. No clue how this came into existence :

[root@truenas ~]# zpool get ashift boot-pool
NAME PROPERTY VALUE SOURCE
boot-pool ashift 0 default


As mentioned in your case "-o ashift=9" did the trick:

[root@truenas ~]# zpool attach boot-pool da1p2 ada1p2
cannot attach ada1p2 to da1p2: can only attach to mirrors and top-level disks
[root@truenas ~]# zpool attach -o ashift=12 boot-pool da1p2 ada1p2
cannot attach ada1p2 to da1p2: can only attach to mirrors and top-level disks
[root@truenas ~]# zpool attach -o ashift=9 boot-pool da1p2 ada1p2
[root@truenas[~]# zpool status boot-pool
[...]
....... NAME STATE READ WRITE CKSUM
....... boot-pool ONLINE 0 0 0
......... mirror-0 ONLINE 0 0 0
........... da1p2 ONLINE 0 0 0
........... ada1p2 ONLINE 0 0 0 block size: 512B configured, 4096B native
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I was running into this gloriously useless error message despite not fitting into the ashift scenario or other typical issues. As it turns out, I can't call zpool attach with the vdev name?

It's pretty late and I need to clear my head before diving into this, but it really feels like this should work with the vdev names (I'd say instead of the disk IDs even, but that would needlessly break things for now). Would anyone happen to know if this has been improved recently?
 

AfroUSA

Dabbler
Joined
Mar 27, 2017
Messages
28
[root@truenas ~]# zpool attach -o ashift=9 boot-pool da1p2 ada1p2
[root@truenas[~]# zpool status boot-pool
Thanks, this helped me with attaching new USB drive to degraded boot mirror.
I used this:
Code:
zpool attach -o ashift=9 freenas-boot da1p2 da0p2

Code:
zpool status freenas-boot


Code:
  pool: freenas-boot
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Wed Oct 25 00:08:32 2023
        7.16G scanned at 193M/s, 80.1M issued at 2.11M/s, 7.16G total
        81.2M resilvered, 1.09% done, no estimated completion time
config:

        NAME          STATE     READ WRITE CKSUM
        freenas-boot  ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            da1p2     ONLINE       0     0     0
            da0p2     ONLINE       0     0     0  (resilvering)
 
Top