Proper way to move files into a new dataset?

Status
Not open for further replies.

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
I need to move several TB of data to a new dataset.

When I use the mv command, it appears that it never deletes the source files (though I can't see them, so where the heck "are they"?)

What is the proper way to move files to a new dataset?

As it stands now, if I move the files it will write the new files to the dataset, and it APPEARS they have been deleted from the source, but I lose that amount of data to the ether.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
I would think mv is the way to go.

I can speculate why the space is not free on the source dataset, but it really depends on your system. Do you have any snapshots of that source dataset? If yes, the space will not be free until the snapshot(s) is deleted. This is the first thing to come to mind.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Why not zfs send | recv?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
When I use the mv command, it appears that it never deletes the source files (though I can't see them, so where the heck "are they"?)
It most certainly does--what makes it appear otherwise? But I concur with @Ericloewe--this is what replication was made for.
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
This is a continuation of his other thread - https://forums.freenas.org/index.php?threads/mv-command-filling-drive.64335/#post-461099

@oguruma please list detailed hardware information, per the forum rules. From your other thread, it appears that you have a single 8TB drive for data.

It's a Xeon 1225 with 16GB of RAM on an X9SCM. The pool in question is a single 8TB HDD.

With respect to the snapshots, I might have a couple GB of space used there, but I am at a loss of hundreds of GB of data... Unless my understanding of how the snapshots work is off (good chance of this).
 

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
It most certainly does--what makes it appear otherwise? But I concur with @Ericloewe--this is what replication was made for.

I have a single 8TB HDD for this pool with about 5TB of data. I wanted to move (all of) the data into datasets, so I used mv /mediavol/* /mediavol/mediadataset/

The mv command filled the volume, and yet the source files were not visible by me. It certainly appeared that the mv command was deleting the files, in the sense that I could not longer see the files on the source (but I could on the destination) however my drive filled up and yet I added no new net files.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Unless my understanding of how the snapshots work is off
Almost certainly it is. If you have a snapshot of the data in question, deleting the files won't free the space used until all snapshots covering that data expire or are destroyed. It's pretty clear this is what's going on here.
 
Status
Not open for further replies.
Top