linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mount snapshot by object-id
@ 2010-12-09 13:51 Michael Niederle
  2010-12-09 14:31 ` Calvin Walton
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Niederle @ 2010-12-09 13:51 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

Hi!

I'm currently writing a btrfs-rescue tool and therefor began to study the
btrfs-on-disk structures in detail.

The root tree contains a ROOT_ITEM entry for *every* subvolume in the whole
file system, but only DIR_ITEM entries for subvolumes that were created in the
root directory of the filesystem.

If we have a destroyed root directory, there is no way to access subvolumes
stored deeper in the fs-tree by name. It might be nice to have the ability to
mount a subvolume by object-id. A simple tool could list all available
subvolumes with their object-ids, generation numbers, and so on.

Greetings, Michael

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

* Re: mount snapshot by object-id
  2010-12-09 13:51 mount snapshot by object-id Michael Niederle
@ 2010-12-09 14:31 ` Calvin Walton
  2010-12-09 14:53   ` Dipl.-Ing. Michael Niederle
  0 siblings, 1 reply; 3+ messages in thread
From: Calvin Walton @ 2010-12-09 14:31 UTC (permalink / raw)
  To: Michael Niederle; +Cc: linux-btrfs@vger.kernel.org

On Thu, 2010-12-09 at 14:51 +0100, Michael Niederle wrote:
> Hi!
> 
> I'm currently writing a btrfs-rescue tool and therefor began to study the
> btrfs-on-disk structures in detail.
> 
> The root tree contains a ROOT_ITEM entry for *every* subvolume in the whole
> file system, but only DIR_ITEM entries for subvolumes that were created in the
> root directory of the filesystem.
> 
> If we have a destroyed root directory, there is no way to access subvolumes
> stored deeper in the fs-tree by name. It might be nice to have the ability to
> mount a subvolume by object-id. A simple tool could list all available
> subvolumes with their object-ids, generation numbers, and so on.

Unless I misunderstand something, this is actually already possible;
just poorly documented. You can use the 'subvolid=' mount option to
mount by object id; the object id can be found using the tool
btrfs subvolume list <filesystem>

The subvolid= mount option was missing from the wiki, so I've just added
it:
https://btrfs.wiki.kernel.org/index.php/Getting_started#Mount_Options

-- 
Calvin Walton <calvin.walton@gmail.com>


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

* Re: mount snapshot by object-id
  2010-12-09 14:31 ` Calvin Walton
@ 2010-12-09 14:53   ` Dipl.-Ing. Michael Niederle
  0 siblings, 0 replies; 3+ messages in thread
From: Dipl.-Ing. Michael Niederle @ 2010-12-09 14:53 UTC (permalink / raw)
  To: Calvin Walton, linux-btrfs@vger.kernel.org

Hi, Calvin!

Thanks a lot for this information and for updating the wiki!

The option works - on healthy disks ...

I will continue writing my rescue-tool. I also wrote a btrfs_subvolumes command
that displays all subvolumes of an unmounted filesystem. This helps a lot if
mounting the filesystem leads to a crash!

Greetings, Michael





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

end of thread, other threads:[~2010-12-09 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09 13:51 mount snapshot by object-id Michael Niederle
2010-12-09 14:31 ` Calvin Walton
2010-12-09 14:53   ` Dipl.-Ing. Michael Niederle

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).