Thread (3 messages) 3 messages, 2 authors, 2012-02-19

Re: online snapshots of subvolumes?

From: Hugo Mills <hidden>
Date: 2012-02-19 13:09:52

On Sun, Feb 19, 2012 at 01:47:27PM +0100, andrew henry wrote:
Can I create a snapshot of a subvolume whilst that subvolume is mounted?
If so can you explain how?
   Yes.

# btrfs sub snap /subvolume/to/snapshot /path/to/snapshot/name

   The path for the snapshot can be under the subvolume it is a
snapshot of. So for example, I just ran on my machine:

# btrfs sub snap /media/video /media/video/video-snapshot
I read the sysadmin guide and it details one management setup where you
leave the initial fs empty, create a subvol, then mount that, and for
subsequent subvol operations you need to first unmount the subvol and
remount the original empty fs.
   You don't need to unmount the subvolume. Linux allows you to mount
a filesystem in multiple places at one. With the ability to mount
subvolumes separately in btrfs, this means that you can mount the top
level (subvolid=0) somewhere temporarily without having to unmount
anything else.

   Ths structure suggested in the sysadmin guide is more about not
having snapshots of / kept under / rather than for any technical
limitation of btrfs. If you re-read that section of the sysadmin
guide, the "creating a snapshot" doesn't involve unmounting any "live"
part of the FS. It's only when you want to roll back to an earlier
snapshot that you need to unmount the original subvolume (the second
example in that section).

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- Comic Sans goes into a bar,  and the barman says, "We don't ---   
                         serve your type here."                          

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help