xfs
[Top] [All Lists]

How to copy files with preserving reflinks ?

To: xfs@xxxxxxxxxxx
Subject: How to copy files with preserving reflinks ?
From: Prasanna Kumar Kalever <pkalever@xxxxxxxxxx>
Date: Fri, 26 Feb 2016 01:37:57 -0500 (EST)
Cc: Brian Foster <bfoster@xxxxxxxxxx>, Dave Chinner <dchinner@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1112951359.53758727.1456466113255.JavaMail.zimbra@xxxxxxxxxx>
Thread-index: 5ens2e3ynh2AwTpa+0zLCF2xrhtXAQ==
Thread-topic: How to copy files with preserving reflinks ?
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 â 


<Prev in Thread] Current Thread [Next in Thread>