On Thursday 18 February 2010, Chris Mason wrote: > I do like the subcommand method, more details below. >
I try to summarise your suggestions. But there are some cases not to clear for me. I grouped the commands in three categories: subvolume, devices, and 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 For the first two categories both Chris and Mike agreed; but IMHO there are some commands that don't fit nor in devices, nor subvolume, like resize (we resize a filesystem) and label (not available now). I don't know how classify defrag (per file / directory level ?) and sync (filesystem ?) An option is to consider commands without classification. For examples: $ btrfs subvolume create [path/]<subvolname> $ btrfs sync <path> $ btrfs defrag <file> 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. > > > > On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli > > <kreij...@gmail.com> wrote: > > > OPTIONS > > > snapshot|-s <source> [<dest>/]<name> > > > Create a writeble snapshot of the subvolume <source> with the > > > name <name> in the <dest> directory. If <source> is not a sub‐ > > > volume, btrfs returns an error. > > > > This should be "btrfs subvolume snapshot <source> [<dest>/]<name>". > > It only works on subvolumes. > > 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 that > uniquely matches it is allowed. > > We keep the long forms but allow the user to pick a shorter form if it > isn't ambiguous. > > > > > > > > > > > > delete|-D <subvolume> > > > Delete the subvolume <subvolume>. If <subvolume> is not a sub‐ > > > volume, btrfs returns an error. > > > > > > > This becomes: > > > > btrfs subvolume delete <subvolume> > > subvol del (same as above). > > > > > This works with snapshots as well. > > > > > > > > subvolume|-c [<dest>/]<name> > > > Create a subvolume in <dest> (or in the current directory if > > > <dest> is not passed). > > > > btrfs subvolume create [<dest>/]<name> > > > > > > > > > > > defrag|-f <file>|<dir> [<file>|<dir>...] > > > Defragment files and/or directories. > > > > This will defrag individual files? Does it defrag a directory tree? > > Does it defrag a subvolume? Does it defrag a pool? > > For now lets change this to only do files. That's the only thing the > tool supports today. > > > > > > > > > > > > scan|-n [<device> [<device>..]] > > > Scan devices for a btrfs filesystem. If no devices are passed, > > > btrfs scans all the block devices. > > > > btrfs pool scan [<device> [<device>..]] > > Instead of btrfs pool, please use btrfs dev > > > > > > > > > > > > fssync|-y <path> > > > Force a sync for the filesystem identified by <path>. > > > > > > > Does it sync a pool or subvolume? Assuming it works against > > subvolumes, it would be: > > > > btrfs subvolume sync <path> > > > > > > > > > > > resize|-z [+/-]<size>[gkm]|max <filesystem> > > > Resize a file system identified by <path>. The <size> parameter > > > specifies the new size of the filesystem. If the prefix + or - > > > is present the size is increased or decreased by the quantity > > > <size>. If no units are specified, the unit of the <size> > > > parameter is the byte. Optionally, the size parameter may be > > > suffixed by one of the following the units designators: 'K', > > > 'M', or 'G', kilobytes, megabytes, or gigabytes, respectively. > > > > > > If 'max' is passed, the filesystem will occupy all available > > > space on the volume(s). > > > > > > The resize command does not manipulate the size of underlying > > > partitions. If you wish to enlarge/reduce a filesystem, you > > > must make sure you can expand/reduce the size of the partition > > > also. > > > > > > > This works with physical devices, not a pool or subvolume. I get the > > name "physical volume" from lvm. Also I think it should resize to max > > without arguments, in order to do that, the size argument would need > > to be the last argument. > > We don't have physical volumes and logical volumes the way lvm does, so > I'd like to avoid the pvolume theme. > > > > > It becomes: > > > > btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem> > > > > Or: > > > > btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]] > > btrfs dev resize > > > > > > > > > show|-l [<dev>|<label>...] > > > Show the btrfs devices with some additional info. If no devices > > > or labels are passed, btrfs scans all the block devices. > > > > This becomes: > > > > btrfs pool show [<dev>|<label>...] > > btrfs dev show > > > > > > > > > > > > balance|-b <path> > > > Balance the chunk of the filesystem identified by <path> across > > > the devices. > > > > Is path to one of the block devices in the pool? > > > > This becomes: > > > > btrfs pool balance <path> > > btrfs dev balance > > > > > > > > > > > > add-dev|-A <dev> [<dev>..] <path> > > > Add device(s) to the filesystem identified by <path>. > > > > What is path? Somewhere the pool is mounted? The root of where the > > pool is mounted? > > The path just tells us which filesystem to work against. It can really > be any path inside the mount point. > > > > > this becomes: > > > > btrfs pvolume add <dev> [<dev>..] <path> > > btrfs dev add > > > > > > > > > > > rm-dev|-R <dev> [<dev>..] <path> > > > Remove device(s) to the filesystem identified by <path>. > > > > (same questions as with add) > > > > This becomes: > > > > btrfs pvolume remove <dev> [<dev>..] <path> > > btrfs dev remove > > -chris > > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinwind.it> Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html