From patchwork Sat Oct 9 19:33:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 243481 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o99JRCrd008790 for ; Sat, 9 Oct 2010 19:32:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760468Ab0JIT3j (ORCPT ); Sat, 9 Oct 2010 15:29:39 -0400 Received: from smtp206.alice.it ([82.57.200.102]:48639 "EHLO smtp206.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757093Ab0JIT3j (ORCPT ); Sat, 9 Oct 2010 15:29:39 -0400 Received: from venice.localnet (87.6.217.127) by smtp206.alice.it (8.5.124.08) id 4C1A268C0737508F; Sat, 9 Oct 2010 21:29:36 +0200 From: Goffredo Baroncelli Reply-To: kreijack@libero.it To: linux-btrfs@vger.kernel.org Subject: Re: [PATCH][btrfs progs] Update/clean up btrfs help and man page Date: Sat, 9 Oct 2010 21:33:25 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-trunk-amd64; KDE/4.4.5; x86_64; ; ) References: <201009132124.09118.kreijack@libero.it> <4CB07234.1080102@gmail.com> In-Reply-To: Cc: =?iso-8859-1?q?J=E9r=F4me_Poulin?= , Andreas Philipp MIME-Version: 1.0 Message-Id: <201010092133.32474.kreijack@libero.it> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Oct 2010 19:32:52 +0000 (UTC) diff --git a/INSTALL b/INSTALL index 16b45a5..2c9cf1c 100644 --- a/INSTALL +++ b/INSTALL @@ -22,23 +22,34 @@ in the e2fsprogs sources, and is usually available as libuuid or e2fsprogs-devel from various distros. Building the utilities is just make ; make install. The programs go -into /usr/local/bin. The commands available are: +into /usr/local/bin. The mains commands available are: mkfs.btrfs: create a filesystem -btrfsctl: control program to create snapshots and subvolumes: - +btrfs: control program to create snapshots and subvolumes: + # mount a btrfs filesystem mount /dev/sda2 /mnt - btrfsctl -s new_subvol_name /mnt - btrfsctl -s snapshot_of_default /mnt/default - btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name - btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol + + # create a subvolume + btrfs subvolume create /mnt/new_subvol_name + + # snapshot of a subvolume + btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default + btrfs subvolume snapshot /mnt/new_subvol_name \ + /mnt/snapshot_of_new_subvol + btrfs subvolume snapshot /mnt/snapshot_of_new_subvol \ + /mnt/snapshot_of_a_snapshot + + # list of the subvolumes ls /mnt default snapshot_of_a_snapshot snapshot_of_new_subvol new_subvol_name snapshot_of_default - Snapshots and subvolumes cannot be deleted right now, but you can - rm -rf all the files and directories inside them. + # removal of a subvolume or a snapshot + btrfs subvolume delete /mn/snapshot_of_a_snapshot + + # look a the btrfs man page for further information + man btrfs btrfsck: do a limited check of the FS extent trees. @@ -46,3 +57,5 @@ debug-tree: print all of the FS metadata in text form. Example: debug-tree /dev/sda2 >& big_output_file + + diff --git a/btrfs.c b/btrfs.c index 46314cf..a607786 100644 --- a/btrfs.c +++ b/btrfs.c @@ -61,6 +61,11 @@ static struct Command commands[] = { { do_subvol_list, 1, "subvolume list", "\n" "List the snapshot/subvolume of a filesystem." }, + { do_set_default_subvol, 2, + "subvolume set-default", " \n" + "Set the subvolume of the filesystem which will be mounted\n" + "as default." + }, { do_find_newer, 2, "subvolume find-new", " \n" "List the recently modified files in a filesystem." }, @@ -68,19 +73,15 @@ static struct Command commands[] = { "filesystem defragment", "[-vcf] [-s start] [-l len] [-t size] | [|...]\n" "Defragment a file or a directory." }, - { do_set_default_subvol, 2, - "subvolume set-default", " \n" - "Set the subvolume of the filesystem which will be mounted\n" - "as default." - }, { do_fssync, 1, "filesystem sync", "\n" "Force a sync on the filesystem ." }, { do_resize, 2, - "filesystem resize", "[+/-][gkm]|max \n" + "filesystem resize", "[:][+/-][gkm]|max \n" "Resize the file system. If 'max' is passed, the filesystem\n" - "will occupe all available space on the device." + "will occupe all available space on the device. is\n" + "the id of the device which grown or will shrink." }, { do_show_filesystem, 999, "filesystem show", "[|