public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* How to mount a subvolume?
@ 2010-01-09 14:07 Dipl.-Ing. Michael Niederle
  2010-01-09 14:30 ` Dirk Heinrichs
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dipl.-Ing. Michael Niederle @ 2010-01-09 14:07 UTC (permalink / raw)
  To: linux-btrfs

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?

Greetings, Michael

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

* Re: How to mount a subvolume?
  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
  2 siblings, 1 reply; 5+ messages in thread
From: Dirk Heinrichs @ 2010-01-09 14:30 UTC (permalink / raw)
  To: linux-btrfs

On Saturday 09 January 2010 14:07:57 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

Does /dev/sda3 actually exist?

Is this a USB device which may have changed its name (now sdb3, or even sdc3) 
after plugging it out and back in again?

Bye...

	Dirk

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

* Re: How to mount a subvolume?
  2010-01-09 14:30 ` Dirk Heinrichs
@ 2010-01-09 15:09   ` Dipl.-Ing. Michael Niederle
  0 siblings, 0 replies; 5+ messages in thread
From: Dipl.-Ing. Michael Niederle @ 2010-01-09 15:09 UTC (permalink / raw)
  To: Dirk Heinrichs, linux-btrfs

Hi, Dirk!

> Does /dev/sda3 actually exist?

/dev/sda3 does exist; it is an btrfs formatted partition containing my root
file system:

> mount
...
/dev/sda3 on / type btrfs (rw,relatime,noacl)
...

Greetings, Michael

@Johannes: I will recreate the /dev/brtfs-control device node in the startup
scripts using the information from /sys/class/misc/btrfs-control/dev - thanks!

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

* Re: How to mount a subvolume?
  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:41 ` Tomasz Torcz
  2010-01-09 20:07 ` Goffredo Baroncelli
  2 siblings, 0 replies; 5+ messages in thread
From: Tomasz Torcz @ 2010-01-09 15:41 UTC (permalink / raw)
  To: linux-btrfs

On Sat, Jan 09, 2010 at 03:07:57PM +0100, Dipl.-Ing. Michael Niederle wrote:
> 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
> taken (successfully) with the following command:
> > btrfsctl -s root.2010-01-07 /root
 
  Snapshots aren't subvolumes. You create mountable subvolumes with
btrfsctl -S

-- 
Tomasz Torcz               RIP is irrevelant. Spoofing is futile.
xmpp: zdzichubg@chrome.pl     Your routes will be aggreggated. -- Alex Yuriev


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

* Re: How to mount a subvolume?
  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:41 ` Tomasz Torcz
@ 2010-01-09 20:07 ` Goffredo Baroncelli
  2 siblings, 0 replies; 5+ messages in thread
From: Goffredo Baroncelli @ 2010-01-09 20:07 UTC (permalink / raw)
  To: Dipl.-Ing. Michael Niederle; +Cc: linux-btrfs

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

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

end of thread, other threads:[~2010-01-09 20:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox