Importing data from NTFS RAID 1 into ZFS RAIDZ

Status
Not open for further replies.

zacharyphill

Cadet
Joined
Apr 19, 2018
Messages
4
Hey folks,

I'm building my first FreeNAS machine today. I'm confident the hardware is more than sufficient but I'm not sure what to do with my drives. I have two 6 TB drives, currently installed to my PC in an NTFS RAID 1 with lots of data written to them which I'd loathe losing. I also have two blank 8 TB HDDs. I intend for all four disks to eventually be configured as an 18 TB ZFS RAIDZ array, but I'm not sure how to import the NTFS data while creating the pool.

Is this possible? What is the best way to go about doing this? I'm excited to build my first NAS box and explore the possibilities of FreeNAS, but also concerned about losing "old" data.

Thanks in advance for your replies,
Zach
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is this possible?
Possible*, but tricky and potentially hazardous to your data. It would also require a bit of work at the CLI; you wouldn't be able to create the pool using the GUI. Vdev expansion is coming to ZFS, but you won't see it in FreeNAS for at least a year (and I'd plan on two).

* Edit: Well, I should probably explain, at least generally, how you'd do this. There are two basic methods you could use. The first is to create a degraded pool. In general, it would look like this:
  • Create a 6 TB sparse file on your boot device ( dd if=/dev/zero of=/root/sparsefile bs=1m count=6m)
  • Break your RAID1 mirror and put one of the 6 TB disks into your FreeNAS box along with the two 8 TB disks
  • Manually partition each of the three disks in your box with a 2 GB swap partition as the first partition, and the remainder as freebsd-zfs
  • Use glabel status to get the gptids of the second partiton of each disk
  • zpool create tank raidz1 /root/sparsefile gptid/blah1 gptid/blah2 gptid/blah3
  • zpool offline tank /root/sparsefile. Note that this will remove any redundancy from your pool--you'll effectively have a three-disk RAID0. It will, however, have the same capacity as your final pool.
  • Use the GUI to import your data (the "Import Disk" feature)
  • Once the data's imported, use the "Replace Disk" feature in the GUI to replace /root/sparsefile in the pool with the remaining 6 TB disk. Once you start this, the copy of your data on what used to be the NTFS disk will be destroyed, and until the resilvering operation completes, you'll have no redundancy. A disk failure during that window of time will result in the loss of all your data.
The other option is to create a pool using partitions (hat tip to @Stux for this method):
  • Using the CLI, partition each of the 8 TB disks into two partitions of 4 TB each.
  • zpool create tank raidz1 da1p1 da1p2 da2p1 da2p1 (substituting the appropriate disk designations, of course).
  • Connect one of the 6 TB disks and use the Import Disk feature to copy the data onto your pool.
  • Connect the other 6 TB disk and use the Replace Disk feature, repeatedly, to replace partitions with disks. Replace the first partition on the first 8 TB disk with the first 6 TB disk, the second partition on that 8 TB disks with the second disk, the first partition on the second 8 TB disk with the first 8 TB disk, and the second partition on the second 8 TB disk with the second 8 TB disk. This last step will require taking that partition offline first, which (as in the previous case) means you won't have any redundancy until the process is complete.
It's worth pointing out that we don't generally recommend RAIDZ1 when using disks larger than about 1 TB. A much simpler process, which doesn't require any CLI-fu and gives you more redundancy (though correspondingly less capacity), would be this:
  • Using the GUI, create a mirrored pool with the two 8 TB disks
  • Use the Import Disk feature in the GUI to import the data from the 6 TB disk
  • Using the Volume Manager, extend your pool using the pair of 6 TB disks as a second mirror
  • This gives you a pool of striped mirrors with 14 TB of capacity.
 
Last edited:

zacharyphill

Cadet
Joined
Apr 19, 2018
Messages
4
Wow, thank you so much for all this info!
It's worth pointing out that we don't generally recommend RAIDZ1 when using disks larger than about 1 TB.

Yeah, I'm new to ZFS so I'm just now learning why RAIDZ1 is not recommended for large disks. There is a high chance of an unrecoverable write failure, right? The same problems would also be present in RAID5, correct?

The third option you've laid out is RAID10, right? That option is looking better, not for avoiding the "CLI-fu," but for avoiding any potential issues with RAIDZ1 or RAID5 and large HDDs. 14 TB will likely satisfy my needs for the next couple of years. I'll start there and reconfigure later down the line if needed.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The same problems would also be present in RAID5, correct?
Correct--there was a bit of press about 10 years ago about "RAID 5 is dead". The risk with RAIDZ is actually less than with traditional RAID5, but it's still there.
The third option you've laid out is RAID10, right?
Correct.
 

zacharyphill

Cadet
Joined
Apr 19, 2018
Messages
4
I've got the hardware assembled, FreeNAS installed, and the two 8 TB disks configured in a mirror I can successfully access over my network. It's a Generic Unix (NFS) volume for compatibility for both my Windows system and my wife's Macbook. Now I'm trying to import one of the 6 TB drives, but I'm met with this error:
Import of Volume /dev/ada2p2 Failed.

Reason: Mount failed 12 -> b'', b"NTFS signature is missing.\nFailed to mount '/dev/ada2p2': Invalid argument\nThe device '/dev/ada2p2' doesn't seem to have a valid NTFS.\nMaybe the wrong device is used? Or the whole disk instead of a\npartition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?\n"

It seems there are alternative methods to accomplish this using the CLI, but since this is my first foray into Unix, I'm not sure how to do that in my specific situation. I'll keep searching the web for an answer tomorrow. If anyone has some insight they don't mind providing, I'd appreciate it.

It also may be worth mentioning these 6 TB drives were configured as mirrors using Windows Storage Spaces on Windows 10 Pro. I can't think of any other reason the drive wouldn't "have a valid NTFS."

-Zach
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
You won’t be able to “import” the disk. You need to copy over the data to the mirror from the machine they are in.

NFS is not as good as SMB in a Windows/macOS mix
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338

zacharyphill

Cadet
Joined
Apr 19, 2018
Messages
4
You need to copy over the data to the mirror from the machine they are in.

NFS is not as good as SMB in a Windows/macOS mix

...oh, duh. Sometimes an obvious solution can stare you in the face. Yep, I'm copying files over the network now. I also changed the volume to SMB.
Only single NTFS disks can be imported as is written in the manual.

I was hoping a single disk from the mirror would work, but I wasn't so lucky. I've got my workaround now.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
It would appear that you don't have a backup of your data. RaidZ is not an alternative to maintaining a good backup strategy. I would back up the old data, create your new ZFS volumes, then restore the data from backup.

At the end of the day, you will have a new FreeNAS system and a backup.
 
Status
Not open for further replies.
Top