Understanding the usage of snapshots for copying data between volumes

Status
Not open for further replies.

clamschlauder

Dabbler
Joined
Feb 23, 2013
Messages
26
X9DA3 with 2x E5520 Xeon
24GB RAM
FreeNAS-9.3-STABLE-201512121950
8x3TB - tank (RaidZ3)
4x3TB - Sharable (RaidZ2)


I recently upgraded to dual M1015 cards and migrated all of the hard drives off of the onboard raid controller. Previously the onboard controller was limiting the 3TB drives to 2.xxTB. The pools reloaded just fine but did not expand with the newly found storage with the m1015.

What I have done to this point:

1. Create a snapshot of the data sets from the old volume
2. zfs send / receive those snapshots to another volume on the machine.
3. reloaded the drives to now show 3 TB drives instead of the limited size.

My struggle begins with using the CORRECT method to transfer the data back as it was previously. The way my mind sees it there are a couple different ways that I can do this.

First is to do a rollback in the GUI under "Storage >> Snapshots". A concern i have is that using rollback it won't work like I expect it to and may mess things up. Example: My old volume name is different than my current one. Not sure how that process will react. It would be great if it prompted me where to rollback the data set to but I doubt that it will considering most times there is only 1 place to rollback to.

Second option is to move the snapshot back to the correct data set using zfs send / receive. I have already tried this with a smaller data set. I created a share from the newly transferred location and I can access everything like normal but I am concerned that FreeNAS still sees the data as a snapshot....???

Third I saw "zfs clone." This function seems exactly what I need but the examples on FreeBSD.org were not straight forward enough that I could replicate the example to my specific situation.

I have done some research on here and the oracle site but cant get a grasp on the specific usage for my case. A lot of what I read seems to pertain to other things you may want to do. Example for my second scenario would be I copy the data over as a snapshot and later on down the road something happens because I didn't copy the data by "reloading" rather than just transferring the snapshot. It seems pretty difficult to type how my mind is perceiving things so I hope I wrote something that makes sense.
 

clamschlauder

Dabbler
Joined
Feb 23, 2013
Messages
26
In some ways it did help me. I read that previously but it only goes over details related to rolling back to where the snapshot was generated from. That location does not exist anymore. In general, I would like to do a roll back but tell it what data set I want to roll back to.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Second option is to move the snapshot back to the correct data set using zfs send / receive. I have already tried this with a smaller data set. I created a share from the newly transferred location and I can access everything like normal but I am concerned that FreeNAS still sees the data as a snapshot....???

This is what you want to do. You shouldn't be concerned that FreeNAS sees a snapshot. That's what it sees anyway. You just want to make sure that the most recent (or all) snapshots are replicated. Otherwise you will be jumping back in time (data-wise) [ps - that's what a snapshot rollback is].
 

clamschlauder

Dabbler
Joined
Feb 23, 2013
Messages
26
It's not so much that I am concerned that FreeNAS sees a snapshot rather than how it reacts. I initially created a snapshot and did a zfs send/receive to another volume. I created a share for that data set as a test and I could indeed see the data like it was exactly on the other volume. I went to go move it back and it obviously chirped at me when I used the zfs snapshot command because IT IS a snapshot that I had just moved there. So it looks like I can just move the snapshot back to my new and final spot but I am not sure what the ramifications will be when leaving it as a snapshot.

I copied what you did below. What is the purpose of exporting and reimporting? To me it seems that the process is to make it so that FreeNAS no longer sees it as a snapshot and only sees it as data.

5. use GUI to export new-tank
6. use cli to rename to tank "zpool import new-tank tank")
7. use CLI to export tank: zpool export tank
8. use GUI to import volume 'tank'
9. change system dataset location to tank
10. restore config backup to re-enable snapshots, replication, etc
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
What is the purpose of exporting and reimporting?
exporting and importing at the CLI allows me to change the name. By doing it in the GUI, it allows me to work with it in the CLI and then when I import it into the GUI, all the dataset info gets populated into freenas.

To me it seems that the process is to make it so that FreeNAS no longer sees it as a snapshot and only sees it as data.
No. A snapshot is data. The most recent snapshot is the data that is being worked off of. So if you want to rollback to a snapshot, you lose all changes to that data made since the snapshot.
 

clamschlauder

Dabbler
Joined
Feb 23, 2013
Messages
26
OK. So it seems that by replicating the snapshot to the new location and working off of that data will have no ramifications down the road. That is good to know.

I think I understand this for the most part. Appreciate the help!
 
Status
Not open for further replies.
Top