public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@gmail.com>
To: "Dipl.-Ing. Michael Niederle" <mniederle@gmx.at>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: How to mount a subvolume?
Date: Sat, 9 Jan 2010 21:07:37 +0100	[thread overview]
Message-ID: <201001092107.38133.kreijack@libero.it> (raw)
In-Reply-To: <20100109150757.1051fd79@simplux>

On Saturday 09 January 2010, Dipl.-Ing. Michael Niederle wrote:
> First thanks alot to Kay and Goffredo!
> 
> But I have another question.
> 
> I read that the current tools cannot display subvolumes, but one should 
still
> be able to mount them. If I try I get an error message:
> 
> > mount -t btrfs -o subvol=root.2010-01-07 /dev/sda3 /save
> mount: /dev/sda3 is not a valid block device
> 
> root.2010-01-07 is a snapshot of the /root-directory
> 
> /save is an empty directory used for mounting backups
> 
> taken (successfully) with the following command:
> 
> > btrfsctl -s root.2010-01-07 /root
> 
> What am I doing wrong? Isn't it possible to mount the whole filesystem and a
> subvolume at the same time?

It is possible. I do that on my machine. The magic part is that the 
subvolume/snapshot (are the same thing) has to be under the / of the 
filesystem.

  ghigo@arakne:/tmp$ mkdir test 
  ghigo@arakne:/tmp$ mkdir test-snap
  ghigo@arakne:/tmp$ sudo mount -o /dev/sdc test
  ghigo@arakne:/tmp$ mount | grep btrfs                  
  /dev/sdc on /tmp/test type btrfs (rw)
  ghigo@arakne:/tmp$ cd test                    
  ghigo@arakne:/tmp/test$ sudo mkdir a
  ghigo@arakne:/tmp/test$ sudo btrfsctl -s a/snap-on-subdir .
  operation complete
  Btrfs Btrfs v0.19
  ghigo@arakne:/tmp/test$ sudo btrfsctl -s snap-of-root .
  operation complete
  Btrfs Btrfs v0.19
  ghigo@arakne:/tmp/test$ cd ..
  ghigo@arakne:/tmp$ sudo mount -o subvol=snap-on-subdir  /dev/sdc test-snap/
  mount: /dev/sdc is not a valid block device
  ghigo@arakne:/tmp$ sudo mount -o subvol=snap-of-root  /dev/sdc test-snap/
  ghigo@arakne:/tmp$ mount | grep btrfs
  /dev/sdc on /tmp/test type btrfs (rw)
  /dev/sdc on /tmp/test-snap type btrfs (rw,subvol=snap-of-root)

Note:
- both the root of the btrfs filesystem and its snapshot are mounted at the 
same time
- if a subvolume/snapshot not placed in the root is mounted an error is 
returned (/dev/sdX is not a valid block device)

> Greetings, Michael

Goffredo
> --
> 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) <kreijackATinwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512

      parent reply	other threads:[~2010-01-09 20:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09 14:07 How to mount a subvolume? Dipl.-Ing. Michael Niederle
2010-01-09 14:30 ` Dirk Heinrichs
2010-01-09 15:09   ` Dipl.-Ing. Michael Niederle
2010-01-09 15:41 ` Tomasz Torcz
2010-01-09 20:07 ` Goffredo Baroncelli [this message]

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=201001092107.38133.kreijack@libero.it \
    --to=kreijack@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mniederle@gmx.at \
    /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