kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Snapshot in ext4
@ 2012-01-04  9:43 Swapnil Gaikwad
  2012-01-05 19:17 ` Greg Freemyer
  0 siblings, 1 reply; 8+ messages in thread
From: Swapnil Gaikwad @ 2012-01-04  9:43 UTC (permalink / raw)
  To: kernelnewbies

1. Where to place snapshot files in filesystem level snapshot?
2. Is there any issues regarding it?
3. It is helpful to allocate new inode for a file od which snapshot is
taken?


-- 
    Regards,

Swapnil Gaikwad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120104/73fde34e/attachment.html 

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

* Snapshot in ext4
@ 2012-01-04  9:53 Swapnil Gaikwad
  2012-01-05 19:21 ` Greg Freemyer
  0 siblings, 1 reply; 8+ messages in thread
From: Swapnil Gaikwad @ 2012-01-04  9:53 UTC (permalink / raw)
  To: kernelnewbies

Is it is helpful to make some new datastructure that store the metadata of
file in snapshot?



-- 
    Regards,

Swapnil Gaikwad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120104/db8d51b8/attachment.html 

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

* Snapshot in ext4
@ 2012-01-04  9:55 Swapnil Gaikwad
  2012-01-05 19:35 ` Greg Freemyer
  0 siblings, 1 reply; 8+ messages in thread
From: Swapnil Gaikwad @ 2012-01-04  9:55 UTC (permalink / raw)
  To: kernelnewbies

If we store snapshot on other partition and assign new inode to each file's
snapshot. Then datablocks of that partition where we store snapshot is
wasted ? If not how?

-- 
    Regards,

Swapnil Gaikwad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120104/027d4ae8/attachment.html 

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

* Snapshot in ext4
@ 2012-01-04  9:56 Swapnil Gaikwad
  2012-01-05 19:40 ` Greg Freemyer
  0 siblings, 1 reply; 8+ messages in thread
From: Swapnil Gaikwad @ 2012-01-04  9:56 UTC (permalink / raw)
  To: kernelnewbies

Is it is possible to point to other partition's datablocks?

-- 
    Regards,

Swapnil Gaikwad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120104/ca40fbc5/attachment.html 

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

* Snapshot in ext4
  2012-01-04  9:43 Swapnil Gaikwad
@ 2012-01-05 19:17 ` Greg Freemyer
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Freemyer @ 2012-01-05 19:17 UTC (permalink / raw)
  To: kernelnewbies

I missed this series of questions before:

On Wed, Jan 4, 2012 at 4:43 AM, Swapnil Gaikwad <swapnilgaik72@gmail.com> wrote:
> 1. Where to place snapshot files in filesystem level snapshot?

What does that even mean.

> 2. Is there any issues regarding it?
> 3. It is helpful to allocate new inode for a file od which snapshot is
> taken?

I told you NTFS does the equivalent of allocating a new inode and new
pointer blocks for any files which have both a previous version and a
current verson.

So with a file like a database table that has some common content
between live and previous versions, you end up with data pointer
blocks for each version.  But they can point at the same data blocks
if the data blocks are unchanged.

So it clearly is a good way to do things.  I don't know how btrfs or
next4 handle it, so I'm not saying it is the best way.

>
> --
> ??? Regards,
>
> Swapnil Gaikwad.

Greg

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

* Snapshot in ext4
  2012-01-04  9:53 Swapnil Gaikwad
@ 2012-01-05 19:21 ` Greg Freemyer
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Freemyer @ 2012-01-05 19:21 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jan 4, 2012 at 4:53 AM, Swapnil Gaikwad <swapnilgaik72@gmail.com> wrote:
> Is it is helpful to make some new datastructure that store the metadata of
> file in snapshot?

I would say you primarily want new instances of existing data structures.

That is if need to track 10 different versions of a single file, then
you may want 10 inodes and 10 sets of pointer blocks.

Greg

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

* Snapshot in ext4
  2012-01-04  9:55 Snapshot in ext4 Swapnil Gaikwad
@ 2012-01-05 19:35 ` Greg Freemyer
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Freemyer @ 2012-01-05 19:35 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jan 4, 2012 at 4:55 AM, Swapnil Gaikwad <swapnilgaik72@gmail.com> wrote:
> If we store snapshot on other partition and assign new inode to each file's
> snapshot. Then datablocks of that partition where we store snapshot is
> wasted ? If not how?

That's effectively what a device mapper snapshot does.

Since only _changed_ blocks (inodes, pointer blocks, and data blocks)
are maintained in the snapshot volume, the snapshot volume can be much
smaller than the original volume.

I haven't studied the code, but obviously they have something like:

struct {
   boolean virgin;
   int alt_location;
} map[max_blocks];


So a read from the snapshot is just:

    if (map[block].virgin)
         read(primary_volume, block)
    else
         read(snapshot_volume,map[block].alt_location)

And write to the primary volume becomes

    if (map[block].virgin) {
         alt_loc=alloc_block_in_snapshot()
         map[block].alt_location = alt_loc
         map[block].virgin = false
         copy(block,alt_loc)
   }
    write(primary_volume, block)


Then when your snapshot volume fills up, you have to discard it
because it can't hold anymore changes.  So if your snapshot volume is
only 10% of the size of the primary volume, you can only support
having 10% of the original volume written to.

Greg

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

* Snapshot in ext4
  2012-01-04  9:56 Swapnil Gaikwad
@ 2012-01-05 19:40 ` Greg Freemyer
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Freemyer @ 2012-01-05 19:40 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jan 4, 2012 at 4:56 AM, Swapnil Gaikwad <swapnilgaik72@gmail.com> wrote:
> Is it is possible to point to other partition's datablocks?

Assuming you're willing to write new code, of course you can do that.

Examples:

Device mapper does it.  See the last email I just sent with DM pseudo
code for COW.

Note, DM calls them volumes, not partitions but the logic is the same.

Also, a lot of filesystems support a separate journal partition.  So
you have data in the journal that references the primary volume.

Greg

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

end of thread, other threads:[~2012-01-05 19:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04  9:55 Snapshot in ext4 Swapnil Gaikwad
2012-01-05 19:35 ` Greg Freemyer
  -- strict thread matches above, loose matches on Subject: below --
2012-01-04  9:56 Swapnil Gaikwad
2012-01-05 19:40 ` Greg Freemyer
2012-01-04  9:53 Swapnil Gaikwad
2012-01-05 19:21 ` Greg Freemyer
2012-01-04  9:43 Swapnil Gaikwad
2012-01-05 19:17 ` Greg Freemyer

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