Will 'Create ZFS Dataset' delete data?

Status
Not open for further replies.

preginald

Cadet
Joined
Jun 19, 2012
Messages
1
Hey folks, I may have performed a royal rookie mistake and I have a couple of questions but first let me frame my situation.

Lets say for example I create a new zpool (on FreeNAS-8.0.4-RELEASE-p2-x86 (11367) / Platform Intel(R) Pentium(R) 4 CPU 2.80GHz) and labeled it 'bigboy' which creates a new folder in the filesystem as such '/mnt/bigboy'.

Now lets say I created a new folder labeled 'media' under the '/mnt/bigboy' folder which results in '/mnt/bigboy/media'.
Next I rsync about 1TB of files (from a desktop computer on the lan) into the '/mnt/bigboy/media/' folder.

Question 1.
If I use the FreeNAS gui to 'Create ZFS dataset' and labeled this new dataset 'media' which subsequently goes to create a folder under '/mnt/bigboy/' which results in '/mnt/bigboy/media/' will I lose the data that I originally rsynced into the '/mnt/bigboy/media/' folder I created?

The reason I ask this is because the content in the '/mnt/bigboy/media/' is now showing 112.0 KiB (0%) Used however the '/mnt/bigboy' shows 776.5 GiB (85%) used. I used ssh and listed the '/mnt/bigboy/media' directory and there are 0 files or directories recursively. Please refer to screenshot below.

freenas_view_all_volumes.jpg

Question 2.
Is there a way for me to undo and get back my data in the original /mnt/bigboy/media' folder?

Cheers, Pete
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
WOW. That's an interesting question. My first guess would be if you delete the media dataset your old data would suddenly be accessible again. I run FreeNAS in a virtual machine when I want to do experiments like this. I recreated your situation on my system and it appears that if you simply delete the "media" dataset you can access your old data again.

Of course, make sure that BEFORE you delete your "media" dataset you copy all the data you want from the dataset elsewhere.
 

Hexland

Contributor
Joined
Jan 17, 2012
Messages
110
You could export your dataset, and reimport it under a different name without deleting it?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Or unmount the dataset, check your files, rename your folder with the 1Tb data, recreate the media mountpoint, mount the dataset and move the transfered data to it's new home.
Code:
zfs unmount /mnt/bigboy/media

ls -al /mnt/bigboy/media

mv /mnt/bigboy/media /mnt/bigboy/temp

mkdir /mnt/bigboy/media

zfs mount bigboy/media

mv /mnt/bigboy/temp/*.* /mnt/bigboy/media


I think that last move command is right? It may take a while as a move to a different ZFS dataset is a copy, I believe.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Status
Not open for further replies.
Top