Move data elegantly within zpool without big reduction in space

Status
Not open for further replies.

saikee

Explorer
Joined
Feb 7, 2017
Messages
77
Mobo = Asus Sabertooth Z77 mobo
CPU = i7-3770K
Ram = 32GB non ECC
zpool = mirror RAIDZ 2x3x8TB

I am learning the zfs the hard way of moving 14TB from a non-Dataset folder to a Dataset folder within the same zpool. Currently I am moving two folders, of different sizes, about the same total size as the 6.6TB free space available. My intention was to have smaller folder completed first so that its space could be free up. I started the file moving operation when the pool was 68% filled and am not adding anything new.

The GUI is flagging up a warning that the pool capacity has passed 85% in the middle of the file moving operation.
upload_2017-7-20_11-13-37.png

The funny thing of zpool is my disk space is depleting while the used area is unchanged as I am simply moving data within the same pool.

I know how to cure it and that is to move a small block of files one at a time. This is to do it subdirectory by subdirectory.

Is there a more elegant way to move a large block data within the zpool without causing the above reduction in space? May be I have to live with it due to it copy-on-write feature.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I know how to cure it and that is to move a small block of files one at a time.
No, the way to cure it is to delete your snapshots.
 

saikee

Explorer
Joined
Feb 7, 2017
Messages
77
Previously I relied on a snapshot to recover the data. Now I have found to protect my data permanently is to put them on a Dataset as it was created by CLI using the normal mkdir. I did this by mounting the shared folders with a remote PC. To my surprise the data was moved in a split second by drag and drop. Apparently the moved data to the Dataset folder wasn't permanent.

The little white gap in my diagram represents a reboot after which I found my data disappeared again. I got them back by cloning from my most recent snapshot.

I can delete this last snapshot if that is the way. Kind of nervous about it that is all. I have already deleted all the other snapshots except the most recent one with which I recovered the directory system. Their deletions gave back a tiny space so far.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Moving data between directories within a dataset should be near-instantaneous, whether you do it at the CLI or through a networked client, as it's simply updating the directory pointers to that data. However, moving data between datasets involves making a new copy of that data and deleting the old, since each dataset is treated as its own filesystem. And since you're deleting the data from its old location, the space that was used by that data is now used by any snapshots that reference that data.
 

saikee

Explorer
Joined
Feb 7, 2017
Messages
77
Thanks for the explanation.

Think I got myself into a jam now as FreeNAS would not allow me to delete my remaining snapshot saying it is busy in my file moving operation.

Would the system crash if the space runs out? The pool has only 68% data but the space is used up for recording some data repeatedly due to a snapshot. Should I have deleted the snapshot prior to moving the files?
 
Status
Not open for further replies.
Top