*New 12.1 series Release:
2019-11-08: XigmaNAS 12.1.0.4.7091 - released!

*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[Howto] Create a degraded RAIDZ2

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
ms49434
Developer
Developer
Posts: 805
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

[Howto] Create a degraded RAIDZ2

#1

Post by ms49434 » 14 Apr 2017 14:49

It is possible to create a degraded RAIDZ2 in FreeBSD 11 by using temporary memory devices.

Knowledge Level:
Expert.

Prerequisites:
Have a backup of your data before you proceed.

Use Case:
Create a pool (name it jupiter) with one RAIDZ2 virtual device made of 6 hard disks. Two out of the 6 existing hard disks still contain data that should be copied to the new pool. Therefore only 4 hard disks are available for the RAIDZ2. After the transfer is completed, these 2 hard disks shall be integrated into to the RAIDZ2.

Assumptions:
The 4 available hard disks are named da2, da3, da4 and da5.
The 2 hard disks containing data are named da0 and da1.
The 2 temporary devices are assigned the names md3 and md4.
CLI access is available.

Step 1: Prepare the 4 available hard disks
Create a GPT partition, ensure sector alignment is setup properly or use them just as raw devices.

Step 2: Set minimum ashift according to your requirements
Common values for ashift are 9 for hard disks with a sector size of 512 Bytes, actual hard disks have a sector size of 4096 Bytes which is an ashift of 12. Solid State Disks can have 8192 or more Bytes per sector. For hard disks a minimum ashift of 12 is recommended:

Code: Select all

nas4free: ~#sysctl vfs.zfs.min_auto_ashift=12
Step 3: Create temporary devices
Create two temporary devices that will be used to create a RAIDZ2 with 6 devices:

Code: Select all

nas4free: ~#mdconfig -a -t null -S 4096 -s 16T
mdconfig returns: “md3”
nas4free: ~#mdconfig -a -t null -S 4096 -s 16T
mdconfig returns: “md4”
The above commands create two bitsink devices with a block size of 4096 Bytes and a capacity of 16TB.

Parameters explained:
-a: create a memory device.
-t null: make it a bitsink, all writes do nothing, all reads return zeroes.
-S 4096: the block size shall be 4K, adjust it to match the block size of your hard disks if necessary (512, 4096, 8192, 16384 etc.).
-s 16T: the capacity of this temporary device shall be 16TB. This value must be adjusted only if the capacity of all single RAIDZ2 hard disks is greater than 16TB or to the lowest capacity of the devices that will be integrated into the RAIDZ2 later.

Step 4: Create the pool

Code: Select all

nas4free: ~#zpool create -f jupiter raidz2 da2 da3 da4 da5 md3 md4
We need to force (parameter -f) the creation of the pool because of the different device capacities.

Step 5: Take temporary devices offline

Code: Select all

nas4free: ~#zpool offline jupiter md3
nas4free: ~#zpool offline jupiter md4
Step 6: Remove temporary devices

Code: Select all

nas4free: ~#mdconfig -du md3
nas4free: ~#mdconfig -du md4
Step 7: Synchronize WebGUI
Go to Disks -> Management.
In section “Import Disks”.
Check “Clear configuration information before importing disks.”.
Click on “Import”.
Apply changes.

Go to Disks -> ZFS -> Configuration.
Select tab “Synchronize”.
Click on button “Synchronize”.

Step 8: Copy your data
Do whatever is needed to get your data copied to the new pool (create datasets, configure SMB / NFS etc).

Step 9: Prepare your remaining disks
See Step 1.

Step 10: Integrate remaining disks into the RAIDZ2
Go to Disks -> ZFS -> Pools -> Tools.

Select “Replace a Device”.
Press button “Next”.
Select pool jupiter.
Press button “Next”.
Select pool device “md3”.
Select data device “da0”.
Press button “Next”.
Press button “Return to Command Page”.

Select “Replace a Device”.
Press button “Next”.
Select pool jupiter.
Press button “Next”.
Select pool device “md4”.
Select data device “da1”.
Press button “Next”.
Press button “Return to Command Page”.

Repeat step 7.
1) XigmaNAS 12.1.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U3, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.1.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U3, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

kenZ71
Advanced User
Advanced User
Posts: 403
Joined: 27 Jun 2012 20:18
Location: Northeast, USA
Status: Offline

Re: [Howto] Create a degraded RAIDZ2

#2

Post by kenZ71 » 14 Apr 2017 21:17

I like the idea, although if a drive failure occurs while copying data you could lose data if I understand correctly.

To get around this I've created pools with old smaller drives i.e. 1 2TB & 2 3TB copy aso much data as possible then replace the 2TB with another 3TB & resize the pool.
11.2-RELEASE-p3 | ZFS Mirror - 2 x 8TB WD Red | 28GB ECC Ram
HP ML10v2 x64-embedded on Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz

Extra memory so I can host a couple VMs
1) Unifi Controller on Ubuntu
2) Librenms on Ubuntu

User avatar
dorson
NewUser
NewUser
Posts: 7
Joined: 01 Jul 2014 07:48
Status: Offline

Re: [Howto] Create a degraded RAIDZ2

#3

Post by dorson » 18 Jan 2020 21:18

Could you give an explanation of the -s option, which is used when creating a temporary device. My situation, I create RAID1 from 4 disks on 2 Tb. First I create from 3 physical and one temporary. To create a temporary option, -s what to specify?
thanks for the time spent.
Home12.1.0.4 - Ingva (revision 7091) / HP ProLiant N54L G7 MicroServer

User avatar
ms49434
Developer
Developer
Posts: 805
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: [Howto] Create a degraded RAIDZ2

#4

Post by ms49434 » 19 Jan 2020 01:53

dorson wrote:
18 Jan 2020 21:18
Could you give an explanation of the -s option, which is used when creating a temporary device. My situation, I create RAID1 from 4 disks on 2 Tb. First I create from 3 physical and one temporary. To create a temporary option, -s what to specify?
thanks for the time spent.
In your case, anything greater than 2T will work, i.e. 4T - the capacity of the temporary device should be higher than the highest capacity of any of the drives.
1) XigmaNAS 12.1.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U3, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.1.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U3, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

Post Reply

Return to “ZFS (only!)”