On Mon, Jan 27, 2014 at 02:53:36PM +0100, KC wrote: > I have been trying to understand how snapshots work (in BRTFS and in > general), but I still have some questions, and would appreciate if > someone could clear them for me. > To make things easier, I tried to make most of them Yes/No questions: > > 1. When creating the filesystem, I only made btrfs partition with no > subvolumes. Do I have to use subvolumes, or can I snapshot entire > “/“? / (the top level of the FS) is a subvolume as well -- it's the only one that can't be renamed or deleted, though. > 2. Can I take a snapshot of a working / root filesystem? Yes. > 3. If I make a snapshot of / and there are some separate partitions > mounted under /mnt/ or /home/, will snapshot skip them? Yes. Snapshots work on a single subvolume at a time. > 4. If I have a snapshot of /, can I completely erase this partition > and later restore it in full form that snapshot, If you have your root filesystem as the top level of the btrfs filesystem, then no, you can't. I would recommend using the filesystem structure shown here https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Managing_snapshots because it makes making, managing and rolling back the snapshots much easier. > or do snapshots > work only if a limited number of files has been changed? Snapshots will continue to work regardless of how many files have been changed. The only thing to note is that as you make more modifications (either to the snapshot or the original, or both), the amount of storage requires goes up. Note that once you've made a snapshot, there's no distinction between the snapshot and the original -- they're completely equal partners. This means that you can delete either one and the other one will remain. > If the former, then does it mean that snapshot size will be > comparable to the original data size? When you first make a snapshot, the total storage space required is unchanged(*). As you make modifications, the two subvolumes will diverge from each other, and more and more space is needed. Eventually, when you've modified every file (on one side or the other), you will end up needing enough space to store each one separately. Basically, they share as many data extents as possible, and use separate ones only when needed. (*) OK, that's a lie -- you need an extra tree root for the snapshot, but that's a whole 4k-16k, depending on the size of your tree nodes. > 5. Can a snapshot be stored on a different partition? And if so, > does that partition have to be BTRFS too? I ask, because I would > also want to store snapshots in a cloud storage. No, they can't. Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- For months now, we have been making triumphant retreats --- before a demoralised enemy who is advancing in utter disorder.
Attachment:
signature.asc
Description: Digital signature
