Best method for moving data to a new drive?

garrei

Dabbler
Joined
Jun 7, 2019
Messages
10
Hi, so I'm very new to freenas, I decided to play around with an old PC I had and make it a Home NAS PC. Got Freenas installed and I setup a Plex on it with a 120GB SSD boot drive and a (VERY old) 1.5TB WD Desktop HDD. The 1.5TB drive is almost full up and I'm concerned because of its age it might fail soon, is currently perfectly healthy though!

Anyways I have bought an 8tb Ironwolf to move all the data to but not sure exactly what the best way to do it is. There are no RAIDs setup yet (not really anything important so it's not the end of the world if data gets lost). Just got 1 pool setup for media and thats it.

So yeah, what's the best method for me moving this data across so I dont need the 1.5TB anymore. (Also would like to keep all the plex settings and metadata if thats at risk of being lost in the process).

Thanks.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Your best bet, is to use ZFS (the file system) to create a mirror of the existing drive on the new drive. Then you can remove the old drive and replace it with a second 8TB drive so your data is mirrored on two dives instead of relying on just one drive. Here is a link to a thread that discusses taking a single drive pool and making it into a mirror. Please read it before taking action to reduce the risk to your data:

ZFS: Adding a drive to create a mirror
https://www.ixsystems.com/community/threads/create-zfs-mirror-by-adding-a-drive.14880/post-81348

You should also take some time to read the documents here as it will help familiarize you with FreeNAS and ZFS"

https://www.ixsystems.com/community/resources/links-to-useful-threads.108/
 

garrei

Dabbler
Joined
Jun 7, 2019
Messages
10
Hey Thanks for the info but I was mainly looking for a procedure for just moving the data from the 1.5tb to the 8tb for now. I came across a command to use in the shell 'zfs send -R Media@migrate | zfs receive -F new-Media' didn't realise that adding PV in the middle there would have been nice to see the progress of the migration. It's still migrating though, I can tell because when I refresh my dashboard the free space on my 8TB is going down. Hasnt finished yet and looks like its taken about 2 hours to do about 800gb so far.

So for others sake (and please confirm I am right in doing this seeing as my attempt is still in progress)

  1. Disable/stop plugins and services that access the old drive
  2. Create a new pool on the new drive, I called mine new-Media
  3. Go to run the command line 'zfs send -R <NAME OF OLD POOL>@migrate | pv | zfs receive -F <NAME OF NEW POOL>'
  4. Once complete, remove old drive from the box or format it once confirmed all data has successfully been transferred
  5. Rename new pool to old pools name
  6. Restart plugins and services
This sound about right?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
This sound about right?
It will work, but for a single drive pool like yours, it is massively more complicated than you need. Adding a mirror was really the easy way.
 

garrei

Dabbler
Joined
Jun 7, 2019
Messages
10
Alrighty, thanks for your help :) I usually end up doing things the hard way aha... and I really should know this stuff considering I do a lot of this sort of stuff at work, just never with freenas or FreeBSD :P
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
So for others sake (and please confirm I am right in doing this seeing as my attempt is still in progress)

  1. Disable/stop plugins and services that access the old drive
  2. Create a new pool on the new drive, I called mine new-Media
  3. Go to run the command line 'zfs send -R <NAME OF OLD POOL>@migrate | pv | zfs receive -F <NAME OF NEW POOL>'
  4. Once complete, remove old drive from the box or format it once confirmed all data has successfully been transferred
  5. Rename new pool to old pools name
  6. Restart plugins and services
This sound about right?
I have done this sort of thing with big ZFS pools. I don't recall exactly, but I think there might be some missing details here. I migrated a pool from 64 x 4TB drives onto 60 x 6TB drives using this method and later moved that pool from the 60 x 6TB drives onto 60 x 10TB drives.

I have given this sort of advice many times on the forum:
https://www.ixsystems.com/community/threads/assistance-failing-drives.73898/post-518692
and
https://www.ixsystems.com/community...nd-snapshots-to-another-box.73322/post-508081
and
other places.
I usually end up doing things the hard way aha...
Send and Receive is really very powerful. I have used it many times. In your situation, it was like driving a thumbtack with a sledge hammer.
Let us know if you have any questions.
 

garrei

Dabbler
Joined
Jun 7, 2019
Messages
10
new problem, now when I try to rename the new pool to what the old pool was using 'zfs rename new-Media Media' I get the response 'cannot create 'Media': missing dataset name' Any ideas?
 

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
new problem, now when I try to rename the new pool to what the old pool was using 'zfs rename new-Media Media' I get the response 'cannot create 'Media': missing dataset name' Any ideas?

You're getting this error because 'zfs rename' is used for datasets and snapshots, not pools.

I think you can rename a pool with (assuming that Media is not an existing pool name):

zpool export new-Media zpool import new-Media Media

Note that this is untested and I'm not sure if it can be done from the FreeNAS GUI or not. If it can be done from the GUI, that's the proper way for FreeNAS.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I think you can rename a pool with (assuming that Media is not an existing pool name):
Correct. And no, you can't do it in the GUI.
Your best bet, is to use ZFS (the file system) to create a mirror of the existing drive on the new drive.
It's a real shame that, despite a feature request being outstanding for at least six years, this trivially-simple-to-implement feature still hasn't been added to the GUI.
 

garrei

Dabbler
Joined
Jun 7, 2019
Messages
10
I think you can rename a pool with (assuming that Media is not an existing pool name):

zpool export new-Media zpool import new-Media Media
Unfortunately it says the device is busy, I've stopped all services and shares... not budging :/
It's a real shame that, despite a feature request being outstanding for at least six years, this trivially-simple-to-implement feature still hasn't been added to the GUI.
Boy wouldn't that just be too convenient aha.
 

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
Unfortunately it says the device is busy, I've stopped all services and shares... not budging :/

You don't have a shell open where the current working directory is within one of your datasets do you?

You could try running 'lsof' and look for processes that are using files or directories in the new-Media pool. Maybe something like:

lsof | grep Media

I think FreeNAS includes lsof, but I don't have a machine to verify.
 
Top