linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs defra
@ 2011-06-13 14:50 Bernhard Duebi
  2011-06-13 15:54 ` Hugo Mills
  0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Duebi @ 2011-06-13 14:50 UTC (permalink / raw)
  To: linux-btrfs

Hello everybody,

I'm no developer, just a simple user. I use btrfs as the root filesystem
on my laptop. I use VirtualBox. Every VB disk lives in a separat btrfs
subvolume. I use btrfs snapshots for backup and to clone VB VMs.

I wonder what happens when I defrag a file that is part of multiple
snapshots? Will all instances of this file be defragmented, or will the
file get its own fresh copy?

If it is important, my system is a 64bit ubuntu 10.10 and the filesystem
is mounted with the option compress. If it helps, I would consider to
upgrade to 11.04.

BTW: what is the difference between defrag and balance ?

Sincerely
Bernhard



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

* Re: btrfs defra
  2011-06-13 14:50 btrfs defra Bernhard Duebi
@ 2011-06-13 15:54 ` Hugo Mills
  2011-06-16 13:50   ` David Nicol
  0 siblings, 1 reply; 4+ messages in thread
From: Hugo Mills @ 2011-06-13 15:54 UTC (permalink / raw)
  To: Bernhard Duebi; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On Mon, Jun 13, 2011 at 04:50:37PM +0200, Bernhard Duebi wrote:
> I'm no developer, just a simple user. I use btrfs as the root filesystem
> on my laptop. I use VirtualBox. Every VB disk lives in a separat btrfs
> subvolume. I use btrfs snapshots for backup and to clone VB VMs.
> 
> I wonder what happens when I defrag a file that is part of multiple
> snapshots? Will all instances of this file be defragmented, or will the
> file get its own fresh copy?

   The file gets its own copy.

> If it is important, my system is a 64bit ubuntu 10.10 and the filesystem
> is mounted with the option compress. If it helps, I would consider to
> upgrade to 11.04.
> 
> BTW: what is the difference between defrag and balance ?

   Defrag works on individual files, and tries to find a contiguous
sequence of bytes to write the file's data to. In the process, the
current implementation will break any CoW duplication -- either within
single files (copies with cp --reflink=always) or files copied via
snapshotting.

   Balance works at a much higher level, rewriting all (or large
quantities) of the filesystem data and metadata. Balance was
originally designed to re-allocate all of the space the FS needs, thus
enabling you to add more disks to a filesystem and ensure that they
get used. (It's also useful for re-building spare copies of data if a
disk's been removed as a result of failure). Balance will maintain all
existing file semantics as it runs -- CoW copies are preserved, and no
additional space will be used.

   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
       --- Someone's been throwing dead sheep down my Fun Well ---       

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

* Re: btrfs defra
  2011-06-13 15:54 ` Hugo Mills
@ 2011-06-16 13:50   ` David Nicol
  2011-06-17 12:19     ` Bernhard Duebi
  0 siblings, 1 reply; 4+ messages in thread
From: David Nicol @ 2011-06-16 13:50 UTC (permalink / raw)
  To: Hugo Mills, Bernhard Duebi, linux-btrfs

> =C2=A0 Defrag works on individual files, and tries to find a contiguo=
us
> sequence of bytes to write the file's data to. In the process, the
> current implementation will break any CoW duplication -- either withi=
n
> single files (copies with cp --reflink=3Dalways) or files copied via
> snapshotting.


While it's obviously impossible to defrag and maintain deduplicated
partial chunks simultaneously without some kind of compromise (the
ideal form of which is just beyond the reach of this list
participant's obviousness flashlight),  how difficult is it going to
be to modify the current defrag implementation to hip the additional
references to the file to the fact that a contiguous version (of an
individual file) is now available and it's time to update their links
too, after each file with multiple reflinks/snapshots to its current
form has been copied to contiguous space?

Could Bernhard Duebi do it?
--
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

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

* Re: btrfs defra
  2011-06-16 13:50   ` David Nicol
@ 2011-06-17 12:19     ` Bernhard Duebi
  0 siblings, 0 replies; 4+ messages in thread
From: Bernhard Duebi @ 2011-06-17 12:19 UTC (permalink / raw)
  To: David Nicol; +Cc: Hugo Mills, linux-btrfs

On Thu, 2011-06-16 at 08:50 -0500, David Nicol wrote:
> >   Defrag works on individual files, and tries to find a contiguous
> > sequence of bytes to write the file's data to. In the process, the
> > current implementation will break any CoW duplication -- either within
> > single files (copies with cp --reflink=always) or files copied via
> > snapshotting.
> 
> 
> While it's obviously impossible to defrag and maintain deduplicated
> partial chunks simultaneously without some kind of compromise (the
> ideal form of which is just beyond the reach of this list
> participant's obviousness flashlight),  how difficult is it going to
> be to modify the current defrag implementation to hip the additional
> references to the file to the fact that a contiguous version (of an
> individual file) is now available and it's time to update their links
> too, after each file with multiple reflinks/snapshots to its current
> form has been copied to contiguous space?
> 
> Could Bernhard Duebi do it?

Unfortunately not, I'm just a system engineer with interest in storage.
I'm sorry to disapoint you.

Sincerely
Bernhard




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

end of thread, other threads:[~2011-06-17 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 14:50 btrfs defra Bernhard Duebi
2011-06-13 15:54 ` Hugo Mills
2011-06-16 13:50   ` David Nicol
2011-06-17 12:19     ` Bernhard Duebi

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