Migrating data from mdadm to TrueNas Scale

Joined
Mar 10, 2022
Messages
3
Hi All

I'm looking to switch my current storage solution to TrueNAS Scale. My hardware is as follows

Lenovo TS140
CPU: E3-1226 V3
OS: Ubuntu 20.04.4 LTS
RAM: 16GB ECC
4x 4TB WD hard drives in MDADM raid 5
1 x 128GB SSD for the OS

It's currently running Plex and 4/5 docker containers.

I'm starting to run low on space (around 2TB free) and the case doesn't have any more room to add any more disks so I've decided to transplant the motherboard and drives to a larger 4U case and add a HBA (IBM M5110) in IT mode.

I have another 4 x 4TB disks on their way but I don't have the hardware to build TrueNAS side by side with my existing server. I was wondering if the below would be possible?

  1. Install TrueNAS Scale on the SSD
  2. Create a new pool with the new disks
  3. Mount the MDADM array in the OS
  4. Move the data from the old array to the new pool
  5. Format the drives from the old array
  6. Add the old drives to the new pool

Apologies if this question has been asked before but when I searched for this all I could find was people trying to use mdadm in TrueNAS which I know is not supported.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
In theory that can work.

Practice is something else. Basically you are off common procedures, so as they say, your mileage may vary. And of course, have backups. A single 12TB or large drive can work to backup 3 x 4TB drives, (removing the single parity of RAID-5 from the space calculations).

Last, 4TB drives are not recommended for RAID-5 or RAID-Z1, (the ZFS single parity equiv).
 
Joined
Mar 10, 2022
Messages
3
My plan is to switch to RAID-Z2 once the 8 drives are in the pool. Is that possible or would I be stuck in z1 if that's what I initially set the new drives to when I do the build?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
ZFS does not allow changing from RAID-Z1 to RAID-Z2 without complete rebuild of pool.

Nor, at present, is adding a disk to a RAID-Z1/2/3 vDev, (though this a feature in progress, probably not ready til next year).

Their are some tricks that can overcome initial limited disks. But they can be, well, tricky. Especially for people new to ZFS. Basically we don't recommend people use those tricks because if implemented poorly, can cause data loss.

So, going from MD RAID-5 with 4 disks to 8 disks in RAID-Z2 would be best accomplished by full backup, (or 2, or 3), and then making the 8 disk RAID-Z2 from the old 4 disks and the 4 new disks.
 
Joined
Oct 22, 2019
Messages
3,641
MDADM under TrueNAS SCALE? I'm not sure how nice it will play, let alone if it might confuse some sort of middleware process during this migration.

It's feasible to do this under a live Linux ISO. Just make sure to install the zfs and zfs-utils packages, and go from there: start the mdadm array, mount the file-system, mount the ZFS dataset(s), and copy everything over. Reboot back into SCALE.

I'd create the ZFS pool under TrueNAS SCALE first (not under the Linux distro), to play it safe, since there's a chance that the Linux distro you use might have a newer version of ZFS and risk enabling a backwards-incompatible pool feature.
 
Joined
Mar 10, 2022
Messages
3
Actually that's a great idea. I'll do that I'm doing the server transplant today. I'll install truenas on another ssd and build the new zpool as raid z2 then mount it in Ubuntu and do the transfer. I do have a spare 4tb portable drive so I'll move what I can over to the new array and then the rest can be moved to my portable drive temporarily until the old drives are added to the pool. I'll let you know how I get on.

Thanks for the help
 
Joined
Oct 22, 2019
Messages
3,641
I do have a spare 4tb portable drive so I'll move what I can over to the new array and then the rest can be moved to my portable drive temporarily until the old drives are added to the pool.
Have you met Murphy?

He told me that he really hopes you have at least one backup of everything before undertaking the above migration.
 
Top