Moving a large data set and managing disk space

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Hi,

I have a large directory (350Gb or so). It lived in a pool, /foo, and then I moved it by accident to a directory that was in a different pool, /bar, using the standard mv shell command.

Then I moved it back. It’s not done yet. But my FreeNAS is rapidly running out of space. I expect this is because it isn’t flushing the old files as it goes until it’s moved everything.

I think maybe this is because it’s keeping the data on /bar (which from memory has a more defensive snapshot policy than /foo).

How can I safely move the data back to the right place without filling up my disk?

And if it fails half way through, how can I best complete the transfer? The data is deeply nested and in thousands of files.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I expect this is because it isn’t flushing the old files as it goes until it’s moved everything
You're right.

How can I safely move the data back to the right place without filling up my disk?
Kill all the snaps (probably on both sides), at least on the target for now that are between the mistake and your return move operation.
zfs destroy foo@oldest_snap%newest_snap (where oldest and newest are indicating the first and last (from a time perspective) snap that you want to remove


And if it fails half way through, how can I best complete the transfer? The data is deeply nested and in thousands of files.
rsync -auv /bar /foo
rm -R /bar (after you checked you have everything)
 
Top