From mboxrd@z Thu Jan 1 00:00:00 1970 From: Goffredo Baroncelli Subject: Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem Date: Thu, 18 Feb 2010 20:59:59 +0100 Message-ID: <201002182100.00624.kreijack@libero.it> References: <201002172102.17816.kreijack@libero.it> <93cdabd21002171535w55ad862fpd5ea845117cdcb85@mail.gmail.com> <20100218165841.GO10559@think> Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Cc: Thomas Kupper , "Dipl.-Ing. Michael Niederle" , rk To: Chris Mason , Mike Fedyk , Goffredo Baroncelli , linux-btrfs@vger.kernel.org Return-path: In-Reply-To: <20100218165841.GO10559@think> List-ID: On Thursday 18 February 2010, Chris Mason wrote: > I do like the subcommand method, more details below. >=20 I try to summarise your suggestions. But there are some cases not to cl= ear for=20 me.=20 I grouped the commands in three categories: subvolume, devices, and=20 filesystem. devices scan devices show devices balance devices add devices remove subvolume snapshot subvolume delete subvolume create [subvolume list] filesystem resize [filesystem label] ??? defrag ??? sync =46or the first two categories both Chris and Mike agreed; but IMHO the= re are=20 some commands that don't fit nor in devices, nor subvolume, like resize= (we=20 resize a filesystem) and label (not available now). I don't know how classify defrag (per file / directory level ?) and syn= c=20 (filesystem ?) An option is to consider commands without classification. For examples: $ btrfs subvolume create [path/] $ btrfs sync $ btrfs defrag Any comments and/or suggestions ? > On Wed, Feb 17, 2010 at 03:35:26PM -0800, Mike Fedyk wrote: > > I think he need some command hierarchy here. > >=20 > > On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli > > wrote: > > > OPTIONS > > > snapshot|-s [/] > > > Create a writeble snapshot of the subvolume with=20 the > > > name in the directory. If i= s not a=20 sub=E2=80=90 > > > volume, btrfs returns an error. > >=20 > > This should be "btrfs subvolume snapshot [/]". > > It only works on subvolumes. >=20 > If we can type subvol instead of subvolume I like it. Basically the > perl/python arg parsing system where any short form of the command th= at > uniquely matches it is allowed. >=20 > We keep the long forms but allow the user to pick a shorter form if i= t > isn't ambiguous. >=20 > >=20 > > > > > > > > > delete|-D > > > Delete the subvolume . If is = not a=20 sub=E2=80=90 > > > volume, btrfs returns an error. > > > > >=20 > > This becomes: > >=20 > > btrfs subvolume delete >=20 > subvol del (same as above). >=20 > >=20 > > This works with snapshots as well. > >=20 > > > > > > subvolume|-c [/] > > > Create a subvolume in (or in the current=20 directory if > > > is not passed). > >=20 > > btrfs subvolume create [/] > >=20 > > > > > > > > > defrag|-f | [|...] > > > Defragment files and/or directories. > >=20 > > This will defrag individual files? Does it defrag a directory tree= ? > > Does it defrag a subvolume? Does it defrag a pool? >=20 > For now lets change this to only do files. That's the only thing the > tool supports today. >=20 > >=20 > > > > > > > > > scan|-n [ [..]] > > > Scan devices for a btrfs filesystem. If no devices = are=20 passed, > > > btrfs scans all the block devices. > >=20 > > btrfs pool scan [ [..]] >=20 > Instead of btrfs pool, please use btrfs dev >=20 > >=20 > > > > > > > > > fssync|-y > > > Force a sync for the filesystem identified by = =2E > > > > >=20 > > Does it sync a pool or subvolume? Assuming it works against > > subvolumes, it would be: > >=20 > > btrfs subvolume sync > >=20 > > > > > > > > > resize|-z [+/-][gkm]|max > > > Resize a file system identified by . The =20 parameter > > > specifies the new size of the filesystem. If the pr= efix +=20 or - > > > is present the size is increased or decreased by = the=20 quantity > > > . If no units are specified, the unit of = the=20 > > > parameter is the byte. Optionally, the size para= meter=20 may be > > > suffixed by one of the following the units design= ators:=20 'K', > > > 'M', or 'G', kilobytes, megabytes, or gigabytes,=20 respectively. > > > > > > If 'max' is passed, the filesystem will occupy a= ll=20 available > > > space on the volume(s). > > > > > > The resize command does not manipulate the size of= =20 underlying > > > partitions. If you wish to enlarge/reduce a=20 filesystem, you > > > must make sure you can expand/reduce the size of th= e=20 partition > > > also. > > > > >=20 > > This works with physical devices, not a pool or subvolume. I get t= he > > name "physical volume" from lvm. Also I think it should resize to = max > > without arguments, in order to do that, the size argument would nee= d > > to be the last argument. >=20 > We don't have physical volumes and logical volumes the way lvm does, = so > I'd like to avoid the pvolume theme. >=20 > >=20 > > It becomes: > >=20 > > btrfs pvolume resize [+/-][gkm]|max > >=20 > > Or: > >=20 > > btrfs pvolume resize [[+/-][gkm]] >=20 > btrfs dev resize >=20 > >=20 > > > > > > show|-l [|