All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs quota examples?
@ 2013-06-10  6:21 Tomasz Chmielewski
  2013-06-10  7:41 ` Arne Jansen
  0 siblings, 1 reply; 6+ messages in thread
From: Tomasz Chmielewski @ 2013-06-10  6:21 UTC (permalink / raw)
  To: linux-btrfs

I'm trying to use btrfs quotas, but I'm unable to find reliable
documentation on its usage.

Let's start with an empty subvolume:

- assign 200 MB space to it:

# btrfs qgroup limit 200m /mnt/btrfs-backup/tester/


- see the usage:

# btrfs qgroup show /mnt/btrfs-backup/tester/
0/803 0 0


- let's add a 100 MB file:

# dd if=/dev/urandom of=bigfile bs=1M count=100


- sync the FS to make sure quota is updated:

# btrfs filesystem
sync /mnt/btrfs-backup/ FSSync '/mnt/btrfs-backup/'


- see current quota usage:

# btrfs qgroup show /mnt/btrfs-backup/backuppc/tester/
0/803 104882176 104882176


Now, my questions:

- what do both 104882176 104882176 numbers represent?

- how can I verify the quota assigned to any given subvolume? I've assigned 200 MB, but how can I verify that number?


-- 
Tomasz Chmielewski
http://wpkg.org

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

* Re: btrfs quota examples?
  2013-06-10  6:21 btrfs quota examples? Tomasz Chmielewski
@ 2013-06-10  7:41 ` Arne Jansen
  2013-06-10  7:47   ` Tomasz Chmielewski
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arne Jansen @ 2013-06-10  7:41 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: linux-btrfs

On 10.06.2013 08:21, Tomasz Chmielewski wrote:
> I'm trying to use btrfs quotas, but I'm unable to find reliable
> documentation on its usage.
> 
> Let's start with an empty subvolume:
> 
> - assign 200 MB space to it:
> 
> # btrfs qgroup limit 200m /mnt/btrfs-backup/tester/
> 
> 
> - see the usage:
> 
> # btrfs qgroup show /mnt/btrfs-backup/tester/
> 0/803 0 0
> 
> 
> - let's add a 100 MB file:
> 
> # dd if=/dev/urandom of=bigfile bs=1M count=100
> 
> 
> - sync the FS to make sure quota is updated:
> 
> # btrfs filesystem
> sync /mnt/btrfs-backup/ FSSync '/mnt/btrfs-backup/'
> 
> 
> - see current quota usage:
> 
> # btrfs qgroup show /mnt/btrfs-backup/backuppc/tester/
> 0/803 104882176 104882176
> 
> 
> Now, my questions:
> 
> - what do both 104882176 104882176 numbers represent?

The first number represents the amount of data in that subvolume,
regardless whether that data is shared with other subvolumes or
not.
The second number shows the amount of data that is unique to this
subvolume and not shared with others, i.e. the amount of space
that will get freed if you delete this subvolume.
For how this extends to quota groups see http://sensille.com/qgroups.pdf

> 
> - how can I verify the quota assigned to any given subvolume? I've assigned 200 MB, but how can I verify that number?

The original patch set didn't include commands for that, but I
think I've seen patches for it on the mailing list, though I
can't find them right now.

-Arne

> 
> 


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

* Re: btrfs quota examples?
  2013-06-10  7:41 ` Arne Jansen
@ 2013-06-10  7:47   ` Tomasz Chmielewski
  2013-06-10  9:24   ` Wang Shilong
  2013-07-29  8:05   ` Tomasz Chmielewski
  2 siblings, 0 replies; 6+ messages in thread
From: Tomasz Chmielewski @ 2013-06-10  7:47 UTC (permalink / raw)
  To: Arne Jansen; +Cc: linux-btrfs

On Mon, 10 Jun 2013 09:41:39 +0200
Arne Jansen <sensille@gmx.net> wrote:

> > Now, my questions:
> > 
> > - what do both 104882176 104882176 numbers represent?
> 
> The first number represents the amount of data in that subvolume,
> regardless whether that data is shared with other subvolumes or
> not.
> The second number shows the amount of data that is unique to this
> subvolume and not shared with others, i.e. the amount of space
> that will get freed if you delete this subvolume.

Both numbers are bytes, correct?

-- 
Tomasz Chmielewski
htp://wpkg.org


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

* Re: btrfs quota examples?
  2013-06-10  7:41 ` Arne Jansen
  2013-06-10  7:47   ` Tomasz Chmielewski
@ 2013-06-10  9:24   ` Wang Shilong
  2013-07-29  8:05   ` Tomasz Chmielewski
  2 siblings, 0 replies; 6+ messages in thread
From: Wang Shilong @ 2013-06-10  9:24 UTC (permalink / raw)
  To: Arne Jansen; +Cc: Tomasz Chmielewski, linux-btrfs

Hello,

> On 10.06.2013 08:21, Tomasz Chmielewski wrote:
>> I'm trying to use btrfs quotas, but I'm unable to find reliable
>> documentation on its usage.
>> 
>> Let's start with an empty subvolume:
>> 
>> - assign 200 MB space to it:
>> 
>> # btrfs qgroup limit 200m /mnt/btrfs-backup/tester/
>> 
>> 
>> - see the usage:
>> 
>> # btrfs qgroup show /mnt/btrfs-backup/tester/
>> 0/803 0 0
>> 
>> 
>> - let's add a 100 MB file:
>> 
>> # dd if=/dev/urandom of=bigfile bs=1M count=100
>> 
>> 
>> - sync the FS to make sure quota is updated:
>> 
>> # btrfs filesystem
>> sync /mnt/btrfs-backup/ FSSync '/mnt/btrfs-backup/'
>> 
>> 
>> - see current quota usage:
>> 
>> # btrfs qgroup show /mnt/btrfs-backup/backuppc/tester/
>> 0/803 104882176 104882176
>> 
>> 
>> Now, my questions:
>> 
>> - what do both 104882176 104882176 numbers represent?
> 
> The first number represents the amount of data in that subvolume,
> regardless whether that data is shared with other subvolumes or
> not.
> The second number shows the amount of data that is unique to this
> subvolume and not shared with others, i.e. the amount of space
> that will get freed if you delete this subvolume.
> For how this extends to quota groups see http://sensille.com/qgroups.pdf
> 
>> 
>> - how can I verify the quota assigned to any given subvolume? I've assigned 200 MB, but how can I verify that number?
> 
> The original patch set didn't include commands for that, but I
> think I've seen patches for it on the mailing list, though I
> can't find them right now.

Yeah, We have sent the patch-set for a long time.

http://marc.info/?l=linux-btrfs&m=135478701223863&w=2


Thanks,
Wang
> 
> -Arne
> 
>> 
>> 
> 
> --
> 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] 6+ messages in thread

* Re: btrfs quota examples?
  2013-06-10  7:41 ` Arne Jansen
  2013-06-10  7:47   ` Tomasz Chmielewski
  2013-06-10  9:24   ` Wang Shilong
