linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Arne Jansen <sensille@gmx.net>
Cc: C Anthony Risinger <anthony@xtfx.me>,
	Matthew Hawn <steamraven@yahoo.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Moving top level to a subvolume
Date: Wed, 13 Jun 2012 18:20:11 +0200	[thread overview]
Message-ID: <4FD8BDBB.8080709@libero.it> (raw)
In-Reply-To: <4FD83F75.5000600@gmx.net>

On 06/13/2012 09:21 AM, Arne Jansen wrote:
> On 13.06.2012 09:04, C Anthony Risinger wrote:
>> On Fri, Jun 8, 2012 at 2:40 PM, Arne Jansen <sensille@gmx.net> wrote:
>>> On 06/08/2012 09:24 PM, Matthew Hawn wrote:
>>>> I just converted my root filesystem to btrfs with btrfs-convert.  However, since I am running Ubuntu, I would like to have the same subvolume structure as a default install,. How do I move the top-level subvolume (where all my files currently are) to another subvolume?
>>>
>>> Just snapshot the root subvol and continue working in the snapshot.
>>
>> ... yeah but that solution totally sucks when you:
>>
>> a) have a lot of data
>> b) need to do this via script
>> c) ???
>>
>> ... because in a), data will *copied* the slow way, and in b) you
>> leave a bunch of junk laying around in the old root that will rot
>> unless you `rm -rf` it ... and idk about you, but issuing what is very
>> near to that command on someone else's machine -- via script -- makes
>> me REALLY uneasy ;-)
> 
> well, don't put data in the top level in the first place. Yes, you have
> to remove the content of the subvol / by rm -rf, but I don't really see
> the problem with it.

It is slow. You have to change a lot of metadata (each shared metadata
block have to be unshared, and then one copy will be deleted ).

> What I don't understand is why you think data will be copied.
> 
>>
>> i have asked this exact question at least 4 times specifically, and
>> referenced it probably 8-10, in the last 3 years or more.  i needed it
>> then.  i still need it now.  but since i never got an answer up/down
>> or around, i gave up and told people to `rm -rf`themselves ...
>>
>> http://markmail.org/message/7hj5ioqrztkeerqv
>>
>> ... that's from May of 2010, but i don't think it's the first.
>>
>> so, would it possible to implement this, or could someone kindly (and
>> briefly!) explain why it cannot be done?
> 
> The default subvol ('/') has the special number 5 and is expected to
> always be around. All other subvols get numbers starting with 256.
> Creating a new 5 and internally renumbering the old 5 isn't easy, because
> each tree block has an owner recorded in it. Also, all backreferences
> have the root number in them. If you have to touch each tree block, you
> can as well choose the snapshot/rm -rf approach.

I don't know very well the internal of btrfs. Do you think that It is
possible to move/swap the root subvolume ?

> 
>>
[...]

> Or you could hack mkfs.btrfs to always create an additional subvol.

Which can be the default one: so nobody should complain. I



> Even making / readonly except for creating mountpoint could be possible.
> Just some random ideas...
> 
> -Arne
> 
>>
> 
> --
> 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
> .
> 


  parent reply	other threads:[~2012-06-13 16:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 19:24 Moving top level to a subvolume Matthew Hawn
2012-06-08 19:40 ` Arne Jansen
2012-06-13  7:04   ` C Anthony Risinger
2012-06-13  7:21     ` Arne Jansen
2012-06-13  9:44       ` C Anthony Risinger
2012-06-13  9:57         ` Fajar A. Nugraha
2012-06-13 16:20       ` Goffredo Baroncelli [this message]
2012-06-12  1:53 ` Duncan
2012-06-12 14:52   ` Randy Barlow
2012-06-12 15:12     ` Michael
2012-06-13  1:49     ` Fajar A. Nugraha
2012-06-13  7:23       ` Duncan
2012-06-13  9:08         ` Fajar A. Nugraha
2012-06-13 17:17           ` Duncan

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=4FD8BDBB.8080709@libero.it \
    --to=kreijack@libero.it \
    --cc=anthony@xtfx.me \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sensille@gmx.net \
    --cc=steamraven@yahoo.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).