From: Goffredo Baroncelli <kreijack@inwind.it>
To: BJ Quinn <bj@placs.net>, linux-btrfs@vger.kernel.org
Subject: Re: Cloning a Btrfs partition
Date: Tue, 13 Dec 2011 23:06:26 +0100 [thread overview]
Message-ID: <1534685.yyhN3sYL3e@venice> (raw)
In-Reply-To: <dc6ccf7d-261b-487c-966f-a7bcdd0439cc@mail.placs.net>
On Monday, 12 December, 2011 15:41:29 you wrote:
> >You can't change the uuid of an existing btrfs partition. Well, you
> >can, but you have to rewrite all the metadata blocks.
>
> Is there a tool that would allow me to rewrite all the metadata blocks with
> a new UUID? At this point, it can't possibly take longer than the way I'm
> trying to do it now...
>
> Someone once said "Resetting the UUID on btrfs isn't a quick-and-easy thing
> - you have to walk the entire tree and change every object. We've got a
> bad-hack in meego that uses btrfs-debug-tree and changes the UUID while it
> runs the entire tree, but it's ugly as hell."
I am looking for that. btrfs-debug-tree is capable to dump every leaf and
every node logical address.
To change the UUID of a btrfs filesystem
On every leaf/node we should
- update the FSID (a)
- update the chunk_uuid [*]
- update the checksum
for the "dev_item" items we should update the
- device UUID (b)
- FSID (see 'a')
for the "chunk_item" items we should update the
- device UUID of every stripe (b)
for every superblock (three for device), we should update:
- FSID (see 'a')
- device uuid (see 'b')
- for every "system chunk" items contained in the superblock we should update:
- device UUID of every stripe (b)
- update the checksum
The most complex part is to map the logical address to the physical device.
In the next days I will tray (if I had enough time) to make something...
>
> Ok, I'll take the bad-hack. How would I actually go about using said
> bad-hack?
>
> -BJ
> --
> 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
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
next prev parent reply other threads:[~2011-12-13 22:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bb747e0c-d6d8-4f60-a3f6-cf64c856515e@mail.placs.net>
2011-12-07 18:35 ` Cloning a Btrfs partition BJ Quinn
2011-12-07 18:39 ` Freddie Cash
2011-12-07 18:49 ` BJ Quinn
2011-12-08 15:49 ` Phillip Susi
2011-12-08 16:07 ` BJ Quinn
2011-12-08 16:09 ` Jan Schmidt
2011-12-08 16:28 ` BJ Quinn
2011-12-08 16:41 ` Jan Schmidt
2011-12-08 19:56 ` BJ Quinn
2011-12-08 20:05 ` Chris Mason
2011-12-08 20:38 ` BJ Quinn
2011-12-12 21:41 ` BJ Quinn
2011-12-13 22:06 ` Goffredo Baroncelli [this message]
2011-12-30 0:25 ` BJ Quinn
2012-01-12 0:52 ` BJ Quinn
2012-01-12 6:41 ` Chris Samuel
2011-12-08 16:27 ` Stephane CHAZELAS
2011-12-08 10:00 ` Stephane CHAZELAS
2011-12-08 19:22 ` Goffredo Baroncelli
2013-07-29 8:21 Fwd: " Jan Schmidt
2013-07-29 15:32 ` BJ Quinn
2013-07-30 10:28 ` Jan Schmidt
2013-08-19 20:45 ` BJ Quinn
2013-08-20 9:59 ` Xavier Bassery
2013-08-20 15:43 ` BJ Quinn
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=1534685.yyhN3sYL3e@venice \
--to=kreijack@inwind.it \
--cc=bj@placs.net \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.