public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* How to copy files with preserving reflinks ?
       [not found] <1112951359.53758727.1456466113255.JavaMail.zimbra@redhat.com>
@ 2016-02-26  6:37 ` Prasanna Kumar Kalever
  2016-02-26  7:31   ` Prasanna Kumar Kalever
  0 siblings, 1 reply; 2+ messages in thread
From: Prasanna Kumar Kalever @ 2016-02-26  6:37 UTC (permalink / raw)
  To: xfs; +Cc: Brian Foster, Dave Chinner

Hi,

I have a VM file with reflinks to it, the reflinks were taken every night.

My question is how to copy/migrate all these file to a different xfs partition (which also have reflink enabled) without loosing the reflinks property, else may lead to copy all the shared blocks per file which will cost large disk space.

I have tried to copy them using rsync as below:

On Partition 1:

ActualFile.img -- [1] Actaul Size 10GB + [2] Append 2GB + [3] Append 1GB
ReflinkCopy1   -- [1] Actual Size  0  -- Shared blocks 10GB
ReflinkCopy2   -- [2] Actual Size  0  -- Shared blocks 12GB


I have first rsync the files into Partition 2 as below:

# cd PARTITION2

# rsync /PARTITION1/ReflinkCopy1 ActualFile.img
# du -sh ActualFile.img
10GB
# cp --reflink=always ActualFile.img

# rsync /PARTITION1/ReflinkCopy2 ActualFile.img
# du -sh ActualFile.img
12GB
# cp --reflink=always ActualFile.img

# rsync  /PARTITION1/ActualFile.img ActualFile.img

But the size used by partition was 35GB (verified using df -h) instead of 13GB 



Also, where can I find reflink related tools ?


Thanks,
-Prasanna ​ 


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to copy files with preserving reflinks ?
  2016-02-26  6:37 ` How to copy files with preserving reflinks ? Prasanna Kumar Kalever
@ 2016-02-26  7:31   ` Prasanna Kumar Kalever
  0 siblings, 0 replies; 2+ messages in thread
From: Prasanna Kumar Kalever @ 2016-02-26  7:31 UTC (permalink / raw)
  To: xfs; +Cc: Brian Foster, Dave Chinner

On Friday, February 26, 2016 12:07:57 PM, Prasanna Kumar Kalever wrote:
> Hi,
> 
> I have a VM file with reflinks to it, the reflinks were taken every night.
> 
> My question is how to copy/migrate all these file to a different xfs
> partition (which also have reflink enabled) without loosing the reflinks
> property, else may lead to copy all the shared blocks per file which will
> cost large disk space.
> 
> I have tried to copy them using rsync as below:
> 
> On Partition 1:
> 
> ActualFile.img -- [1] Actaul Size 10GB + [2] Append 2GB + [3] Append 1GB
> ReflinkCopy1   -- [1] Actual Size  0  -- Shared blocks 10GB
> ReflinkCopy2   -- [2] Actual Size  0  -- Shared blocks 12GB
> 
> 
> I have first rsync the files into Partition 2 as below:
> 
> # cd PARTITION2
> 
> # rsync /PARTITION1/ReflinkCopy1 ActualFile.img
> # du -sh ActualFile.img
> 10GB
> # cp --reflink=always ActualFile.img
> 
> # rsync /PARTITION1/ReflinkCopy2 ActualFile.img
> # du -sh ActualFile.img
> 12GB
> # cp --reflink=always ActualFile.img
> 
> # rsync  /PARTITION1/ActualFile.img ActualFile.img
> 
> But the size used by partition was 35GB (verified using df -h) instead of
> 13GB

Hurreyyy!!!!.... err..
While experimenting with rsync found "--no-whole-file" && "--inplace" , with these options it seems to be working


#rsync --no-whole-file --inplace --human-readable --stats reflinks/file  ../mount2/reflinks/file 

Number of files: 1 (reg: 1)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 1
Total file size: 69.63M bytes
Total transferred file size: 69.63M bytes
Literal data: 8.20M bytes
Matched data: 61.43M bytes
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 8.23M
Total bytes received: 54.95K

But I still need to repeat the process of taking reflinks multiple times on new partition (per file).

Did not had luck to figure-out reflink related tools (du, ls ...)

-Prasanna

> 
> 
> 
> Also, where can I find reflink related tools ?
> 
> 
> Thanks,
> -Prasanna ​
> 
> 
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-26  7:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1112951359.53758727.1456466113255.JavaMail.zimbra@redhat.com>
2016-02-26  6:37 ` How to copy files with preserving reflinks ? Prasanna Kumar Kalever
2016-02-26  7:31   ` Prasanna Kumar Kalever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox