Create zfs mirror by adding a drive?

Whitesnake

Cadet
Joined
Mar 12, 2021
Messages
4
I can confirm, that mirroring is possible in v12 with the GUI. I extended one HDD with another (which was larger, but doesn't matter).
 

MrMacintosh

Cadet
Joined
Mar 23, 2021
Messages
5
I followed the tutorial of creating the partition so I can extend my 1 drive hdd into a 2 drive mirror, but I still ran into the following error: no such device in pool.

glabel status:
Code:
gptid/5fbe4e11-0688-11eb-8ce8-b42e99aa79e4     N/A  ada0p1
gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4     N/A  ada1p2
gptid/5fc4847b-0688-11eb-8ce8-b42e99aa79e4     N/A  ada0p3
gptid/4d75763c-8c49-11eb-881d-b42e99aa79e4     N/A  ada2p1
gptid/521b6dac-8c49-11eb-881d-b42e99aa79e4     N/A  ada2p2


zpool attach CorCollection gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4 gptid/521b6dac-8c49-11eb-881d-b42e99aa79e4
Code:
cannot attach gptid/521b6dac-8c49-11eb-881d-b42e99aa79e4 to gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4: no such device in pool
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
I still ran into the following error: no such device in pool.
Could you share zpool status -v CorCollection ? we need to see the gptid of the disk that's already in the pool to understand if you did it the wrong way around or if it's something else.
 

MrMacintosh

Cadet
Joined
Mar 23, 2021
Messages
5
Could you share zpool status -v CorCollection ? we need to see the gptid of the disk that's already in the pool to understand if you did it the wrong way around or if it's something else.
Code:
root@freenas[~]# zpool status -v CorCollection
  pool: CorCollection
 state: ONLINE
  scan: scrub repaired 0 in 0 days 02:24:14 with 0 errors on Sun Mar 14 03:24:14 2021
config:

        NAME                                              STATE     READ WRITE CKSUM
        CorCollection                                     ONLINE       0     0   0
          gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4.eli  ONLINE       0     0   0

errors: No known data errors
root@freenas[~]#
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4.eli
So there's your problem.. you're working with a GELI encrypted pool and trying to apply a process that doesn't take encryption into account.

I haven't done much with GELI encryption, so am no expert on it, but I could manage to find this, which seems to offer the steps:

As can be seen there in the commands for attaching the new disk, the gptid is specified including the .eli at the end.
 

MrMacintosh

Cadet
Joined
Mar 23, 2021
Messages
5
So there's your problem.. you're working with a GELI encrypted pool and trying to apply a process that doesn't take encryption into account.

I haven't done much with GELI encryption, so am no expert on it, but I could manage to find this, which seems to offer the steps:

As can be seen there in the commands for attaching the new disk, the gptid is specified including the .eli at the end.
I followed it, but still attach failed. This time with a no Geom provider error.

When I look, I see that my new drive is not added to the geli status list


Code:
root@freenas[/data/geli]# geli init -s 4096 -B none -K /data/geli/[keyname].key gptid/521b6dac-8c49-11eb-881d-b42e99aa79e4
Enter new passphrase:
Reenter new passphrase:
root@freenas[/data/geli]# geli status
                                          Name  Status  Components
                                    ada1p1.eli  ACTIVE  ada1p1
gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4.eli  ACTIVE  gptid/4c653e93-06b6-11eb
 

MrMacintosh

Cadet
Joined
Mar 23, 2021
Messages
5
Update: I used the new disk without the eli, since it didnt get encrypted, and it worked. Though I wonder if it's a bad idea to attach a non ecrypted mirror to an encrypted drive.

Code:
 pool: CorCollection
 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 Mar 24 14:26:31 2021
        2.40G scanned at 117M/s, 632K issued at 30.1K/s, 491G total
        0 resilvered, 0.00% done, no estimated completion time
config:

        NAME                                                STATE     READ WRITE CKSUM
        CorCollection                                       ONLINE       0     0     0
          mirror-0                                          ONLINE       0     0     0
            gptid/4c653e93-06b6-11eb-802b-b42e99aa79e4.eli  ONLINE       0     0
            gptid/521b6dac-8c49-11eb-881d-b42e99aa79e4      ONLINE       0     0
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Though I wonder if it's a bad idea to attach a non ecrypted mirror to an encrypted drive.
Well, if you took the time to encrypt the first disk, you're probably not going to want to have an unencrypted copy sitting right next to it (which is what you now have).

ZFS will happily write to them both, so there's no problem from that perspective.
 

MrMacintosh

Cadet
Joined
Mar 23, 2021
Messages
5
Well, if you took the time to encrypt the first disk, you're probably not going to want to have an unencrypted copy sitting right next to it (which is what you now have).

ZFS will happily write to them both, so there's no problem from that perspective.
I ended up detaching the disk and making it a new vdev. Since I'm just using them as a backup, I basically just backed up the data to an external hdd. Then I'm going to just use the two as a mirror for data and plex stuff. I realized that redundancy is not too important for me as much as just backups, so I don't really need a mirror.

This is making me rethink how I use my main computer and my server for the future. Lots of 1 to 2 TB hdds in my main computer holding junk, while I offload the important stuff to the NAS server. I'll probably use a new thread to discuss my dillemma.
 

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
It is NOT clear at all what "Extend" means, when you have a single vdev stripe that would tell me that we are concatenating the chosen disk to the existing disk so that the stripe has 2 members and is larger. VMware does this and it adds an extent to your existing iSCSI/FC LUN.

I just mirrored a 128GB NVME with a 500GB NVME. I do not intend on keeping the 128 gig disk in so for me this was painless.

Next I have to figure out if I want to offline or detach the smaller 128GB NVME disk.
 

fossnik

Dabbler
Joined
Aug 30, 2018
Messages
12
I can confirm, that mirroring is possible in v12 with the GUI. I extended one HDD with another (which was larger, but doesn't matter).
I'm afraid I'll mess something up by using CLI, so I was glad to hear this. However, I still couldn't figure out how to perform this in GUI. Can you to point me to someplace where the GUI procedure is documented?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Can you to point me to someplace where the GUI procedure is documented?
It's not in the manual, but I described it in another thread:

Note that the name of the command that should be attach is actually extend in the GUI, so you need to understand that before the process will make sense.
 
Joined
Jan 27, 2020
Messages
577
Why is this still not possible via the GUI? I can only choose a stripe expand...

But this is working just well:
Code:
gpart create -s gpt /dev/adaX
gpart add -b 128 -t freebsd-swap -s 2G /dev/adaX
gpart add -t freebsd-zfs /dev/adaX
Run zpool status and note the gptid of the existing disk
Run gpart list and find the gptid of the newly created partition. It is the rawuuid field. In this example it would be rawuuid of adaXp2
zpool attach MyPoolName /dev/gptid/[gptid_of_the_existing_disk] /dev/gptid/[gptid_of_the_new_partition]
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Why is this still not possible via the GUI?
It is, and has been since the release of 12.0. I know I created a thread about it when I saw it, but I can't find it right now. But it's there. Edit: and the post right above yours links to instructions.
 
Joined
Jan 27, 2020
Messages
577
Click the 3 dots to the right of the existing disk in the pool and select Extend (that's really the wrong word here... it should be attach... , but it's the right option)
OK, so it's there but it is not documented and the wording "to extend" the pool there is misleading.
A simple "add mirror" in a dropdown would be sufficient...
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
Joined
Jan 27, 2020
Messages
577

mjflower

Dabbler
Joined
Sep 14, 2020
Messages
25
I know I should probably post this in a Scale forum but I want to do exactly the above but looking at the commands wonder if this is not applicable to me on Scale. I haven't been game to try the commands below because I'm not on Freebsd but Debian with using Truenas Scale.

gpart add -b 128 -t freebsd-swap -s 2G /dev/adaX
gpart add -t freebsd-zfs /dev/adaX

Can I still use the commands above as part of the process or should it be different on Scale? And yes, apull down option would be wonderful but realise they've got their hands full..

Thanks
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
gpart won't be available on Linux and the partition type freebsd-swap is most certainly not suitable, either. I can have a look at my scale installation later, if nobody more Linux savvy jumps in.

  • find out how partitions are referenced in the zpool
  • find out which of the dozen of different partitioning tools is actually present in SCALE
  • find out the partitioning scheme for the existing disk
  • recreate on the new disk
  • run zpool attach ...
 
Top