From patchwork Sat Oct 13 17:47:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 1589241 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4A486E018B for ; Sat, 13 Oct 2012 17:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958Ab2JMRs2 (ORCPT ); Sat, 13 Oct 2012 13:48:28 -0400 Received: from mail-ea0-f174.google.com ([209.85.215.174]:42593 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753940Ab2JMRs1 (ORCPT ); Sat, 13 Oct 2012 13:48:27 -0400 Received: by mail-ea0-f174.google.com with SMTP id c13so832600eaa.19 for ; Sat, 13 Oct 2012 10:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=JEg69AkVnrzUXGqKzKTt1+lOQU9Q8XQUe16TBuHxl5c=; b=L5sap5pyPrtfXqeXuzMBbP8oAMRsONL11nMCqDw5mErUbrhJ37ty8TMZanuFRMvrBz uAorG+Nufu3fSzl8WVIfw4BLw3s++kvjoNBWKdHBseOYMJd8DRqxiZ3tTJiA+4kSXdX4 A7xffgJFYJnFc7eCSVcrkOjgqI8rt96bDJLIh8oO+MAnDyexfaDdB0X501tpUQUD1bfU vR2LNVrA8LW3i52/nQT+HDkkkEXwyJ6aLlfWkkm2EyUCWxCkhM3C5ChEmGy4F/aoVFqi oOCAxZSSA+o9ZxKGApoJawF44RP309A9KtNunfqootquFvCzSMwFnxk3NJenh2JQbBa0 +zMg== Received: by 10.14.201.73 with SMTP id a49mr10366222eeo.39.1350150505880; Sat, 13 Oct 2012 10:48:25 -0700 (PDT) Received: from venice..bhome (host103-133-static.242-95-b.business.telecomitalia.it. [95.242.133.103]) by mx.google.com with ESMTPS id d44sm17013051eeo.10.2012.10.13.10.48.24 (version=SSLv3 cipher=OTHER); Sat, 13 Oct 2012 10:48:25 -0700 (PDT) From: Goffredo Baroncelli To: Chris Mason Cc: Hugo Mills , Roman Mamedov , =?UTF-8?B?U8OpYmFzdGllbiBNYXVyeQ==?= , Ilya Dryomov , linux-btrfs@vger.kernel.org, Martin Steigerwald , Goffredo Baroncelli Subject: [PATCH 2/2] Update help page Date: Sat, 13 Oct 2012 19:47:41 +0200 Message-Id: <1350150461-11099-3-git-send-email-kreijack@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350150461-11099-1-git-send-email-kreijack@gmail.com> References: <1350150461-11099-1-git-send-email-kreijack@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Goffredo Baroncelli --- man/btrfs.8.in | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/man/btrfs.8.in b/man/btrfs.8.in index 4b0a9f9..ecd0916 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@ -27,6 +27,8 @@ btrfs \- control a btrfs filesystem .PP \fBbtrfs\fP \fBfilesystem label\fP\fI [newlabel]\fP .PP +\fBbtrfs\fP \fBfilesystem df\fP\fI [-k] \fIpath [path..]\fR\fP +.PP \fBbtrfs\fP \fBsubvolume find-new\fP\fI \fP .PP \fBbtrfs\fP \fBfilesystem balance\fP\fI \fP @@ -214,6 +216,104 @@ NOTE: Currently there are the following limitations: - the filesystem should not have more than one device. .TP +\fBfilesystem df\fP [-k] \fIpath [path..]\fR + +Show space usage information for a mount point. + +\fIOptions\fP + +\fB-k\fP Set KB (1024 bytes) as unit + +\fIUsage information\fP + +.\" +.\" this section is extract from +.\" http://en.wikipedia.org/wiki/Btrfs#Chunk_and_device_trees +The disk(s) of a btrfs filesystem are divided into chunks of 256 MB or more. +Chunks may be mirrored or striped across multiple devices, depending by +the allocation policy. +The mirroring/striping arrangement is transparent to the rest of the +file system, which simply sees the single, logical address space that +chunks are mapped into. +Chunks are allocated on demand. In the default allocation policy +the data chunks are not duplicated and the metadata chunks +are duplicated. This default can be changed during the filesystem +creation, and in general the chunks allocation policy may change +during the filesystem life. + +Depending by the allocation policy a chunk may require a space on +the disk greater than the logical space that it provides. E.g. +a chunk DUPlicated or with a RAID1/RAID10 level +requires a space on the disk +two times greater than the logical space provided. +Different RAID levels +have a different ratio disk-usage / logical space offered. + +Normally the file contents are stored in the Data chunks; however +small files (which fit into a btree leaf) are stored in the +metadata chunks. So the computation of the \fIfree space\fP +and \fIused space\fP +is complex: depending by the file size different +allocation policies are used. + +The command \fBbtrfs filesystem df\fP is used to query the status +of the chunks, how many space on the disk(s) are used by the chunks, +how many space are available in the chunks, and an estimation of the free +space of the filesystem. +The output of the command \fBbtrfs filesystem df\fP shows: + +.RS +.IP \fBDisk\ size\fP +the total size of the disks which compose the filesystem. + +.IP \fBDisk\ allocated\fP\ or\ \fBSize_(disk)\fP +the size of the area of the disks used by the chunks. + +.IP \fBDisk\ unallocated\fP +the size of the area of the disks which is free (i.e. +the differences of the values above). + +.IP \fBLogical\ size\fP\ or\ \fBSize_(logical)\fP +the available logical space of chunk. + +.IP \fBUsed\fP +the portion of the logical space used by the file and metadata. + +.IP \fBFree\ (estimated)\fP +the estimated free space available. The evaluation +cannot be rigorous because it depends by the allocation policy (DUP,Single, +RAID1...) of the metadata and data chunks. If every chunks is stored as +"Single" the sum of the \fBfree (estimated)\fP space and the \fBused\fP +space is equal to the \fBdisk size\fP. +Otherwise if all the chunk are mirrored (raid1 or raid10) or duplicated +the sum of the \fBfree (estimated)\fP space and the \fBused\fP space is +half of the \fBdisk size\fP. Normally the \fBfree (estimated)\fP is between +these two limits. + +.IP \fBData\ to\ disk\ ratio\fP +the ratio betwen the \fBlogical size\fP and the \fBdisk allocated\fP. + +.IP \fBMode\fP +the kind of allocation policy used by the chunk (e.g. DUPlicated, +RAID1, RAID10, Single....) + +.IP \fBType\fP +the kind of chunk (Data, Metdata, System...) + +.RE +.RS +\fINOTE\fP + +When a chunk is allocated, its disk-area is used and its allocation +policy is fixed. +A rebalance operation could rearrange the chunks, moving data in the chunks +and resizing the allocated chunks. This causes the change of all the values +discussed above, with the exception of the \fBused\fP and +\fBdisk size\fP values. + +.RE +.TP + \fBfilesystem show\fR [--all-devices||