1

I'm still new with FreeNas and RAID system.
I successfully make a file server with FreeNAS with 2 TB of Harddrive formated with ZFS.
Now i want to make it RAID 1, by adding another 1, 2TB Harddrive.
What i want to ask, if this possible? adding another Harddrive in installed and configured FreeNas?

Thanks
Ivan

Ivan
  • 165
  • 2
  • 6
  • This is possible but not via the FreeNAS BUI. It can be done manually see this blog post for an example CLI method to do this: http://techblog.danielpellarini.com/sysadmin/how-to-convert-a-stripe-into-a-mirror-in-freenas/ – Darren Moffat Sep 07 '17 at 16:23

2 Answers2

3

I like the approach by Shane Madden, but there is another solution. Darren Moffat's comment points to a dead link.

The solution is via zfs attach. For example:

Create a test pool:

root@test:~# zpool create storage scsi-36002248097081fa717c55d6b0d8cf10f
root@test:~# zpool status
  pool: storage
 state: ONLINE
  scan: none requested
config:

        NAME                                      STATE     READ WRITE CKSUM
        storage                                   ONLINE       0     0     0
          scsi-36002248097081fa717c55d6b0d8cf10f  ONLINE       0     0     0

errors: No known data errors

Fill some data:

root@test:~# dd if=/dev/urandom of=/storage/data.txt bs=64M count=12

Attach the new drive, note the syntax: you have to specify to which drive you want to attach:

root@test:~# zpool attach storage scsi-36002248097081fa717c55d6b0d8cf10f scsi-36002248027420d0aa88109aea4d03c5b

root@test:~# zpool status
  pool: storage
 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 Mon Jul 29 14:49:20 2019
        34.6M scanned out of 385M at 3.15M/s, 0h1m to go
        30.5M resilvered, 8.98% done
config:

        NAME                                        STATE     READ WRITE CKSUM
        storage                                     ONLINE       0     0     0
          mirror-0                                  ONLINE       0     0     0
            scsi-36002248097081fa717c55d6b0d8cf10f  ONLINE       0     0     0
            scsi-36002248027420d0aa88109aea4d03c5b  ONLINE       0     0     0  (resilvering)

errors: No known data errors

As you can see it creates a mirror (i.e. RAID1) as you wanted. This procedure can be used to add more drives to the mirror too. After the ZFS resilvering, all of your data will be redundant and not just the newly written one.

  • For me this worked, although the right GEOM was a hussle. `# zpool attach storage scsi-36002248097081fa717c55d6b0d8cf10f ada0 # zpool status` finally did it for me – ExploWare Mar 13 '20 at 14:55
1

ZFS does not support a "reshape" operation of any kind, so you cannot take your existing drive and convert it into being in a mirror pair (the ZFS term for RAID1).

However, what you can do is to add the new disk to the pool normally (not in a RAID-type pair), but then set copies=2, forcing files to be stored across multiple disks to provide the same level of data protection.

zfs set copies=2 poolname

Note that the new copies policy only applies to newly written data; you'll need to get the extra copies written to the second disk by re-writing them (potentially via a zfs send then zfs recv).

Shane Madden
  • 114,520
  • 13
  • 181
  • 251