move zfs geli encrypt mirror to unencrypted

xpetrl xpetrl at beepc.ch
Tue Oct 27 14:07:58 UTC 2020



On 10/27/20 3:02 PM, Steve O'Hara-Smith wrote:
> On Tue, 27 Oct 2020 14:44:50 +0100
> xpetrl <xpetrl at beepc.ch> wrote:
> 
>>> xpetrl <xpetrl at beepc.ch> wrote:
>>>
>>>> Hello,
>>>>
>>>> We have a server with 4 disks, 2 zpool are zfs mirror:
>>>>
>>>> - base system unencrypted, partitions (da*p2)
>>>> - data storage, geli encrypted, partitions (da*p4)
>>>>
>>>> We now want to "move" the data storage (encrypt) to unencrypted
>>>> partition.
>>>
>>> 	Do you still want the encrypted partitions ? If not the simplest
>>> thing to do would be to detach the encrypted devices (daNp4.eli) one at
>>> a time and attach the unencrypted device (daNp4) in its place, wait for
>>> the resilver and repeat for the other devices in the zvol.
>>>
>>
>> Detached one drive daNp4.eli, then I didn't found how to attach daNp4:
>>
>> zpool attach encrypt 3680521480316264201 /dev/da3p4
> 
> 	I presume encrypt is the pool name, but what is
> 3680521480316264201 ?

guid

Yes, encrypt is the pool name.

# zdb -l /dev/da0p4.eli
[...]
children[2]:
	type: 'disk'
	id: 2
	guid: 3680521480316264201
	path: '/dev/da2p4.eli'
	whole_disk: 1
	DTL: 350
	create_txg: 4

> 
> 	If you post the output of zpool status I'll be able to work out the
> right command line to use.
> 

# gpart show

=>         40  23437770672  da0  GPT  (11T)
            40         2008       - free -  (1.0M)
          2048         1024    1  freebsd-boot  (512K)
          3072         1024       - free -  (512K)
          4096    352321536    2  freebsd-zfs  (168G)
     352325632      4194304    3  freebsd-swap  (2.0G)
     356519936  23068672000    4  freebsd-zfs  (11T)
   23425191936     12578776       - free -  (6.0G)

=>         40  23437770672  da1  GPT  (11T)
            40         2008       - free -  (1.0M)
          2048         1024    1  freebsd-boot  (512K)
          3072         1024       - free -  (512K)
          4096    352321536    2  freebsd-zfs  (168G)
     352325632      4194304    3  freebsd-swap  (2.0G)
     356519936  23068672000    4  freebsd-zfs  (11T)
   23425191936     12578776       - free -  (6.0G)

(the same output is for the next 2 disks, da2 and da3)


# zpool status

   pool: encrypt
  state: ONLINE
   scan: scrub repaired 0 in 0 days 04:02:26 with 0 errors on Fri Sep  4 
18:08:21 2020
config:

         NAME           STATE     READ WRITE CKSUM
         encrypt        ONLINE       0     0     0
           mirror-0     ONLINE       0     0     0
             da0p4.eli  ONLINE       0     0     0
             da1p4.eli  ONLINE       0     0     0
             da2p4.eli  ONLINE       0     0     0
             da3p4.eli  ONLINE       0     0     0

errors: No known data errors

   pool: zroot
  state: ONLINE
   scan: scrub repaired 0 in 0 days 00:06:21 with 0 errors on Fri Sep  4 
14:12:09 2020
config:

         NAME        STATE     READ WRITE CKSUM
         zroot       ONLINE       0     0     0
           mirror-0  ONLINE       0     0     0
             da0p2   ONLINE       0     0     0
             da1p2   ONLINE       0     0     0
             da2p2   ONLINE       0     0     0
             da3p2   ONLINE       0     0     0



More information about the freebsd-questions mailing list