* [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
@ 2010-02-17 20:02 Goffredo Baroncelli
2010-02-17 20:48 ` Andreas Philipp
2010-02-17 23:35 ` Mike Fedyk
0 siblings, 2 replies; 15+ messages in thread
From: Goffredo Baroncelli @ 2010-02-17 20:02 UTC (permalink / raw)
To: Chris Mason, linux-btrfs
Cc: Thomas Kupper, Dipl.-Ing. Michael Niederle, rk, Mike Fedyk
Hi all,
enclosed in the next two emails you can find two patches which introduc=
e a new=20
program called "btrfs". This program has the ambitious to replace the=20
utilities of the btrfs-prog package, like:
- btrfsctl
- btrfs-show
- btrfs-volume
- btrfs
The goals are:
- improve the usability of the tools=20
- add a man page which documents all the commands
- correct the btrfsctl return codes
I put a lot of attentions in order to avoid regression respect the old =
tools.
A clone of my git repository is available at
http://cassiopea.homelinux.net/git/btrfs-command.git
On the basis of the feedback of the previous patches I rearranged some =
"short=20
command name" (-s, -c ...) in order to avoid collision. I renamed also =
the=20
command "create" in "subvolume" (and the relative short command name fr=
om '-S'=20
to '-c' :-) ).
Chris, do you think that these patches are mergeable ?
Comments are welcome.
BR
Goffredo
---
Makefile | 5
btrfs.c | 775 ++++++++++++++++++++++++++++++++++++++++++++++++=
+++++
man/Makefile | 5
man/btrfs.8.in | 122 ++++++++
4 files changed, 905 insertions(+), 2 deletions(-)
--
Example of use:
$ btrfs
Usage:
btrfs snapshot|-s [<dest>/]<name>
Create a writeble snapshot of the subvolume <source> wi=
th
the name <name> in the <dest> directory.
btrfs delete|-D <subvolume>
Delete the subvolume <subvolume>.
btrfs subvolume|-c [<dest>/]<name>
Create a subvolume in <dest> (or the current directory =
if
not passed).
btrfs defrag|-f <file>|<dir> [<file>|<dir>...]
Defragment a file or a directory.
btrfs scan|-n [<device> [<device>..]
Scan all device for or the passed device for a btrfs
filesystem.
btrfs fssync|-y <path>
Force a fs sync on the filesystem <path>
btrfs resize|-z [+/-]<newsize>[gkm]|max <filesystem>
Resize the file system. If 'max' is passed, the filesys=
tem
will occupe all available space on the device.
btrfs show|-l [<dev>|<label>...]
Show the btrfs devices
btrfs balance|-b <path>
Balance the chunk across the device
btrfs add-dev|-A <dev> [<dev>..] <path>
Add a device to a filesystem
btrfs rm-dev|-R <dev> [<dev>..] <path>
Remove a device to a filesystem
btrfs help|--help|-h
Show the help.
Btrfs v0.19-12-g7e4c8e8-dirty
BTRFS(8) btrfs B=
TRFS(8)
NAME
btrfs - control a btrfs filesystem
SYNOPSIS
btrfs snapshot|-s <source> [<dest>/]<name>
btrfs delete|-D <subvolume>
btrfs subvolume|-c [<dest>/]<name>
btrfs defrag|-f <file>|<dir> [<file>|<dir>...]
btrfs fssync|-y <path>
btrfs resize|-z [+/-]<size>[gkm]|max <filesystem>
btrfs scan|-n [<device> [<device>..]]
btrfs show|-l <dev>|<label> [<dev>|<label>...]
btrfs balance|-b <path>
btrfs add-dev|-A <dev> [<dev>..] <path>
btrfs rm-dev|-R <dev> [<dev>..] <path> ]
btrfs help|--help|-h
DESCRIPTION
btrfs is used to control the filesystem and the files and dire=
ctories
stored. It is the tool to create or destroy a new snapshot or =
a new
subvolume for the filesystem, to defrag a file or a directory, t=
o flush
the dato to the disk, to resize the filesystem, to scan the devi=
ce. =20
OPTIONS
snapshot|-s <source> [<dest>/]<name>
Create a writeble snapshot of the subvolume <source> wi=
th the
name <name> in the <dest> directory. If <source> is not=
a sub=E2=80=90
volume, btrfs returns an error. =
=20
delete|-D <subvolume>
Delete the subvolume <subvolume>. If <subvolume> is not =
a sub=E2=80=90
volume, btrfs returns an error. =
=20
subvolume|-c [<dest>/]<name>
Create a subvolume in <dest> (or in the current direc=
tory if
<dest> is not passed). =
=20
defrag|-f <file>|<dir> [<file>|<dir>...]
Defragment files and/or directories.
scan|-n [<device> [<device>..]]
Scan devices for a btrfs filesystem. If no devices are =
passed,
btrfs scans all the block devices. =
=20
fssync|-y <path>
Force a sync for the filesystem identified by <path>.
resize|-z [+/-]<size>[gkm]|max <filesystem>
Resize a file system identified by <path>. The <size> pa=
rameter
specifies the new size of the filesystem. If the prefix =
+ or -
is present the size is increased or decreased by the q=
uantity
<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, respecti=
vely. =20
If 'max' is passed, the filesystem will occupy all av=
ailable
space on the volume(s). =
=20
The resize command does not manipulate the size of und=
erlying
partitions. If you wish to enlarge/reduce a filesyst=
em, you
must make sure you can expand/reduce the size of the pa=
rtition
also. =
=20
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.
balance|-b <path>
Balance the chunk of the filesystem identified by <path> =
across
the devices.
add-dev|-A <dev> [<dev>..] <path>
Add device(s) to the filesystem identified by <path>.
rm-dev|-R <dev> [<dev>..] <path>
Remove device(s) to the filesystem identified by <path>.
EXIT STATUS
btrf returns a zero exist status if it succeeds. Non zero is r=
eturned
in case of failure.
AVAILABILITY
btrfs is part of btrfs-progs. Btrfs filesystem is currently unde=
r heavy
development, and not suitable for any uses other than benchmark=
ing and
review. Please refer to the btrfs wiki http://btrfs.wiki.ker=
nel.org
for further details.
SEE ALSO
mkfs.btrfs(8)
btrfs B=
TRFS(8)
--=20
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinw=
ind.it>
Key fingerprint =3D 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-17 20:02 [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem Goffredo Baroncelli
@ 2010-02-17 20:48 ` Andreas Philipp
2010-02-17 21:00 ` Goffredo Baroncelli
2010-02-17 23:35 ` Mike Fedyk
1 sibling, 1 reply; 15+ messages in thread
From: Andreas Philipp @ 2010-02-17 20:48 UTC (permalink / raw)
To: Goffredo Baroncelli; +Cc: linux-btrfs
Hi,
Cool tool.
Just looking at the help output on the console I found a small typo.
Kind regards,
Andreas Philipp
diff --git a/btrfs.c b/btrfs.c
index cc55599..f3e5d8d 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -633,7 +633,7 @@ static struct Command commands[] =3D {
"Add a device to a filesystem"
},
{ -1, "rm-dev", "-R", "<dev> [<dev>..] <path>\n"
- "Remove a device to a filesystem"
+ "Remove a device from a filesystem"
},
/* coming soon
{ 2, "label", "-m", "<label> <path>\n"
On 17.02.2010 21:02, Goffredo Baroncelli wrote:
> Hi all,
>
> enclosed in the next two emails you can find two patches which introd=
uce a new=20
> program called "btrfs". This program has the ambitious to replace the=
=20
> utilities of the btrfs-prog package, like:
> - btrfsctl
> - btrfs-show
> - btrfs-volume
> - btrfs
>
> The goals are:
> - improve the usability of the tools=20
> - add a man page which documents all the commands
> - correct the btrfsctl return codes
>
> I put a lot of attentions in order to avoid regression respect the ol=
d tools.
> A clone of my git repository is available at
>
> http://cassiopea.homelinux.net/git/btrfs-command.git
>
> On the basis of the feedback of the previous patches I rearranged som=
e "short=20
> command name" (-s, -c ...) in order to avoid collision. I renamed als=
o the=20
> command "create" in "subvolume" (and the relative short command name =
from '-S'=20
> to '-c' :-) ).
>
> Chris, do you think that these patches are mergeable ?
>
> Comments are welcome.
>
> BR
> Goffredo
> ---
>
> Makefile | 5
> btrfs.c | 775 ++++++++++++++++++++++++++++++++++++++++++++++=
+++++++
> man/Makefile | 5
> man/btrfs.8.in | 122 ++++++++
> 4 files changed, 905 insertions(+), 2 deletions(-)
>
> --
>
> Example of use:
> $ btrfs
> Usage:
> btrfs snapshot|-s [<dest>/]<name>
> Create a writeble snapshot of the subvolume <source> =
with
> the name <name> in the <dest> directory.
> btrfs delete|-D <subvolume>
> Delete the subvolume <subvolume>.
> btrfs subvolume|-c [<dest>/]<name>
> Create a subvolume in <dest> (or the current director=
y if
> not passed).
> btrfs defrag|-f <file>|<dir> [<file>|<dir>...]
> Defragment a file or a directory.
> btrfs scan|-n [<device> [<device>..]
> Scan all device for or the passed device for a btrfs
> filesystem.
> btrfs fssync|-y <path>
> Force a fs sync on the filesystem <path>
> btrfs resize|-z [+/-]<newsize>[gkm]|max <filesystem>
> Resize the file system. If 'max' is passed, the files=
ystem
> will occupe all available space on the device.
> btrfs show|-l [<dev>|<label>...]
> Show the btrfs devices
> btrfs balance|-b <path>
> Balance the chunk across the device
> btrfs add-dev|-A <dev> [<dev>..] <path>
> Add a device to a filesystem
> btrfs rm-dev|-R <dev> [<dev>..] <path>
> Remove a device to a filesystem
>
> btrfs help|--help|-h
> Show the help.
>
> Btrfs v0.19-12-g7e4c8e8-dirty
>
>
>
>
> BTRFS(8) btrfs =
BTRFS(8)
>
>
>
> NAME
> btrfs - control a btrfs filesystem
>
> SYNOPSIS
> btrfs snapshot|-s <source> [<dest>/]<name>
>
> btrfs delete|-D <subvolume>
>
> btrfs subvolume|-c [<dest>/]<name>
>
> btrfs defrag|-f <file>|<dir> [<file>|<dir>...]
>
> btrfs fssync|-y <path>
>
> btrfs resize|-z [+/-]<size>[gkm]|max <filesystem>
>
> btrfs scan|-n [<device> [<device>..]]
>
> btrfs show|-l <dev>|<label> [<dev>|<label>...]
>
> btrfs balance|-b <path>
>
> btrfs add-dev|-A <dev> [<dev>..] <path>
>
> btrfs rm-dev|-R <dev> [<dev>..] <path> ]
>
>
> btrfs help|--help|-h
>
> DESCRIPTION
> btrfs is used to control the filesystem and the files and di=
rectories
> stored. It is the tool to create or destroy a new snapshot o=
r a new
> subvolume for the filesystem, to defrag a file or a directory,=
to flush
> the dato to the disk, to resize the filesystem, to scan the de=
vice. =20
>
>
> 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 n=
ot a sub=E2=80=90
> volume, btrfs returns an error. =
=20
>
>
> delete|-D <subvolume>
> Delete the subvolume <subvolume>. If <subvolume> is not=
a sub=E2=80=90
> volume, btrfs returns an error. =
=20
>
>
> subvolume|-c [<dest>/]<name>
> Create a subvolume in <dest> (or in the current dir=
ectory if
> <dest> is not passed). =
=20
>
>
> defrag|-f <file>|<dir> [<file>|<dir>...]
> Defragment files and/or directories.
>
>
> scan|-n [<device> [<device>..]]
> Scan devices for a btrfs filesystem. If no devices are=
passed,
> btrfs scans all the block devices. =
=20
>
>
> fssync|-y <path>
> Force a sync for the filesystem identified by <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 prefi=
x + or -
> is present the size is increased or decreased by the=
quantity
> <size>. If no units are specified, the unit of th=
e <size>
> parameter is the byte. Optionally, the size paramet=
er may be
> suffixed by one of the following the units designato=
rs: 'K',
> 'M', or 'G', kilobytes, megabytes, or gigabytes, respec=
tively. =20
>
> If 'max' is passed, the filesystem will occupy all =
available
> space on the volume(s). =
=20
>
> The resize command does not manipulate the size of u=
nderlying
> partitions. If you wish to enlarge/reduce a filesy=
stem, you
> must make sure you can expand/reduce the size of the =
partition
> also. =
=20
>
>
> show|-l [<dev>|<label>...]
> Show the btrfs devices with some additional info. If n=
o devices
> or labels are passed, btrfs scans all the block devices=
=2E
>
>
> balance|-b <path>
> Balance the chunk of the filesystem identified by <path=
> across
> the devices.
>
>
> add-dev|-A <dev> [<dev>..] <path>
> Add device(s) to the filesystem identified by <path>.
>
>
> rm-dev|-R <dev> [<dev>..] <path>
> Remove device(s) to the filesystem identified by <path>=
=2E
>
> EXIT STATUS
> btrf returns a zero exist status if it succeeds. Non zero is=
returned
> in case of failure.
>
>
> AVAILABILITY
> btrfs is part of btrfs-progs. Btrfs filesystem is currently un=
der heavy
> development, and not suitable for any uses other than benchma=
rking and
> review. Please refer to the btrfs wiki http://btrfs.wiki.k=
ernel.org
> for further details.
>
> SEE ALSO
> mkfs.btrfs(8)
>
>
>
> btrfs =
BTRFS(8)
>
> =20
--
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 related [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-17 20:48 ` Andreas Philipp
@ 2010-02-17 21:00 ` Goffredo Baroncelli
0 siblings, 0 replies; 15+ messages in thread
From: Goffredo Baroncelli @ 2010-02-17 21:00 UTC (permalink / raw)
To: Andreas Philipp; +Cc: linux-btrfs
On Wednesday 17 February 2010, you (Andreas Philipp) wrote:
>
> Andreas Philipp <philipp.andreas@gmail.com>
Thank you, I corrected my source and updated the changes to the public
repository.
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-17 20:02 [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem Goffredo Baroncelli
2010-02-17 20:48 ` Andreas Philipp
@ 2010-02-17 23:35 ` Mike Fedyk
2010-02-18 9:45 ` Piavlo
2010-02-18 16:58 ` Chris Mason
1 sibling, 2 replies; 15+ messages in thread
From: Mike Fedyk @ 2010-02-17 23:35 UTC (permalink / raw)
To: Goffredo Baroncelli
Cc: Chris Mason, linux-btrfs, Thomas Kupper, Dipl.-Ing. Michael Niederle, rk
I think he need some command hierarchy here.
On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli
<kreijack@gmail.com> wrote:
> OPTIONS
> =C2=A0 =C2=A0 =C2=A0 snapshot|-s <source> [<dest>/]<name>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create a writeble sna=
pshot of the subvolume =C2=A0<source> =C2=A0with =C2=A0the
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name =C2=A0<name> =C2=
=A0in the <dest> directory. If <source> is not a sub=E2=80=90
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs returns=
an error.
This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
It only works on subvolumes.
>
>
> =C2=A0 =C2=A0 =C2=A0 delete|-D <subvolume>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Delete the subvolume =
<subvolume>. If <subvolume> is not =C2=A0a =C2=A0sub=E2=80=90
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs returns=
an error.
>
This becomes:
btrfs subvolume delete <subvolume>
This works with snapshots as well.
>
> =C2=A0 =C2=A0 =C2=A0 subvolume|-c [<dest>/]<name>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create =C2=A0a =C2=A0=
subvolume =C2=A0in =C2=A0<dest> (or in the current directory if
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dest> is not passed)=
=2E
btrfs subvolume create [<dest>/]<name>
>
>
> =C2=A0 =C2=A0 =C2=A0 defrag|-f <file>|<dir> [<file>|<dir>...]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Defragment 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?
>
>
> =C2=A0 =C2=A0 =C2=A0 scan|-n [<device> [<device>..]]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Scan devices for a bt=
rfs filesystem. If no devices =C2=A0are =C2=A0passed,
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0btrfs scans all the b=
lock devices.
btrfs pool scan [<device> [<device>..]]
>
>
> =C2=A0 =C2=A0 =C2=A0 fssync|-y <path>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Force 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>
>
>
> =C2=A0 =C2=A0 =C2=A0 resize|-z [+/-]<size>[gkm]|max <filesystem>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Resize a file system =
identified by <path>. =C2=A0The <size> parameter
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specifies the new siz=
e of the filesystem. =C2=A0If the prefix + or =C2=A0-
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is =C2=A0present =C2=A0=
the =C2=A0size is increased or decreased by the quantity
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<size>. =C2=A0If no u=
nits are =C2=A0specified, =C2=A0the =C2=A0unit =C2=A0of =C2=A0the =C2=A0=
<size>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parameter =C2=A0is =C2=
=A0the =C2=A0byte. =C2=A0Optionally, the size parameter may be
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0suffixed by one of th=
e following =C2=A0the =C2=A0units =C2=A0designators: =C2=A0'K',
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'M', or 'G', kilobyte=
s, megabytes, or gigabytes, respectively.
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0If =C2=A0'max' =C2=A0=
is =C2=A0passed, =C2=A0the filesystem will occupy all available
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0space on the volume(s=
).
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The resize command do=
es not manipulate the =C2=A0size =C2=A0of =C2=A0underlying
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0partitions. =C2=A0 If=
=C2=A0you =C2=A0wish =C2=A0to enlarge/reduce a filesystem, you
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0must make sure you ca=
n expand/reduce the size of =C2=A0the =C2=A0partition
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0also.
>
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.
It becomes:
btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem>
Or:
btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]
>
> =C2=A0 =C2=A0 =C2=A0 show|-l [<dev>|<label>...]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Show =C2=A0the btrfs =
devices with some additional info. If no devices
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0or labels are passed,=
btrfs scans all the block devices.
This becomes:
btrfs pool show [<dev>|<label>...]
>
>
> =C2=A0 =C2=A0 =C2=A0 balance|-b <path>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Balance the chunk of =
the filesystem identified by <path> =C2=A0across
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the devices.
Is path to one of the block devices in the pool?
This becomes:
btrfs pool balance <path>
>
>
> =C2=A0 =C2=A0 =C2=A0 add-dev|-A =C2=A0<dev> [<dev>..] <path>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Add device(s) to the =
filesystem identified by <path>.
What is path? Somewhere the pool is mounted? The root of where the
pool is mounted?
this becomes:
btrfs pvolume add <dev> [<dev>..] <path>
>
>
> =C2=A0 =C2=A0 =C2=A0 rm-dev|-R =C2=A0<dev> [<dev>..] <path>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Remove device(s) to t=
he filesystem identified by <path>.
(same questions as with add)
This becomes:
btrfs pvolume remove <dev> [<dev>..] <path>
Mike
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-17 23:35 ` Mike Fedyk
@ 2010-02-18 9:45 ` Piavlo
2010-02-18 16:58 ` Chris Mason
1 sibling, 0 replies; 15+ messages in thread
From: Piavlo @ 2010-02-18 9:45 UTC (permalink / raw)
Cc: linux-btrfs
Hi,
I agree with Mike, it's just much much more pleasant and intuitive to
work with the hierarchyial cli he suggests.
Alex
=20
Mike Fedyk wrote:
> I think he need some command hierarchy here.
>
> On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli
> <kreijack@gmail.com> wrote:
> =20
>> 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 n=
ot a sub=E2=80=90
>> volume, btrfs returns an error.
>> =20
>
> This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
> It only works on subvolumes.
>
> =20
>> delete|-D <subvolume>
>> Delete the subvolume <subvolume>. If <subvolume> is not=
a sub=E2=80=90
>> volume, btrfs returns an error.
>>
>> =20
>
> This becomes:
>
> btrfs subvolume delete <subvolume>
>
> This works with snapshots as well.
>
> =20
>> subvolume|-c [<dest>/]<name>
>> Create a subvolume in <dest> (or in the current dir=
ectory if
>> <dest> is not passed).
>> =20
>
> btrfs subvolume create [<dest>/]<name>
>
> =20
>> defrag|-f <file>|<dir> [<file>|<dir>...]
>> 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
>> scan|-n [<device> [<device>..]]
>> Scan devices for a btrfs filesystem. If no devices are=
passed,
>> btrfs scans all the block devices.
>> =20
>
> btrfs pool scan [<device> [<device>..]]
>
> =20
>> fssync|-y <path>
>> Force a sync for the filesystem identified by <path>.
>>
>> =20
>
> Does it sync a pool or subvolume? Assuming it works against
> subvolumes, it would be:
>
> btrfs subvolume sync <path>
>
> =20
>> 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 prefi=
x + or -
>> is present the size is increased or decreased by the=
quantity
>> <size>. If no units are specified, the unit of th=
e <size>
>> parameter is the byte. Optionally, the size paramet=
er may be
>> suffixed by one of the following the units designato=
rs: 'K',
>> 'M', or 'G', kilobytes, megabytes, or gigabytes, respec=
tively.
>>
>> If 'max' is passed, the filesystem will occupy all =
available
>> space on the volume(s).
>>
>> The resize command does not manipulate the size of u=
nderlying
>> partitions. If you wish to enlarge/reduce a filesy=
stem, you
>> must make sure you can expand/reduce the size of the =
partition
>> also.
>>
>> =20
>
> 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 ma=
x
> without arguments, in order to do that, the size argument would need
> to be the last argument.
>
> It becomes:
>
> btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem>
>
> Or:
>
> btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]
>
> =20
>> show|-l [<dev>|<label>...]
>> Show the btrfs devices with some additional info. If n=
o devices
>> or labels are passed, btrfs scans all the block devices=
=2E
>> =20
>
> This becomes:
>
> btrfs pool show [<dev>|<label>...]
>
> =20
>> balance|-b <path>
>> Balance the chunk of the filesystem identified by <path=
> across
>> the devices.
>> =20
>
> Is path to one of the block devices in the pool?
>
> This becomes:
>
> btrfs pool balance <path>
>
> =20
>> add-dev|-A <dev> [<dev>..] <path>
>> Add device(s) to the filesystem identified by <path>.
>> =20
>
> What is path? Somewhere the pool is mounted? The root of where the
> pool is mounted?
>
> this becomes:
>
> btrfs pvolume add <dev> [<dev>..] <path>
>
> =20
>> rm-dev|-R <dev> [<dev>..] <path>
>> Remove device(s) to the filesystem identified by <path>=
=2E
>> =20
>
> (same questions as with add)
>
> This becomes:
>
> btrfs pvolume remove <dev> [<dev>..] <path>
>
> Mike
> --
> 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
> =20
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-17 23:35 ` Mike Fedyk
2010-02-18 9:45 ` Piavlo
@ 2010-02-18 16:58 ` Chris Mason
2010-02-18 17:58 ` Mike Fedyk
` (2 more replies)
1 sibling, 3 replies; 15+ messages in thread
From: Chris Mason @ 2010-02-18 16:58 UTC (permalink / raw)
To: Mike Fedyk
Cc: Goffredo Baroncelli, linux-btrfs, Thomas Kupper,
Dipl.-Ing. Michael Niederle, rk
I do like the subcommand method, more details below.
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
> <kreijack@gmail.com> wrote:
> > OPTIONS
> > =C2=A0 =C2=A0 =C2=A0 snapshot|-s <source> [<dest>/]<name>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create a writeble s=
napshot of the subvolume =C2=A0<source> =C2=A0with =C2=A0the
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name =C2=A0<name> =C2=
=A0in the <dest> directory. If <source> is not a sub=E2=80=90
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs retur=
ns an error.
>=20
> 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.
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 delete|-D <subvolume>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Delete the subvolum=
e <subvolume>. If <subvolume> is not =C2=A0a =C2=A0sub=E2=80=90
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs retur=
ns an error.
> >
>=20
> This becomes:
>=20
> btrfs subvolume delete <subvolume>
subvol del (same as above).
>=20
> This works with snapshots as well.
>=20
> >
> > =C2=A0 =C2=A0 =C2=A0 subvolume|-c [<dest>/]<name>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create =C2=A0a =C2=A0=
subvolume =C2=A0in =C2=A0<dest> (or in the current directory if
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dest> is not passe=
d).
>=20
> btrfs subvolume create [<dest>/]<name>
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 defrag|-f <file>|<dir> [<file>|<dir>...]
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Defragment files an=
d/or directories.
>=20
> This will defrag individual files? Does it defrag a directory tree?
> Does it defrag a subvolume? Does it defrag a pool?
=46or now lets change this to only do files. That's the only thing the
tool supports today.
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 scan|-n [<device> [<device>..]]
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Scan devices for a =
btrfs filesystem. If no devices =C2=A0are =C2=A0passed,
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0btrfs scans all the=
block devices.
>=20
> btrfs pool scan [<device> [<device>..]]
Instead of btrfs pool, please use btrfs dev
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 fssync|-y <path>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Force a sync for th=
e filesystem identified by <path>.
> >
>=20
> Does it sync a pool or subvolume? Assuming it works against
> subvolumes, it would be:
>=20
> btrfs subvolume sync <path>
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 resize|-z [+/-]<size>[gkm]|max <filesystem>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Resize a file syste=
m identified by <path>. =C2=A0The <size> parameter
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specifies the new s=
ize of the filesystem. =C2=A0If the prefix + or =C2=A0-
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is =C2=A0present =C2=
=A0the =C2=A0size is increased or decreased by the quantity
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<size>. =C2=A0If no=
units are =C2=A0specified, =C2=A0the =C2=A0unit =C2=A0of =C2=A0the =C2=
=A0<size>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parameter =C2=A0is =
=C2=A0the =C2=A0byte. =C2=A0Optionally, the size parameter may be
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0suffixed by one of =
the following =C2=A0the =C2=A0units =C2=A0designators: =C2=A0'K',
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'M', or 'G', kiloby=
tes, megabytes, or gigabytes, respectively.
> >
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0If =C2=A0'max' =C2=A0=
is =C2=A0passed, =C2=A0the filesystem will occupy all available
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0space on the volume=
(s).
> >
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The resize command =
does not manipulate the =C2=A0size =C2=A0of =C2=A0underlying
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0partitions. =C2=A0 =
If =C2=A0you =C2=A0wish =C2=A0to enlarge/reduce a filesystem, you
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0must make sure you =
can expand/reduce the size of =C2=A0the =C2=A0partition
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0also.
> >
>=20
> 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 ma=
x
> 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.
>=20
> It becomes:
>=20
> btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem>
>=20
> Or:
>=20
> btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]
btrfs dev resize
>=20
> >
> > =C2=A0 =C2=A0 =C2=A0 show|-l [<dev>|<label>...]
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Show =C2=A0the btrf=
s devices with some additional info. If no devices
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0or labels are passe=
d, btrfs scans all the block devices.
>=20
> This becomes:
>=20
> btrfs pool show [<dev>|<label>...]
btrfs dev show
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 balance|-b <path>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Balance the chunk o=
f the filesystem identified by <path> =C2=A0across
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the devices.
>=20
> Is path to one of the block devices in the pool?
>=20
> This becomes:
>=20
> btrfs pool balance <path>
btrfs dev balance
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 add-dev|-A =C2=A0<dev> [<dev>..] <path>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Add device(s) to th=
e filesystem identified by <path>.
>=20
> 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.
>=20
> this becomes:
>=20
> btrfs pvolume add <dev> [<dev>..] <path>
btrfs dev add=20
>=20
> >
> >
> > =C2=A0 =C2=A0 =C2=A0 rm-dev|-R =C2=A0<dev> [<dev>..] <path>
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Remove device(s) to=
the filesystem identified by <path>.
>=20
> (same questions as with add)
>=20
> This becomes:
>=20
> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 16:58 ` Chris Mason
@ 2010-02-18 17:58 ` Mike Fedyk
2010-02-18 18:20 ` Thomas Kupper
2010-02-18 19:59 ` Goffredo Baroncelli
2010-02-18 21:00 ` Goffredo Baroncelli
2 siblings, 1 reply; 15+ messages in thread
From: Mike Fedyk @ 2010-02-18 17:58 UTC (permalink / raw)
To: Chris Mason, Mike Fedyk, Goffredo Baroncelli, linux-btrfs,
Thomas Kupper,
On Thu, Feb 18, 2010 at 8:58 AM, Chris Mason <chris.mason@oracle.com> w=
rote:
> I do like the subcommand method, more details below.
>
> 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
>> <kreijack@gmail.com> wrote:
>> > OPTIONS
>> > =C2=A0 =C2=A0 =C2=A0 snapshot|-s <source> [<dest>/]<name>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create a writeble =
snapshot of the subvolume =C2=A0<source> =C2=A0with =C2=A0the
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name =C2=A0<name> =
=C2=A0in the <dest> directory. If <source> is not a sub=E2=80=90
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs retu=
rns 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. =C2=A0Basically=
the
> perl/python arg parsing system where any short form of the command th=
at
> uniquely matches it is allowed.
>
> We keep the long forms but allow the user to pick a shorter form if i=
t
> isn't ambiguous.
>
Yes, I agree. This is why I compared it with the ip command which
does the same.
>>
>> >
>> >
>> > =C2=A0 =C2=A0 =C2=A0 delete|-D <subvolume>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Delete the subvolu=
me <subvolume>. If <subvolume> is not =C2=A0a =C2=A0sub=E2=80=90
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0volume, btrfs retu=
rns an error.
>> >
>>
>> This becomes:
>>
>> btrfs subvolume delete <subvolume>
>
> subvol del (same as above).
>
>>
>> This works with snapshots as well.
>>
>> >
>> > =C2=A0 =C2=A0 =C2=A0 subvolume|-c [<dest>/]<name>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Create =C2=A0a =C2=
=A0subvolume =C2=A0in =C2=A0<dest> (or in the current directory if
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<dest> is not pass=
ed).
>>
>> btrfs subvolume create [<dest>/]<name>
>>
>> >
>> >
>> > =C2=A0 =C2=A0 =C2=A0 defrag|-f <file>|<dir> [<file>|<dir>...]
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Defragment files a=
nd/or directories.
>>
>> This will defrag individual files? =C2=A0Does it defrag a directory =
tree?
>> Does it defrag a subvolume? =C2=A0Does it defrag a pool?
>
> For now lets change this to only do files. =C2=A0That's the only thin=
g the
> tool supports today.
>
>>
>> >
>> >
>> > =C2=A0 =C2=A0 =C2=A0 scan|-n [<device> [<device>..]]
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Scan devices for a=
btrfs filesystem. If no devices =C2=A0are =C2=A0passed,
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0btrfs scans all th=
e block devices.
>>
>> btrfs pool scan [<device> [<device>..]]
>
> Instead of btrfs pool, please use btrfs dev
>
>>
>> >
>> >
>> > =C2=A0 =C2=A0 =C2=A0 fssync|-y <path>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Force a sync for t=
he filesystem identified by <path>.
>> >
>>
>> Does it sync a pool or subvolume? =C2=A0Assuming it works against
>> subvolumes, it would be:
>>
>> btrfs subvolume sync <path>
>>
>> >
>> >
>> > =C2=A0 =C2=A0 =C2=A0 resize|-z [+/-]<size>[gkm]|max <filesystem>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Resize a file syst=
em identified by <path>. =C2=A0The <size> parameter
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specifies the new =
size of the filesystem. =C2=A0If the prefix + or =C2=A0-
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is =C2=A0present =C2=
=A0the =C2=A0size is increased or decreased by the quantity
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<size>. =C2=A0If n=
o units are =C2=A0specified, =C2=A0the =C2=A0unit =C2=A0of =C2=A0the =C2=
=A0<size>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parameter =C2=A0is=
=C2=A0the =C2=A0byte. =C2=A0Optionally, the size parameter may be
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0suffixed by one of=
the following =C2=A0the =C2=A0units =C2=A0designators: =C2=A0'K',
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'M', or 'G', kilob=
ytes, megabytes, or gigabytes, respectively.
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0If =C2=A0'max' =C2=
=A0is =C2=A0passed, =C2=A0the filesystem will occupy all available
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0space on the volum=
e(s).
>> >
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The resize command=
does not manipulate the =C2=A0size =C2=A0of =C2=A0underlying
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0partitions. =C2=A0=
If =C2=A0you =C2=A0wish =C2=A0to enlarge/reduce a filesystem, you
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0must make sure you=
can expand/reduce the size of =C2=A0the =C2=A0partition
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0also.
>> >
>>
>> This works with physical devices, not a pool or subvolume. =C2=A0I g=
et the
>> name "physical volume" from lvm. =C2=A0Also 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
>
Dev works for me, I could only think of the lvm terms at the time.
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 17:58 ` Mike Fedyk
@ 2010-02-18 18:20 ` Thomas Kupper
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Kupper @ 2010-02-18 18:20 UTC (permalink / raw)
To: Mike Fedyk
Cc: Chris Mason, Goffredo Baroncelli, linux-btrfs,
Dipl.-Ing. Michael Niederle, rk
I'm happy that I'm not alone with my preference for subcommands :) over=
short -<one-letter> commands.
Btw: I think it would be a good idea start from the beginning with a 'l=
ibbtrfs' library and a corresponding API. That way integrating into oth=
er languages like Python and integration into tools like parted (or lib=
parted) would be quite easy.
On 18 Feb 2010, at 18:58, Mike Fedyk wrote:
> On Thu, Feb 18, 2010 at 8:58 AM, Chris Mason <chris.mason@oracle.com>=
wrote:
>> I do like the subcommand method, more details below.
>>=20
>> 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
>>> <kreijack@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=E2=80=90
>>>> volume, btrfs returns an error.
>>>=20
>>> This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
>>> 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 t=
hat
>> uniquely matches it is allowed.
>>=20
>> We keep the long forms but allow the user to pick a shorter form if =
it
>> isn't ambiguous.
>>=20
>=20
> Yes, I agree. This is why I compared it with the ip command which
> does the same.
>=20
>>>=20
>>>>=20
>>>>=20
>>>> delete|-D <subvolume>
>>>> Delete the subvolume <subvolume>. If <subvolume> is n=
ot a sub=E2=80=90
>>>> volume, btrfs returns an error.
>>>>=20
>>>=20
>>> This becomes:
>>>=20
>>> btrfs subvolume delete <subvolume>
>>=20
>> subvol del (same as above).
>>=20
>>>=20
>>> This works with snapshots as well.
>>>=20
>>>>=20
>>>> subvolume|-c [<dest>/]<name>
>>>> Create a subvolume in <dest> (or in the current d=
irectory if
>>>> <dest> is not passed).
>>>=20
>>> btrfs subvolume create [<dest>/]<name>
>>>=20
>>>>=20
>>>>=20
>>>> defrag|-f <file>|<dir> [<file>|<dir>...]
>>>> 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 th=
e
>> tool supports today.
>>=20
>>>=20
>>>>=20
>>>>=20
>>>> scan|-n [<device> [<device>..]]
>>>> Scan devices for a btrfs filesystem. If no devices a=
re passed,
>>>> btrfs scans all the block devices.
>>>=20
>>> btrfs pool scan [<device> [<device>..]]
>>=20
>> Instead of btrfs pool, please use btrfs dev
>>=20
>>>=20
>>>>=20
>>>>=20
>>>> fssync|-y <path>
>>>> Force a sync for the filesystem identified by <path>.
>>>>=20
>>>=20
>>> Does it sync a pool or subvolume? Assuming it works against
>>> subvolumes, it would be:
>>>=20
>>> btrfs subvolume sync <path>
>>>=20
>>>>=20
>>>>=20
>>>> 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 pre=
fix + or -
>>>> is present the size is increased or decreased by t=
he quantity
>>>> <size>. If no units are specified, the unit of =
the <size>
>>>> parameter is the byte. Optionally, the size param=
eter may be
>>>> suffixed by one of the following the units designa=
tors: 'K',
>>>> 'M', or 'G', kilobytes, megabytes, or gigabytes, resp=
ectively.
>>>>=20
>>>> If 'max' is passed, the filesystem will occupy al=
l available
>>>> space on the volume(s).
>>>>=20
>>>> The resize command does not manipulate the size of =
underlying
>>>> partitions. If you wish to enlarge/reduce a file=
system, you
>>>> must make sure you can expand/reduce the size of the=
partition
>>>> also.
>>>>=20
>>>=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 [+/-]<size>[gkm]|max <filesystem>
>>>=20
>>> Or:
>>>=20
>>> btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]
>>=20
>> btrfs dev resize
>>=20
>=20
> Dev works for me, I could only think of the lvm terms at the time.
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 16:58 ` Chris Mason
2010-02-18 17:58 ` Mike Fedyk
@ 2010-02-18 19:59 ` Goffredo Baroncelli
2010-02-18 20:46 ` Mike Fedyk
2010-02-18 21:00 ` Goffredo Baroncelli
2 siblings, 1 reply; 15+ messages in thread
From: Goffredo Baroncelli @ 2010-02-18 19:59 UTC (permalink / raw)
To: Chris Mason, Mike Fedyk, Goffredo Baroncelli, linux-btrfs
Cc: Thomas Kupper, Dipl.-Ing. Michael Niederle, rk
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/]<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.
> >=20
> > On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli
> > <kreijack@gmail.com> wrote:
> > > OPTIONS
> > > snapshot|-s <source> [<dest>/]<name>
> > > Create a writeble snapshot of the subvolume <source=
> with=20
the
> > > name <name> in the <dest> directory. If <source> i=
s not a=20
sub=E2=80=90
> > > volume, btrfs returns an error.
> >=20
> > This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
> > 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 <subvolume>
> > > Delete the subvolume <subvolume>. If <subvolume> is =
not a=20
sub=E2=80=90
> > > volume, btrfs returns an error.
> > >
> >=20
> > This becomes:
> >=20
> > btrfs subvolume delete <subvolume>
>=20
> subvol del (same as above).
>=20
> >=20
> > This works with snapshots as well.
> >=20
> > >
> > > subvolume|-c [<dest>/]<name>
> > > Create a subvolume in <dest> (or in the current=20
directory if
> > > <dest> is not passed).
> >=20
> > btrfs subvolume create [<dest>/]<name>
> >=20
> > >
> > >
> > > defrag|-f <file>|<dir> [<file>|<dir>...]
> > > 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 [<device> [<device>..]]
> > > Scan devices for a btrfs filesystem. If no devices =
are=20
passed,
> > > btrfs scans all the block devices.
> >=20
> > btrfs pool scan [<device> [<device>..]]
>=20
> Instead of btrfs pool, please use btrfs dev
>=20
> >=20
> > >
> > >
> > > fssync|-y <path>
> > > Force a sync for the filesystem identified by <path>=
=2E
> > >
> >=20
> > Does it sync a pool or subvolume? Assuming it works against
> > subvolumes, it would be:
> >=20
> > btrfs subvolume sync <path>
> >=20
> > >
> > >
> > > resize|-z [+/-]<size>[gkm]|max <filesystem>
> > > Resize a file system identified by <path>. The <siz=
e>=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
> > > <size>. If no units are specified, the unit of =
the=20
<size>
> > > 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 [+/-]<size>[gkm]|max <filesystem>
> >=20
> > Or:
> >=20
> > btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]]
>=20
> btrfs dev resize
>=20
> >=20
> > >
> > > show|-l [<dev>|<label>...]
> > > Show the btrfs devices with some additional info. I=
f no=20
devices
> > > or labels are passed, btrfs scans all the block devi=
ces.
> >=20
> > This becomes:
> >=20
> > btrfs pool show [<dev>|<label>...]
>=20
> btrfs dev show
>=20
> >=20
> > >
> > >
> > > balance|-b <path>
> > > Balance the chunk of the filesystem identified by <p=
ath>=20
across
> > > the devices.
> >=20
> > Is path to one of the block devices in the pool?
> >=20
> > This becomes:
> >=20
> > btrfs pool balance <path>
>=20
> btrfs dev balance
>=20
> >=20
> > >
> > >
> > > add-dev|-A <dev> [<dev>..] <path>
> > > Add device(s) to the filesystem identified by <path>=
=2E
> >=20
> > What is path? Somewhere the pool is mounted? The root of where th=
e
> > pool is mounted?
>=20
> The path just tells us which filesystem to work against. It can real=
ly
> be any path inside the mount point.
>=20
> >=20
> > this becomes:
> >=20
> > btrfs pvolume add <dev> [<dev>..] <path>
>=20
> btrfs dev add=20
> >=20
> > >
> > >
> > > rm-dev|-R <dev> [<dev>..] <path>
> > > Remove device(s) to the filesystem identified by <pa=
th>.
> >=20
> > (same questions as with add)
> >=20
> > This becomes:
> >=20
> > btrfs pvolume remove <dev> [<dev>..] <path>
>=20
> btrfs dev remove
>=20
> -chris
>=20
> --
> 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
>=20
--=20
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinw=
ind.it>
Key fingerprint =3D 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 19:59 ` Goffredo Baroncelli
@ 2010-02-18 20:46 ` Mike Fedyk
2010-02-18 20:58 ` Chris Mason
2010-02-18 21:25 ` Tomasz Torcz
0 siblings, 2 replies; 15+ messages in thread
From: Mike Fedyk @ 2010-02-18 20:46 UTC (permalink / raw)
To: Goffredo Baroncelli
Cc: Chris Mason, linux-btrfs, Thomas Kupper, Dipl.-Ing. Michael Niederle, rk
On Thu, Feb 18, 2010 at 11:59 AM, Goffredo Baroncelli
<kreijack@gmail.com> wrote:
> 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 =C2=A0 =C2=A0 =C2=A0 =C2=A0 scan
> devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 show
> devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 balance
> devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 add
> devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 remove
>
> subvolume =C2=A0 =C2=A0 =C2=A0 snapshot
> subvolume =C2=A0 =C2=A0 =C2=A0 delete
> subvolume =C2=A0 =C2=A0 =C2=A0 create
> [subvolume =C2=A0 =C2=A0 =C2=A0list]
>
> filesystem =C2=A0 =C2=A0 =C2=A0resize
> [filesystem =C2=A0 =C2=A0 label]
>
> ??? =C2=A0 =C2=A0 defrag
> ??? =C2=A0 =C2=A0 sync
>
>
>
> For the first two categories both Chris and Mike agreed; but IMHO the=
re are
> some commands that don't fit nor in devices, nor subvolume, like resi=
ze (we
> resize a filesystem) and label (not available now).
>
A btrfs filesystem can span multiple devices. Resize resizes how big
of a chunk of one device btrfs uses. This would be used by
partitioning programs for instance. zfs uses the term "pool" instead
of filesystem to solve this ambiguous use of the term "filesystem"
since btrfs and zfs break people's existing definition of the word
"filesystem".
> I don't know how classify defrag (per file / directory level ?) and s=
ync
> (filesystem ?)
It turns out that defrag is per file, which seems most cumbersome.
Maybe since it will probably eventually work against several types of
objects we could have:
btrfs defrag file <file>
btrfs defrag directory <directory>
btrfs defrag subvol <subvol>
btrfs defrag pool <pool>
>
> An option is to consider commands without classification. For example=
s:
>
> $ btrfs subvolume create [path/]<subvolname>
> $ btrfs sync <path>
> $ btrfs defrag <file>
Maybe if the btrfs developers are agreeable, we could do this as well:
btrfs sync file <file>
btrfs sync directory <directory>
btrfs sync subvol <subvol>
btrfs sync pool <pool>
I'm not sure how useful syncing the pool or a directory tree would be,
but I'll include it here for further discussion.
Mike
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 20:46 ` Mike Fedyk
@ 2010-02-18 20:58 ` Chris Mason
2010-02-18 21:04 ` Goffredo Baroncelli
2010-02-18 21:39 ` Mike Fedyk
2010-02-18 21:25 ` Tomasz Torcz
1 sibling, 2 replies; 15+ messages in thread
From: Chris Mason @ 2010-02-18 20:58 UTC (permalink / raw)
To: Mike Fedyk
Cc: Goffredo Baroncelli, linux-btrfs, Thomas Kupper,
Dipl.-Ing. Michael Niederle, rk
On Thu, Feb 18, 2010 at 12:46:56PM -0800, Mike Fedyk wrote:
> On Thu, Feb 18, 2010 at 11:59 AM, Goffredo Baroncelli
> <kreijack@gmail.com> wrote:
> > 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 t=
o clear for
> > me.
> > I grouped the commands in three categories: subvolume, devices, and
> > filesystem.
> >
> >
> > devices =A0 =A0 =A0 =A0 scan
> > devices =A0 =A0 =A0 =A0 show
> > devices =A0 =A0 =A0 =A0 balance
> > devices =A0 =A0 =A0 =A0 add
> > devices =A0 =A0 =A0 =A0 remove
> >
> > subvolume =A0 =A0 =A0 snapshot
> > subvolume =A0 =A0 =A0 delete
> > subvolume =A0 =A0 =A0 create
> > [subvolume =A0 =A0 =A0list]
> >
> > filesystem =A0 =A0 =A0resize
> > [filesystem =A0 =A0 label]
> >
> > ??? =A0 =A0 defrag
> > ??? =A0 =A0 sync
> >
> >
> >
> > For the first two categories both Chris and Mike agreed; but IMHO t=
here are
> > some commands that don't fit nor in devices, nor subvolume, like re=
size (we
> > resize a filesystem) and label (not available now).
> >
>=20
> A btrfs filesystem can span multiple devices. Resize resizes how big
> of a chunk of one device btrfs uses.
Right, resize is actually always per device. When there is one device
resizing the FS and the device are the same thing.
> This would be used by
> partitioning programs for instance. zfs uses the term "pool" instead
> of filesystem to solve this ambiguous use of the term "filesystem"
> since btrfs and zfs break people's existing definition of the word
> "filesystem".
>=20
> > I don't know how classify defrag (per file / directory level ?) and=
sync
> > (filesystem ?)
>=20
> It turns out that defrag is per file, which seems most cumbersome.
> Maybe since it will probably eventually work against several types of
> objects we could have:
>=20
> btrfs defrag file <file>
> btrfs defrag directory <directory>
> btrfs defrag subvol <subvol>
I like these, although we don't currently support the directory/subvol
side. But we can leave the option open to add these later.
> btrfs defrag pool <pool>
I don't think we'll need defrag pool.
>=20
> >
> > An option is to consider commands without classification. For examp=
les:
> >
> > $ btrfs subvolume create [path/]<subvolname>
> > $ btrfs sync <path>
> > $ btrfs defrag <file>
>=20
> Maybe if the btrfs developers are agreeable, we could do this as well=
:
>=20
> btrfs sync file <file>
> btrfs sync directory <directory>
fsync on files and dirs already does this, we don't need a btrfsctl for
it.
> btrfs sync subvol <subvol>
btrfs sync subvol is nice.
> btrfs sync pool <pool>
>=20
I don't think we need sync pool.
-chris
--
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] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 16:58 ` Chris Mason
2010-02-18 17:58 ` Mike Fedyk
2010-02-18 19:59 ` Goffredo Baroncelli
@ 2010-02-18 21:00 ` Goffredo Baroncelli
2 siblings, 0 replies; 15+ messages in thread
From: Goffredo Baroncelli @ 2010-02-18 21:00 UTC (permalink / raw)
To: Chris Mason, linux-btrfs
On Thursday 18 February 2010, Chris Mason wrote:
> I do like the subcommand method, more details below.
>=20
> 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
> > <kreijack@gmail.com> wrote:
> > > OPTIONS
> > > snapshot|-s <source> [<dest>/]<name>
> > > Create a writeble snapshot of the subvolume <source=
> with=20
the
> > > name <name> in the <dest> directory. If <source> i=
s not a=20
sub=E2=80=90
> > > volume, btrfs returns an error.
> >=20
> > This should be "btrfs subvolume snapshot <source> [<dest>/]<name>".
> > 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.
So for you
$ btrfs s s <source> <dest>
is OK ?
('btrfs s s' means btrfs subvolume snapshot)
> We keep the long forms but allow the user to pick a shorter form if i=
t
> isn't ambiguous.
--=20
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwi=
nd.it>
Key fingerprint =3D 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 20:58 ` Chris Mason
@ 2010-02-18 21:04 ` Goffredo Baroncelli
2010-02-18 21:39 ` Mike Fedyk
1 sibling, 0 replies; 15+ messages in thread
From: Goffredo Baroncelli @ 2010-02-18 21:04 UTC (permalink / raw)
To: Chris Mason, Mike Fedyk, linux-btrfs, Thomas Kupper,
Dipl.-Ing. Michael Niederle
On Thursday 18 February 2010, Chris Mason wrote:
> On Thu, Feb 18, 2010 at 12:46:56PM -0800, Mike Fedyk wrote:
> > On Thu, Feb 18, 2010 at 11:59 AM, Goffredo Baroncelli
> > <kreijack@gmail.com> wrote:
> > > 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).
> > >
> >
> > A btrfs filesystem can span multiple devices. Resize resizes how big
> > of a chunk of one device btrfs uses.
>
> Right, resize is actually always per device. When there is one device
> resizing the FS and the device are the same thing.
>
> > This would be used by
> > partitioning programs for instance. zfs uses the term "pool" instead
> > of filesystem to solve this ambiguous use of the term "filesystem"
> > since btrfs and zfs break people's existing definition of the word
> > "filesystem".
> >
> > > I don't know how classify defrag (per file / directory level ?) and sync
> > > (filesystem ?)
> >
> > It turns out that defrag is per file, which seems most cumbersome.
> > Maybe since it will probably eventually work against several types of
> > objects we could have:
> >
> > btrfs defrag file <file>
> > btrfs defrag directory <directory>
> > btrfs defrag subvol <subvol>
>
> I like these, although we don't currently support the directory/subvol
> side. But we can leave the option open to add these later.
Sorry, but why:
$ btrfs defrag subvol
and not
$ btrfs subvol defrag
What do you want:
$ btrfs <object> <action>
or
$ btrfs <action> <object>
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 20:46 ` Mike Fedyk
2010-02-18 20:58 ` Chris Mason
@ 2010-02-18 21:25 ` Tomasz Torcz
1 sibling, 0 replies; 15+ messages in thread
From: Tomasz Torcz @ 2010-02-18 21:25 UTC (permalink / raw)
To: linux-btrfs
On Thu, Feb 18, 2010 at 12:46:56PM -0800, Mike Fedyk wrote:
> btrfs defrag file <file>
> btrfs defrag directory <directory>
> btrfs defrag subvol <subvol>
> btrfs defrag pool <pool>
I think this could be implied by <target>, so it will be better to drop
3rd word:
btrfs defrag /this/file
btrfs defrag /mnt/btrfs/somedir/
btrfs defrag /dev/sda2 # for pool
btrfs defrag LABEL="lnx-test" # for pool; libblkid integration is nice :)
--
Tomasz Torcz "God, root, what's the difference?"
xmpp: zdzichubg@chrome.pl "God is more forgiving."
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem
2010-02-18 20:58 ` Chris Mason
2010-02-18 21:04 ` Goffredo Baroncelli
@ 2010-02-18 21:39 ` Mike Fedyk
1 sibling, 0 replies; 15+ messages in thread
From: Mike Fedyk @ 2010-02-18 21:39 UTC (permalink / raw)
To: Chris Mason, Mike Fedyk, Goffredo Baroncelli, linux-btrfs,
Thomas Kupper,
On Thu, Feb 18, 2010 at 12:58 PM, Chris Mason <chris.mason@oracle.com> =
wrote:
> On Thu, Feb 18, 2010 at 12:46:56PM -0800, Mike Fedyk wrote:
>> On Thu, Feb 18, 2010 at 11:59 AM, Goffredo Baroncelli
>> <kreijack@gmail.com> wrote:
>> > 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, an=
d
>> > filesystem.
>> >
>> >
>> > devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 scan
>> > devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 show
>> > devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 balance
>> > devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 add
>> > devices =C2=A0 =C2=A0 =C2=A0 =C2=A0 remove
>> >
>> > subvolume =C2=A0 =C2=A0 =C2=A0 snapshot
>> > subvolume =C2=A0 =C2=A0 =C2=A0 delete
>> > subvolume =C2=A0 =C2=A0 =C2=A0 create
>> > [subvolume =C2=A0 =C2=A0 =C2=A0list]
>> >
>> > filesystem =C2=A0 =C2=A0 =C2=A0resize
>> > [filesystem =C2=A0 =C2=A0 label]
>> >
>> > ??? =C2=A0 =C2=A0 defrag
>> > ??? =C2=A0 =C2=A0 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 r=
esize (we
>> > resize a filesystem) and label (not available now).
>> >
>>
>> A btrfs filesystem can span multiple devices. =C2=A0Resize resizes h=
ow big
>> of a chunk of one device btrfs uses.
>
> Right, resize is actually always per device. =C2=A0When there is one =
device
> resizing the FS and the device are the same thing.
>
>> This would be used by
>> partitioning programs for instance. =C2=A0zfs uses the term "pool" i=
nstead
>> of filesystem to solve this ambiguous use of the term "filesystem"
>> since btrfs and zfs break people's existing definition of the word
>> "filesystem".
>>
>> > I don't know how classify defrag (per file / directory level ?) an=
d sync
>> > (filesystem ?)
>>
>> It turns out that defrag is per file, which seems most cumbersome.
>> Maybe since it will probably eventually work against several types o=
f
>> objects we could have:
>>
>> btrfs defrag file <file>
>> btrfs defrag directory <directory>
>> btrfs defrag subvol <subvol>
>
> I like these, although we don't currently support the directory/subvo=
l
> side. =C2=A0But we can leave the option open to add these later.
>
>> btrfs defrag pool <pool>
>
> I don't think we'll need defrag pool.
>
>>
>> >
>> > An option is to consider commands without classification. For exam=
ples:
>> >
>> > $ btrfs subvolume create [path/]<subvolname>
>> > $ btrfs sync <path>
>> > $ btrfs defrag <file>
>>
>> Maybe if the btrfs developers are agreeable, we could do this as wel=
l:
>>
>> btrfs sync file <file>
>> btrfs sync directory <directory>
>
> fsync on files and dirs already does this, we don't need a btrfsctl f=
or
> it.
>
How do you fsync a file/dir from a shell script? Maybe that's a
generic tool that needs to be created...
>> btrfs sync subvol <subvol>
>
> btrfs sync subvol is nice.
>
>> btrfs sync pool <pool>
>>
>
> I don't think we need sync pool.
>
I honestly can't think of a use for it, but I'll bet it'll come in
handy for some weird case while running on top of iscsi or some such
topology.
--
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] 15+ messages in thread
end of thread, other threads:[~2010-02-18 21:39 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 20:02 [PATCH 0/2 V2] btrfs: a new tool to manage a btrfs filesystem Goffredo Baroncelli
2010-02-17 20:48 ` Andreas Philipp
2010-02-17 21:00 ` Goffredo Baroncelli
2010-02-17 23:35 ` Mike Fedyk
2010-02-18 9:45 ` Piavlo
2010-02-18 16:58 ` Chris Mason
2010-02-18 17:58 ` Mike Fedyk
2010-02-18 18:20 ` Thomas Kupper
2010-02-18 19:59 ` Goffredo Baroncelli
2010-02-18 20:46 ` Mike Fedyk
2010-02-18 20:58 ` Chris Mason
2010-02-18 21:04 ` Goffredo Baroncelli
2010-02-18 21:39 ` Mike Fedyk
2010-02-18 21:25 ` Tomasz Torcz
2010-02-18 21:00 ` Goffredo Baroncelli
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.