@ 2013-07-29  8:05   ` Tomasz Chmielewski
  2013-08-02  6:23     ` Arne Jansen
  2 siblings, 1 reply; 6+ messages in thread
From: Tomasz Chmielewski @ 2013-07-29  8:05 UTC (permalink / raw)
  To: Arne Jansen; +Cc: linux-btrfs

On Mon, 10 Jun 2013 09:41:39 +0200
Arne Jansen <sensille@gmx.net> wrote:

> > Now, my questions:
> > 
> > - what do both 104882176 104882176 numbers represent?
> 
> The first number represents the amount of data in that subvolume,
> regardless whether that data is shared with other subvolumes or
> not.
> The second number shows the amount of data that is unique to this
> subvolume and not shared with others, i.e. the amount of space
> that will get freed if you delete this subvolume.

I've played with qgroups for some time, but the results are rather
inconsistent.

I.e. here - what does a negative number represent in 0/1181 row?

# btrfs qgroup show /mnt/lxc2
0/260 151490953216 151490953216
0/261 180969472 180969472
0/262 155557888 983040
0/377 180310016 25776128
0/378 304088072192 304088072192
0/535 571944960 417370112
0/536 68550987776 68550987776
0/642 247463936 92921856
0/1175 617213952 827392
0/1181 16112013312 -22184235008
0/1268 38296248320 0
0/1269 616386560 0
0/1270 4096 4096
0/1271 4096 4096


-- 
Tomasz Chmielewski
http://wpkg.org

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

* Re: btrfs quota examples?
  2013-07-29  8:05   ` Tomasz Chmielewski
@ 2013-08-02  6:23     ` Arne Jansen
  0 siblings, 0 replies; 6+ messages in thread
From: Arne Jansen @ 2013-08-02  6:23 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: linux-btrfs, Jan Schmidt

On 07/29/13 10:05, Tomasz Chmielewski wrote:
> On Mon, 10 Jun 2013 09:41:39 +0200
> Arne Jansen <sensille@gmx.net> wrote:
> 
>>> Now, my questions:
>>>
>>> - what do both 104882176 104882176 numbers represent?
>>
>> The first number represents the amount of data in that subvolume,
>> regardless whether that data is shared with other subvolumes or
>> not.
>> The second number shows the amount of data that is unique to this
>> subvolume and not shared with others, i.e. the amount of space
>> that will get freed if you delete this subvolume.
> 
> I've played with qgroups for some time, but the results are rather
> inconsistent.
> 
> I.e. here - what does a negative number represent in 0/1181 row?

Either you have turned on qgroups after filling the subvol with
some data, or you've managed to produce a tracking error. In that
case, we would be interested how you did that and how to reproduce
it.

-Arne

> 
> # btrfs qgroup show /mnt/lxc2
> 0/260 151490953216 151490953216
> 0/261 180969472 180969472
> 0/262 155557888 983040
> 0/377 180310016 25776128
> 0/378 304088072192 304088072192
> 0/535 571944960 417370112
> 0/536 68550987776 68550987776
> 0/642 247463936 92921856
> 0/1175 617213952 827392
> 0/1181 16112013312 -22184235008
> 0/1268 38296248320 0
> 0/1269 616386560 0
> 0/1270 4096 4096
> 0/1271 4096 4096
> 
> 


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

end of thread, other threads:[~2013-08-02  6:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10  6:21 btrfs quota examples? Tomasz Chmielewski
2013-06-10  7:41 ` Arne Jansen
2013-06-10  7:47   ` Tomasz Chmielewski
2013-06-10  9:24   ` Wang Shilong
2013-07-29  8:05   ` Tomasz Chmielewski
2013-08-02  6:23     ` Arne Jansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.