From: Goffredo Baroncelli <krexxjack@libero.it>
To: Liu Bo <liubo2009@cn.fujitsu.com>
Cc: "Matthias G. Eckermann" <mge@suse.com>, Alex <alex@bpmit.com>,
linux-btrfs@vger.kernel.org
Subject: Re: Create subvolume from a directory?
Date: Wed, 28 Mar 2012 18:54:40 +0200 [thread overview]
Message-ID: <4F734250.5030009@libero.it> (raw)
In-Reply-To: <4F727504.3070105@cn.fujitsu.com>
Hello Liu
On 03/28/2012 04:18 AM, Liu Bo wrote:
> On 03/28/2012 06:24 AM, Matthias G. Eckermann wrote:
>> # time cp -a --reflink /var/lib/lxc/installserver_tmp/rootfs /var/lib/lxc/installserver
>>
>
> This is too much weird.
>
> AFAIK, clone between different subvolumes should be forbidden.
> So this would get a "Invalid cross-device link", because an individual subvolume can be mounted directly.
Could you elaborate which would be the issue ?
"cp --reflink"-ing a file is not different than snapshotting a file. In
any case I could mount a snapshot and not the source subvolume.
>
> thanks,
> liubo
>
>> real 0m1.367s
>> user 0m0.148s
>> sys 0m1.108s
>>
>> ## Now remove /var/lib/lxc/installserver_tmp (or not)
>>
>> ------------------------------< snap>------------------------------
>>
>> Just to compare this with a "mv":
>>
>> ------------------------------< snip>------------------------------
>>
>> ## Go back to former state
>>
>> # btrfs subvol delete /var/lib/lxc/installserver
>> Delete subvolume '/var/lib/lxc/installserver'
>>
>> # btrfs subvol create /var/lib/lxc/installserver
>> Create subvolume '/var/lib/lxc/installserver'
>>
>> # time mv /var/lib/lxc/installserver_tmp/rootfs /var/lib/lxc/installserver/
>>
>> real 0m12.917s
>> user 0m0.208s
>> sys 0m2.508s
>>
>> ------------------------------< snap>------------------------------
>>
>> While the time measurement might be flawed due to the subvol
>> actions inbetween, caching etc.: I tried several times, and
>> "cp --reflinks" always is multiple times faster than "mv" in
>> my environment.
>>
>> Or did I misunderstand your question?
>>
>> so long -
>> MgE
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> .
>
next prev parent reply other threads:[~2012-03-28 16:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 17:19 Create subvolume from a directory? Alex
2012-03-27 20:42 ` Chester
2012-03-27 22:24 ` Matthias G. Eckermann
2012-03-28 1:46 ` Fajar A. Nugraha
2012-03-28 9:20 ` David Sterba
2012-03-28 2:18 ` Liu Bo
2012-03-28 16:54 ` Goffredo Baroncelli [this message]
2012-03-29 1:24 ` Liu Bo
2012-05-01 17:09 ` Hubert Kario
2012-05-02 16:33 ` David Sterba
2012-05-03 13:26 ` Hubert Kario
2012-05-14 12:36 ` David Sterba
2012-03-28 9:24 ` David Sterba
2012-03-28 11:11 ` Alex
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F734250.5030009@libero.it \
--to=krexxjack@libero.it \
--cc=alex@bpmit.com \
--cc=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=liubo2009@cn.fujitsu.com \
--cc=mge@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).