├── LICENSE
├── README.md
├── about.cgi
├── acl_security.pl
├── cmd.cgi
├── config
├── config-vdev.cgi
├── config.info
├── create.cgi
├── defaultacl
├── diff.cgi
├── index.cgi
├── lang
└── en
├── module.info
├── property-list-en.pl
├── property.cgi
├── select.cgi
├── status.cgi
└── zfsmanager-lib.pl
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014, Marc Jones
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the developer nor the
12 | names of its contributors may be used to endorse or promote products
13 | derived from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ZFS Manager
2 | ==========
3 |
4 | ZFS administration tool for Webmin
5 |
6 | This is in early development, not for production. That being said, try this out in a virtual machine or anywhere else where data is non-critical. My hope is that this will ultimately provide Webmin with similar ZFS functionality to FreeNAS and NAS4Free.
7 |
8 | This project lives at https://github.com/jonmatifa/zfsmanager provide all feedback and bug reports there. I am brand new to Perl and Webmin's API. so first I apologize for the shabby state the code is in, second any further contributions are greatly welcomed. I am learning a fair amount about ZFS along the way as well.
9 |
10 | I am currently developing this under ZFS on Linux in Ubuntu, but all varients of ZFS/Webmin are planned to be supported in the future.
11 |
12 | **Installation**
13 |
14 | You can either use a *.wbm.gz from the releases tab, or "# git clone https://github.com/jonmatifa/zfsmanager.git" from the webmin root directory (Centos/REHL: /usr/libexec/webmin, Debian/Ubuntu: /usr/share/webmin), this will clone everything into the zfsmanager subfolder (which will be created). Then copy the "config" file to /etc/webmin/zfsmanager once that is done, you can then keep up to date with by "# git pull" from the webmin/zfsmanager directory.
15 |
16 | **Feedback**
17 |
18 | I am interested in what you think, even during this early alpha phase. The issue tracker can be used not only for bug reports but also feature requests and comments in general. Tracking and fixing bugs is important, but I also want to know what you think about the idea of the project and things like usability and UI design.
19 |
20 | **Contribution**
21 |
22 | Right now its just me developing this. I'm not a programmer by trade, but I'm happy to work on this project whenever I can. I would love help from someone more seasoned at perl (don't judge me too hard), but also someone who "gets" the design philosophy of this project and understands the Webmin API. I'm a beginner myself so I'm not looking for too much.
23 |
24 | **Thank you**
25 |
26 | Thank you for stopping by and I hope you enjoy this plugin!
27 |
--------------------------------------------------------------------------------
/about.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 |
6 | #show pool status
7 | ui_print_header(undef, $text{'about_title'}, "", undef, 1, 1);
8 |
9 | print ui_table_start("ZFS Manager info", "width=100%", undef);
10 | print "ZFS manager is in early development but relatively stable. Please understand the risks and have backups for important data. Updates, feedback, bug reports and more information can be found through the github link below.
";
11 | print ui_table_row("GitHub:", "https://github.com/jonmatifa/zfsmanager");
12 | print ui_table_row("Blog:", "https://zfsmanager.wordpress.com/");
13 | print ui_table_end();
14 |
15 | print ui_table_start("ZFS general info", "width=100%", undef);
16 | print ui_table_row("OpenZFS Main Page", "http://www.open-zfs.org/wiki/Main_Page");
17 | print ui_table_row("FreeBSD wiki on ZFS", "https://wiki.freebsd.org/ZFS");
18 | print ui_table_row("ZFS on Linux:", "http://zfsonlinux.org/");
19 | print ui_table_end();
20 |
21 |
22 | ui_print_footer('', $text{'index_return'});
23 |
--------------------------------------------------------------------------------
/acl_security.pl:
--------------------------------------------------------------------------------
1 |
2 | require 'zfsmanager-lib.pl';
3 |
4 | # acl_security_form(&options)
5 | sub acl_security_form
6 | {
7 | my ($access)=@_;
8 |
9 | print ui_table_row("Desctructive pool features",
10 | ui_yesno_radio("upool_destroy", $access->{'upool_destroy'}));
11 | print ui_table_row("Desctructive file system features",
12 | ui_yesno_radio("uzfs_destroy", $access->{'uzfs_destroy'}));
13 | print ui_table_row("Desctructive snapshot features",
14 | ui_yesno_radio("usnap_destroy", $access->{'usnap_destroy'}));
15 | print ui_table_row("Pool property administration",
16 | ui_yesno_radio("upool_properties", $access->{'upool_properties'}));
17 | print ui_table_row("File system property administration",
18 | ui_yesno_radio("uzfs_properties", $access->{'uzfs_properties'}));
19 |
20 | }
21 |
22 | sub acl_security_save
23 | {
24 | my ($access, $in) = @_;
25 | $access->{'upool_destroy'} = $in->{'upool_destroy'};
26 | $access->{'uzfs_destroy'} = $in->{'uzfs_destroy'};
27 | $access->{'usnap_destroy'} = $in->{'usnap_destroy'};
28 | $access->{'upool_properties'} = $in->{'upool_properties'};
29 | $access->{'uzfs_properties'} = $in->{'uzfs_properties'};
30 | }
31 |
--------------------------------------------------------------------------------
/cmd.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 | use Data::Dumper;
6 | ui_print_header(undef, $text{'cmd_title'}, "", undef, 1, 1);
7 |
8 | if ($text{$in{'cmd'}."_desc"}) {
9 | print ui_table_start($text{$in{'cmd'}."_cmd"}, "width=100%", "10", ['align=left'] );
10 | print ui_table_row($text{'cmd_dscpt'}, $text{$in{'cmd'}."_desc"});
11 | print ui_table_end();
12 | };
13 |
14 | print ui_table_start($text{'cmd_title'}, "width=100%", "10", ['align=left'] );
15 |
16 | if ($in{'cmd'} =~ "setzfs") {
17 | $in{'confirm'} = "yes";
18 | if (($in{'set'} =~ "inherit") && ($config{'zfs_properties'} =~ /1/)) { $cmd = "zfs inherit $in{'property'} $in{'zfs'}";
19 | } elsif ($config{'zfs_properties'} =~ /1/) { $cmd = "zfs set $in{'property'}=$in{'set'} $in{'zfs'}"; }
20 | ui_cmd("$in{'property'} to $in{'set'} on $in{'zfs'}", $cmd);
21 | }
22 | elsif ($in{'cmd'} =~ "setpool") {
23 | $in{'confirm'} = "yes";
24 | if ($in{'property'} =~ 'comment') { $in{'set'} = '"'.$in{'set'}.'"'; }
25 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool set $in{'property'}=$in{'set'} $in{'pool'}": undef;
26 | ui_cmd("$in{'property'} to $in{'set'} in $in{'pool'}", $cmd);
27 | }
28 | elsif ($in{'cmd'} =~ "snapshot") {
29 | my $cmd = ($config{'snap_properties'} =~ /1/) ? "zfs snapshot ".$in{'zfs'}."@".$in{'snap'} : undef;
30 | $in{'confirm'} = "yes";
31 | ui_cmd($in{'snap'}, $cmd);
32 | print "", (!$result[1]) ? ui_list_snapshots($in{'zfs'}."@".$in{'snap'}) : undef;
33 | }
34 | elsif ($in{'cmd'} =~ "send") {
35 | if (!$in{'dest'}) {
36 | print $text{'cmd_send'}." ".$in{'snap'}." ".$text{'cmd_gzip'}."
";
37 | print "
";
38 | print ui_form_start('cmd.cgi', 'post');
39 | print ui_hidden('cmd', $in{'cmd'});
40 | print ui_hidden('snap', $in{'snap'});
41 | my $newfile = $in{'snap'} =~ s![/@]!_!gr;
42 | print "$text{'destination'} ".ui_filebox('dest', $config{'last_send'}, 35, undef, undef, undef, 1)."
";
43 | print "$text{'filename'} ".ui_textbox('file', $newfile.'.gz', 50)."
";
44 | print ui_submit($text{'continue'}, undef, undef);
45 | print ui_form_end();
46 | } else {
47 | $in{'confirm'} = "yes";
48 | my $cmd = ($config{'snap_properties'} =~ /1/) ? "zfs send ".$in{'snap'}." | gzip > ".$in{'dest'}."/".$in{'file'} : undef;
49 | ui_cmd($in{'snap'}, $cmd);
50 | $config{'last_send'} = $in{'dest'};
51 | save_module_config();
52 | print `ls -al $in{'dest'}'."/".$in{'file'}`;
53 | }
54 | }
55 | elsif ($in{'cmd'} =~ "createzfs") {
56 | my %createopts = create_opts();
57 | my %options = ();
58 | foreach $key (sort (keys %createopts)) {
59 | $options{$key} = ($in{$key}) ? $in{$key} : undef;
60 | }
61 | if ($in{'mountpoint'}) { $options{'mountpoint'} = $in{'mountpoint'}; }
62 | if ($in{'zvol'} == '1') {
63 | $options{'zvol'} = $in{'size'};
64 | $options{'sparse'} = $in{'sparse'};
65 | $options{'volblocksize'} = $in{'volblocksize'};
66 | }
67 | my $cmd = (($in{'parent'}) && ($config{'zfs_properties'} =~ /1/)) ? cmd_create_zfs($in{'parent'}."/".$in{'zfs'}, \%options) : undef;
68 | $in{'confirm'} = "yes";
69 | ui_cmd("$in{'parent'}/$in{'zfs'}", $cmd);
70 | #print "", (!$result[1]) ? ui_zfs_list($in{'zfs'}) : undef;
71 | #^^^this doesn't work for some reason
72 | @footer = ("status.cgi?zfs=".$in{'parent'}."/".$in{'zfs'}, $in{'parent'}."/".$in{'zfs'});
73 | }
74 | elsif ($in{'cmd'} =~ "clone") {
75 | my %createopts = create_opts();
76 | $opts = ();
77 | foreach $key (sort (keys %createopts))
78 | {
79 | if ($in{$key})
80 | {
81 | $opts = ($in{$key} =~ 'default') ? $opts : $opts.' -o '.$key.'='.$in{$key};
82 | }
83 | }
84 | if ($in{'mountpoint'}) { $opts .= ' -o mountpoint='.$in{'mountpoint'}; }
85 | $in{'confirm'} = "yes";
86 | my $cmd = ($config{'zfs_properties'} =~ /1/) ? "zfs clone ".$in{'clone'}." ".$in{'parent'}.'/'.$in{'zfs'}." ".$opts : undef;
87 | ui_cmd($in{'clone'}, $cmd);
88 | @footer = ("status.cgi?snap=".$in{'clone'}, $in{'clone'})
89 | }
90 | elsif ($in{'cmd'} =~ "rename") {
91 | if (index($in{'zfs'}, '@') != -1) {
92 | $cmd = ($config{'snap_properties'} =~ /1/) ? "zfs rename ".$in{'force'}.$in{'recurse'}.$in{'zfs'}." ".$in{'parent'}.'@'.$in{'name'} : undef;
93 | @footer = ('status.cgi?snap='.$in{'parent'}.'@'.$in{'name'}, $in{'parent'}.'@'.$in{'name'});
94 | } elsif (index($in{'zfs'}, '/') != -1) {
95 | $cmd = ($config{'zfs_properties'} =~ /1/) ? "zfs rename ".$in{'force'}.$in{'prnt'}.$in{'zfs'}." ".$in{'parent'}.'/'.$in{'name'} : undef;
96 | if ($in{'confirm'}) { @footer = ('status.cgi?zfs='.$in{'parent'}.'/'.$in{'name'}, $in{'parent'}.'/'.$in{'name'}); }
97 | }
98 | ui_cmd($in{'zfs'}." to ".$in{'name'}, $cmd);
99 | }
100 | elsif ($in{'cmd'} =~ "createzpool") {
101 | my %createopts = create_opts();
102 | my %options = ();
103 | $in{'volblocksize'} = "default";
104 | $in{'sparse'} = "default";
105 | foreach $key (sort (keys %createopts)) {
106 | $options{$key} = ($in{$key}) ? $in{$key} : undef;
107 | }
108 | if ($in{'mountpoint'}) { $options{'mountpoint'} = $in{'mountpoint'}; }
109 | if ($in{'vdev'} =~ 'stripe') { delete $in{'vdev'}; } else{ $in{'vdev'} .= " "; }
110 | $in{'devs'} =~ s/\R/ /g;
111 | %poolopts = ( 'version' => $in{'version'} );
112 | my $cmd = (($config{'pool_properties'} =~ /1/)) ? cmd_create_zpool($in{'pool'}, $in{'vdev'}.$in{'devs'}, \%options, \%poolopts, $in{'force'}) : undef;
113 | $in{'confirm'} = "yes";
114 | ui_cmd($in{'pool'}, $cmd);
115 | #print "", (!$result[1]) ? ui_zfs_list($in{'zfs'}) : undef;
116 | #^^^this doesn't work for some reason
117 | }
118 | elsif ($in{'cmd'} =~ "vdev") {
119 | $in{'confirm'} = "yes";
120 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool $in{'action'} $in{'pool'} $in{'vdev'}": undef;
121 | ui_cmd("$in{'action'} $in{'vdev'}", $cmd);
122 | }
123 | elsif ($in{'cmd'} =~ "promote") {
124 | my $cmd = ($config{'zfs_properties'} =~ /1/) ? "zfs promote $in{'zfs'}": undef;
125 | ui_cmd($in{'zfs'}, $cmd);
126 | }
127 | elsif ($in{'cmd'} =~ "scrub") {
128 | $in{'confirm'} = "yes";
129 | if ($in{'stop'}) { $in{'stop'} = "-s"; }
130 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool scrub $in{'stop'} $in{'pool'}" : undef;
131 | ui_cmd($in{'pool'}, $cmd);
132 | }
133 | elsif ($in{'cmd'} =~ "upgrade") {
134 | print "
".$text{'zpool_upgrade_msg'}."
";
135 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool upgrade $in{'pool'}" : undef;
136 | ui_cmd($in{'pool'}, $cmd);
137 | }
138 | elsif ($in{'cmd'} =~ "export") {
139 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool export $in{'pool'}" : undef;
140 | ui_cmd($in{'pool'}, $cmd);
141 | @footer = ("index.cgi?mode=pools", $text{'index_return'});
142 | }
143 | elsif ($in{'cmd'} =~ "import") {
144 | my $dir = ();
145 | if ($in{'dir'}) { $dir .= " -d ".$in{'dir'}; }
146 | if ($in{'destroyed'}) { $dir .= " -D -f "; }
147 | my $cmd = ($config{'pool_properties'} =~ /1/ ) ? "zpool import".$dir." ".$in{'import'}: undef;
148 | ui_cmd($in{'import'}, $cmd);
149 | @footer = ("index.cgi?mode=pools", $text{'index_return'});
150 | }
151 | elsif ($in{'cmd'} =~ "zfsact") {
152 | my $cmd = ($config{'zfs_properties'} =~ /1/) ? "zfs $in{'action'} $in{'zfs'}" : undef;
153 | ui_cmd("$in{'action'} $in{'zfs'}", $cmd);
154 | }
155 | elsif ($in{'cmd'} =~ "zfsdestroy") {
156 | my $cmd = ($config{'zfs_destroy'} =~ /1/) ? "zfs destroy $in{'force'} $in{'zfs'}" : undef;
157 | if (!$in{'confirm'})
158 | {
159 | print $text{'cmd_destroy'}." $in{'zfs'}...
";
160 | print "
";
161 | print ui_form_start('cmd.cgi', 'post');
162 | print ui_hidden('cmd', $in{'cmd'});
163 | print ui_hidden('zfs', $in{'zfs'});
164 | print "$text{'cmd_affect'}
";
165 | ui_zfs_list('-r '.$in{'zfs'});
166 | ui_list_snapshots('-r '.$in{'zfs'});
167 | if (($config{'zfs_destroy'} =~ /1/) && ($config{'snap_destroy'} =~ /1/)) { print ui_checkbox('force', '-r', 'Click to destroy all child dependencies (recursive)', undef ), "
"; }
168 | print "$text{'cmd_warning'}
";
169 | print ui_checkbox('confirm', 'yes', $text{'cmd_understand'}, undef );
170 | print ui_hidden('checked', 'no');
171 | if ($in{'checked'} =~ /no/) { print " -- $text{'cmd_checkbox'}"; }
172 | print "
";
173 | print ui_submit($text{'continue'}, undef, undef);
174 | print ui_form_end();
175 | } else {
176 | ui_cmd($in{'zfs'}, $cmd);
177 | }
178 | @footer = ("index.cgi?mode=zfs", $text{'zfs_return'});
179 | }
180 | elsif ($in{'cmd'} =~ "snpdestroy") {
181 | my $cmd = ($config{'snap_destroy'} =~ /1/) ? "zfs destroy $in{'force'} $in{'snapshot'}" : undef;
182 | if (!$in{'confirm'})
183 | {
184 | print $text{'cmd_destroy'}." $in{'snapshot'}...
";
185 | print ui_form_start('cmd.cgi', 'post');
186 | print ui_hidden('cmd', 'snpdestroy');
187 | print ui_hidden('snapshot', $in{'snapshot'});
188 | print "$text{'cmd_affect'}
";
189 | ui_list_snapshots('-r '.$in{'snapshot'});
190 | if (($config{'zfs_destroy'} =~ /1/) && ($config{'snap_destroy'} =~ /1/)) { print ui_checkbox('force', '-r', 'Click to destroy all child dependencies (recursive)', undef ), "
"; }
191 | print "$text{'cmd_warning'}
";
192 | print ui_checkbox('confirm', 'yes', $text{'cmd_understand'}, undef );
193 | print ui_hidden('checked', 'no');
194 | if ($in{'checked'} =~ /no/) { print " -- $text{'cmd_checkbox'}"; }
195 | print "
";
196 | print ui_submit($text{'continue'}, undef, undef),;
197 | print ui_form_end();
198 |
199 | } else {
200 | ui_cmd($in{'snapshot'}, $cmd);
201 | }
202 | print ui_form_end();
203 | %parent = find_parent($in{'snapshot'});
204 | @footer = ("status.cgi?zfs=".$parent{'filesystem'}, $parent{'filesystem'});
205 | }
206 | elsif ($in{'cmd'} =~ "pooldestroy") {
207 | my $cmd = ($config{'pool_destroy'} =~ /1/) ? "zpool destroy $in{'pool'}" : undef;
208 | if (!$in{'confirm'})
209 | {
210 | print $text{'cmd_destroy'}." $in{'pool'}...
";
211 | print ui_form_start('cmd.cgi', 'post');
212 | print ui_hidden('cmd', 'pooldestroy');
213 | print ui_hidden('pool', $in{'pool'});
214 | print "$text{'cmd_affect'}
";
215 | ui_zfs_list('-r '.$in{'pool'});
216 | ui_list_snapshots('-r '.$in{'pool'});
217 | print "$text{'cmd_warning'}
";
218 | print ui_checkbox('confirm', 'yes', $text{'cmd_understand'}, undef );
219 | print ui_hidden('checked', 'no');
220 | if ($in{'checked'} =~ /no/) { print " -- $text{'cmd_checkbox'}"; }
221 | print "
";
222 | print ui_submit($text{'continue'}, undef, undef);
223 | } else {
224 | ui_cmd($in{'pool'}, $cmd);
225 | }
226 | @footer = ("index.cgi?mode=pools", $text{'index_return'});
227 | }
228 | elsif ($in{'cmd'} =~ "multisnap") {
229 | %snapshot = ();
230 | @select = split(/;/, $in{'select'});
231 | print "$text{'destroy'}
";
232 | print $text{'cmd_multisnap'}."
";
233 | print ui_form_start('cmd.cgi', 'post');
234 | print ui_hidden('cmd', 'multisnap');
235 | print ui_hidden('select', $in{'select'});
236 | my %results = ();
237 | print ui_columns_start([ "Snapshot", "Used", "Refer" ]);
238 | foreach $key (@select)
239 | {
240 | $key =~ s/.*[^[:print:]]+//;
241 | my %snapshot = list_snapshots($key);
242 | print ui_columns_row([ $key, $snapshot{'00000'}{used}, $snapshot{'00000'}{refer} ]);
243 | #print Dumper(\%snapshot);
244 | $results{$key} = ($config{'snap_destroy'}) ? "zfs destroy $key" : undef;
245 | }
246 | print ui_columns_end();
247 | if (!$in{'confirm'})
248 | {
249 | print "$text{'cmd_issue'}
";
250 | foreach $key (keys %results)
251 | {
252 | print $results{$key}, "
";
253 | }
254 | print "$text{'cmd_warning'}
";
255 | print ui_checkbox('confirm', 'yes', $text{'cmd_understand'}, undef );
256 | print ui_hidden('checked', 'no');
257 | if ($in{'checked'} =~ /no/) { print " -- $text{'cmd_checkbox'}"; }
258 | print "
";
259 | print ui_submit($text{'continue'}, undef, undef), " | Cancel";
260 | } else {
261 | print "$text{'cmd_results'}
";
262 | foreach $key (keys %results)
263 | {
264 | my @result = (`$results{$key} 2>&1`);
265 | if (($result[1] eq undef))
266 | {
267 | print $results{$key}, "
";
268 | print "$text{'cmd_success'}
";
269 | } else
270 | {
271 | print $results{$key}, "
";
272 | print "$text{'cmd_error'} ", $result[0], "
";
273 | }
274 | }
275 | }
276 | print ui_form_end();
277 | @footer = ('index.cgi', $text{'index_return'});
278 | }
279 | elsif ($in{'cmd'} =~ "replace") {
280 | #$in{'confirm'} = "yes";
281 | if ($in{'new'}) {
282 | my $cmd = ($config{'pool_properties'} =~ /1/) ? "zpool replace $in{'pool'} $in{'vdev'} $in{'new'}": undef;
283 | print ui_hidden("new", $in{'new'});
284 | ui_cmd("replace $in{'vdev'} on $in{'pool'} with $in{'new'}", $cmd);
285 | } else {
286 | print "Replace $in{'vdev'} on $in{'pool'}:
";
287 | print ui_form_start('cmd.cgi', 'post');
288 | print ui_hidden("cmd", 'replace');
289 | print ui_hidden("vdev", $in{'vdev'});
290 | print ui_hidden("pool", $in{'pool'});
291 | print "New device: ".ui_filebox("new", "/dev/disk/by-id/")." ".ui_submit('Select');
292 | print ui_form_end();
293 | }
294 | }
295 |
296 | print ui_table_end();
297 | if (@footer) { ui_print_footer(@footer); }
298 | if ($in{'zfs'} && !@footer) {
299 | print "
";
300 | ui_print_footer("status.cgi?zfs=".$in{'zfs'}, $in{'zfs'});
301 | } elsif ($in{'pool'} && !@footer) {
302 | print "
";
303 | ui_print_footer("status.cgi?pool=".$in{'pool'}, $in{'pool'});
304 | } elsif ($in{'snap'} && !@footer) {
305 | print "
";
306 | ui_print_footer("status.cgi?snap=".$in{'snap'}, $in{'snap'});
307 | }
308 |
--------------------------------------------------------------------------------
/config:
--------------------------------------------------------------------------------
1 | pool_destroy=1
2 | zfs_destroy=1
3 | snap_destroy=1
4 | pool_properties=1
5 | zfs_properties=1
6 | snap_properties=1
7 | show_snap=1
8 | last_send=/root
9 | list_zpool=size,alloc,free,frag,cap,dedup,health
10 | list_zfs=used,avail,refer,mountpoint
11 | list_snap=used,refer
12 |
--------------------------------------------------------------------------------
/config-vdev.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 | use Data::Dumper;
6 |
7 | ui_print_header(undef, $text{'vdev_title'}, "", undef, 1, 1);
8 |
9 | my %status = zpool_status($in{'pool'});
10 |
11 | print ui_columns_start([ "Virtual Device", "State", "Read", "Write", "Cksum" ]);
12 | print ui_columns_row([$status{$in{'dev'}}{name}, $status{$in{'dev'}}{state}, $status{$in{'dev'}}{read}, $status{$in{'dev'}}{write}, $status{$in{'dev'}}{cksum}]);
13 | print ui_columns_end();
14 |
15 | $parent = $status{$in{'dev'}}{parent};
16 | if ($status{$in{'dev'}}{parent} =~ 'pool')
17 | {
18 | } else {
19 | print ui_columns_start([ "Parent", "State", "Read", "Write", "Cksum" ]);
20 | print ui_columns_row(["$status{$parent}{name}", $status{$parent}{state}, $status{$parent}{read}, $status{$parent}{write}, $status{$parent}{cksum}]);
21 | print ui_columns_end();
22 | }
23 | ui_zpool_list($in{'pool'});
24 | if (($status{$in{'dev'}}{name} =~ "cache") || ($status{$in{'dev'}}{name} =~ "logs") || ($status{$in{'dev'}}{name} =~ "spare") || ($status{$in{'dev'}}{name} =~ /mirror/) || ($status{$in{'dev'}}{name} =~ /raidz/))
25 | {
26 | print "Children: ";
27 | foreach $key (sort(keys %status))
28 | {
29 | if ($status{$key}{parent} =~ $in{'dev'})
30 | {
31 | print "".$status{$key}{name}." ";
32 | }
33 | }
34 | } elsif ($config{'pool_properties'} =~ /1/) {
35 | print ui_table_start("Tasks", "width=100%", "10", ['align=left'] );
36 | if ($status{$in{'dev'}}{state} =~ "ONLINE") {
37 | print ui_table_row("Offline: ", "Bring device offline
");
38 | }
39 | else { #elsif ($status{$in{'dev'}}{state} =~ "OFFLINE") {
40 | print ui_table_row("Online: ", "Bring device online
");
41 | }
42 | print ui_table_row("Replace: ", "Replace device
");
43 | print ui_table_row("Remove: ", "Remove device
");
44 | print ui_table_row("Detach: ", "Detach device
");
45 | print ui_table_row("Clear: ", "Clear errors
");
46 | print ui_table_end();
47 | }
48 |
49 | ui_print_footer("status.cgi?pool=$in{'pool'}", $in{'pool'});
50 |
--------------------------------------------------------------------------------
/config.info:
--------------------------------------------------------------------------------
1 | pool_destroy=Destructive pool tasks (zpool destroy),1,1-Enabled,0-Disabled
2 | zfs_destroy=Destructive file system tasks (zfs destroy),1,1-Enabled,0-Disabled
3 | snap_destroy=Destructive snapshot tasks (destroy snapshot),1,1-Enabled,0-Disabled
4 | pool_properties=Pool administration tasks (create | set properties | configure vdevs),1,1-Enabled,0-Disabled
5 | zfs_properties=File system administration tasks (create | set properties | mount),1,1-Enabled,0-Disabled
6 | snap_properties=Snapshot administration tasks (create | send),1,1-Enabled,0-Disabled
7 | show_snap=Show snapshots tab on index page,1,1-Enabled,0-Disabled
8 | #list_zpool=Comma delimited list of zpool properties to display,0
9 | #list_zfs=Comma delimited list of zfs properties to display,0
10 | #list_snap=Comma delimited list of snapshot properties to display,0
11 |
--------------------------------------------------------------------------------
/create.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 | use Data::Dumper;
6 | my %createopts = create_opts();
7 | my %proplist = properties_list();
8 |
9 | #create zpool
10 | if ($in{'create'} =~ "zpool")
11 | {
12 | ui_print_header(undef, "Create Pool", "", undef, 1, 1);
13 | print ui_table_start("Create Zpool", 'width=100%');
14 | print ui_form_start("cmd.cgi", "post");
15 | print ui_hidden('cmd', 'createzpool');
16 | print ui_hidden('create', 'zpool');
17 | print ui_table_row(undef, 'Pool name: '.ui_textbox('pool', $in{'pool'}));
18 | print ui_table_row(undef, 'Mount point (blank for default)'.ui_filebox('mountpoint', $in{'mountpoint'}, 25, undef, undef, 1));
19 | if (!$in{'version'}) { $in{'version'} = 'default'; }
20 | print ui_table_row(undef, 'Pool version: '.ui_select('version', $in{'version'}, ['default', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'], 1, 0, 1));
21 | print ui_table_row(undef, 'Force '.ui_checkbox('force', '-f'));
22 | print ui_table_row(undef, "
");
23 | delete $createopts{'sparse'};
24 | delete $createopts{'volblocksize'};
25 | print ui_table_end();
26 | print ui_table_start("File system options", "width=100%", undef);
27 | foreach $key (sort(keys %createopts))
28 | {
29 | my @select = [ split(", ", $proplist{$key}) ];
30 | if ($proplist{$key} eq 'boolean') { @select = [ 'default', 'on', 'off' ]; }
31 | print ui_table_row($key, ui_select($key, 'default', @select, 1, 0, 1));
32 | }
33 | print ui_table_row(undef, "
");
34 | print ui_table_end();
35 | print ui_table_start("Device Configuration:", "width=100%", undef);
36 | if (!$in{'vdev'}) { $in{'vdev'} = 'stripe'; }
37 | print "vdev type: ", ui_select('vdev', $in{'vdev'}, ['stripe', 'mirror', 'raidz1', 'raidz2', 'raidz3'], 1, 0, 1);
38 | print "
";
39 | my %hash = list_disk_ids();
40 | my @devs = (sort(keys %{$hash{byid}}));
41 | my @prev = split(";", $in{'prev'});
42 | push (@prev, $in{'adtl'});
43 | print ui_hidden("prev", join(';', @prev));
44 | push (@devs, @prev);
45 | print ui_multi_select("devs", undef, [@devs], 8, undef, undef, 'available', 'selected', 425);
46 | print ui_table_end();
47 | print ui_submit('Create', 'create');
48 | print ui_form_end();
49 |
50 | print ui_form_start('create.cgi', 'post');
51 | print ui_hidden('prev', join(';', @prev));
52 | print ui_hidden('create', 'zpool');
53 | print "Add custom file to selection: ".ui_filebox("adtl")." ".ui_submit('Add');
54 | print ui_form_end();
55 | @footer = ('', $text{'index_return'});
56 |
57 | #create zfs file system
58 | #TODO the $in{'pool'} variable should be changed to $in{'parent'}, but it still works
59 | } elsif (($in{'create'} =~ "zfs") & ($in{'parent'} eq undef)) {
60 | ui_print_header(undef, "Create File System", "", undef, 1, 1);
61 | print "Select parent for file system";
62 | ui_zfs_list(undef, "create.cgi?create=zfs&parent=");
63 | @footer = ('index.cgi?mode=zfs', $text{'zfs_return'});
64 | } elsif (($in{'create'} =~ "zfs")) {
65 | ui_print_header(undef, "Create File System", "", undef, 1, 1);
66 | #Show associated file systems
67 |
68 | print "Parent file system:";
69 | ui_zfs_list($in{'parent'}, "");
70 |
71 | @tabs = ();
72 | push(@tabs, [ "zfs", "Create Filesystem", "create.cgi?mode=zfs" ]);
73 | push(@tabs, [ "zvol", "Create Volume", "create.cgi?mode=zvol" ]);
74 | print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || $tabs[0]->[0], 1);
75 |
76 | print &ui_tabs_start_tab("mode", "zfs");
77 |
78 | print ui_form_start("cmd.cgi", "post");
79 | print ui_table_start('New File System', 'width=100%', '6');
80 | print ui_table_row(undef, "Name: ".$in{'parent'}."/".ui_textbox('zfs'));
81 | print ui_table_row(undef, 'Mount point (blank for default)'.ui_filebox('mountpoint', '', 25, undef, undef, 1));
82 | print ui_hidden('parent', $in{'parent'});
83 | print ui_hidden('create', 'zfs');
84 | print ui_hidden('cmd', 'createzfs');
85 | print ui_table_row(undef, "
");
86 | print ui_table_end();
87 | print ui_table_start("File system options", "width=100%", undef);
88 | foreach $key (sort(keys %createopts))
89 | {
90 | my @select = [ split(", ", $proplist{$key}) ];
91 | if ($proplist{$key} eq 'boolean') { @select = [ 'default', 'on', 'off' ]; }
92 | print ui_table_row($key.': ', ui_select($key, 'default', @select, 1, 0, 1));
93 | }
94 | print ui_table_end();
95 | print ui_submit('Create');
96 | print ui_form_end();
97 | print &ui_tabs_end_tab("mode", "zfs");
98 |
99 | print &ui_tabs_start_tab("mode", "zvol");
100 | print ui_form_start("cmd.cgi", "post");
101 | print ui_table_start('New Volume', 'width=100%', '6');
102 | print ui_table_row(undef, "Name: ".$in{'parent'}."/".ui_textbox('zfs'));
103 | print ui_table_row(undef, "Size: ".ui_textbox('size'));
104 | print ui_table_row(undef, 'Blocksize: '.ui_select('volblocksize', 'default', ['default', '512', '1K', '2K', '4K', '8K', '16K', '32K', '64K', '128K'], 1, 0, 1));
105 | print ui_table_row(undef, 'Sparse volume: '.ui_checkbox('sparse', '1'));
106 | print ui_hidden('parent', $in{'parent'});
107 | print ui_hidden('create', 'zfs');
108 | print ui_hidden('cmd', 'createzfs');
109 | print ui_hidden('zvol', '1');
110 | print ui_table_row(undef, "
");
111 | print ui_table_end();
112 | print ui_table_start("Volume options", "width=100%", undef);
113 | foreach $key (sort(keys %createopts))
114 | {
115 | my @select = [ split(", ", $proplist{$key}) ];
116 | if ($proplist{$key} eq 'boolean') { @select = [ 'default', 'on', 'off' ]; }
117 | print ui_table_row($key.': ', ui_select($key, 'default', @select, 1, 0, 1));
118 | }
119 | print ui_table_end();
120 | print ui_submit('Create');
121 | print ui_form_end();
122 | print &ui_tabs_end_tab("mode", "zvol");
123 |
124 | #end tabs
125 | print &ui_tabs_end(1);
126 | $in{'zfs'} = $in{'parent'};
127 |
128 | } elsif ($in{'import'}) {
129 | ui_print_header(undef, "Import Pool", "", undef, 1, 1);
130 | print ui_table_start("Import Zpool", 'width=100%');
131 | print ui_form_start("create.cgi", "post");
132 | print ui_hidden('import', '1');
133 | print ui_table_row(undef, "Import search directory (blank for default):".ui_filebox('dir', $in{'dir'}, 25, undef, undef, undef, 1));
134 | print ui_table_row(undef, ui_checkbox('destroyed', '-D', 'Search for destroyed pools', undef ));
135 | print ui_table_row(undef, ui_submit('Search'));
136 | print ui_form_end();
137 | %imports = zpool_imports($in{'dir'}, $in{'destroyed'});
138 | print ui_columns_start([ "Pool", "ID", "State" ]);
139 | foreach $key (sort(keys %imports))
140 | {
141 | print ui_columns_row(["".$imports{$key}{pool}."", "".$imports{$key}{'id'}."", $imports{$key}{'state'}]);
142 | }
143 | print ui_columns_end();
144 | print ui_table_end();
145 | @footer = ('', $text{'index_return'});
146 | } elsif ($in{'clone'}) {
147 | ui_print_header(undef, "Clone Snapshot", "", undef, 1, 1);
148 | my %parent = find_parent($in{'clone'});
149 | print ui_form_start("cmd.cgi", "post");
150 | print ui_table_start('Clone Snapshot', 'width=100%', '6');
151 | print ui_table_row(undef, 'Snapshot: '.$in{'clone'});
152 | print ui_table_row(undef, "Name: ".$parent{'pool'}."/".ui_textbox('zfs'));
153 | print ui_table_row(undef, 'Mount point (blank for default)'.ui_filebox('mountpoint', '', 25, undef, undef, 1));
154 | print ui_hidden('cmd', 'clone');
155 | print ui_hidden('clone', $in{'clone'});
156 | print ui_hidden('parent', $parent{'pool'});
157 | print ui_table_row(undef, "
");
158 | print ui_table_row(undef, 'File system options: ');
159 | foreach $key (sort(keys %createopts))
160 | {
161 | my @select = [ split(", ", $proplist{$key}) ];
162 | if ($proplist{$key} eq 'boolean') { @select = [ 'default', 'on', 'off' ]; }
163 | print ui_table_row($key.': ', ui_select($key, 'default', @select, 1, 0, 1));
164 | }
165 | print ui_table_end();
166 | print ui_submit('Create');
167 | print ui_form_end();
168 | $in{'snap'} = $in{'clone'};
169 | } elsif ($in{'rename'}) {
170 | ui_print_header(undef, "Rename", "", undef, 1, 1);
171 | print ui_form_start("cmd.cgi", "post");
172 | %parent = find_parent($in{'rename'});
173 | if (index($in{'rename'}, '@') != -1) {
174 | #is snapshot
175 | print ui_hidden('confirm', 'yes');
176 | $parent = $parent{'filesystem'};
177 | print ui_table_start('Rename snapshot', 'width=100%', '6');
178 | print ui_table_row(undef, 'Snapshot: '.$in{'rename'});
179 | print ui_table_row(undef, "New Name: ".$parent."@".ui_textbox('name', $parent{'snapshot'}, 35));
180 | print ui_table_row(undef, ui_checkbox("recurse", "-r ", "Recursively rename the snapshots of all descendent datasets."));
181 | @footer = ("status.cgi?snap=".$in{'rename'}, $in{'rename'});
182 | } elsif (index($in{'rename'}, '/') != -1) {
183 | #is filesystem
184 | $parent = $parent{'pool'};
185 | ui_zfs_list("-r ".$in{'rename'});
186 | print ui_table_start('Rename filesystem', 'width=100%', '6');
187 | print ui_table_row(undef, 'Filesystem: '.$in{'rename'});
188 | print ui_table_row(undef, "New Name: ".$parent."/".ui_textbox('name', undef, 35));
189 | print ui_table_row(undef, ui_checkbox("prnt", "-p ", "Create all the nonexistent parent datasets."));
190 | }
191 | print ui_table_row(undef, ui_checkbox("force", "-f ", "Force unmount any filesystems that need to be unmounted in the process."));
192 | print ui_hidden('cmd', 'rename');
193 | print ui_hidden('zfs', $in{'rename'});
194 | print ui_hidden('parent', $parent);
195 | print ui_table_row(undef, "
");
196 | print ui_table_end();
197 | print ui_submit('Rename');
198 | print ui_form_end();
199 | $in{'zfs'} = $in{'rename'};
200 | } elsif (($in{'create'} =~ "snapshot") && ($in{'zfs'} eq undef)) {
201 | ui_print_header(undef, $text{'snapshot_new'}, "", undef, 1, 1);
202 | %zfs = list_zfs();
203 | print ui_columns_start([ "File System", "Used", "Avail", "Refer", "Mountpoint" ]);
204 | foreach $key (sort(keys %zfs))
205 | {
206 | print ui_columns_row(["$key", $zfs{$key}{used}, $zfs{$key}{avail}, $zfs{$key}{refer}, $zfs{$key}{mount} ]);
207 | }
208 | print ui_columns_end();
209 | @footer = ('index.cgi?mode=snapshot', $text{'snapshot_return'});
210 | #handle creation of snapshot
211 | } elsif ($in{'create'} =~ "snapshot") {
212 | ui_print_header(undef, $text{'snapshot_create'}, "", undef, 1, 1);
213 | %zfs = list_zfs($in{'zfs'});
214 | print ui_columns_start([ "File System", "Used", "Avail", "Refer", "Mountpoint" ]);
215 | foreach $key (sort(keys %zfs))
216 | {
217 | print ui_columns_row(["$key", $zfs{$key}{used}, $zfs{$key}{avail}, $zfs{$key}{refer}, $zfs{$key}{mount} ]);
218 | }
219 | print ui_columns_end();
220 | #show list of snapshots based on filesystem
221 | print "Snapshots already on this filesystem:
";
222 | %snapshot = list_snapshots();
223 | print ui_columns_start([ "Snapshot", "Used", "Refer" ]);
224 | foreach $key (sort(keys %snapshot))
225 | {
226 | if ($key =~ ($in{'zfs'}."@") ) { print ui_columns_row(["$key", $snapshot{$key}{used}, $snapshot{$key}{refer} ]); }
227 | }
228 | print ui_columns_end();
229 | print ui_create_snapshot($in{'zfs'});
230 | }
231 |
232 | if (@footer) { ui_print_footer(@footer);
233 | } elsif ($in{'zfs'} && !@footer) {
234 | print "
";
235 | ui_print_footer("status.cgi?zfs=".$in{'zfs'}, $in{'zfs'});
236 | } elsif ($in{'pool'} && !@footer) {
237 | print "
";
238 | ui_print_footer("status.cgi?pool=".$in{'pool'}, $in{'pool'});
239 | } elsif ($in{'snap'} && !@footer) {
240 | print "
";
241 | ui_print_footer("status.cgi?snap=".$in{'snap'}, $in{'snap'});
242 | }
243 |
--------------------------------------------------------------------------------
/defaultacl:
--------------------------------------------------------------------------------
1 | upool_destroy=1
2 | uzfs_destroy=1
3 | usnap_destroy=1
4 | upool_properties=1
5 | uzfs_properties=1
6 |
--------------------------------------------------------------------------------
/diff.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 | use Data::Dumper;
6 | ui_print_header(undef, $text{'diff_title'}, "", undef, 1, 1);
7 |
8 | print "Snapshot: ".$in{'snap'};
9 | @array = diff($in{'snap'}, undef);
10 | %type = ('B' => 'Block device', 'C' => 'Character device', '/' => 'Directory', '>' => 'Door', 'F' => 'Regular file');
11 | %action = ('-' => 'removed', '+' => 'created', 'M' => 'Modified', 'R' => 'Renamed');
12 | print ui_columns_start([ "File", "Action", "Type" ]);
13 | foreach $key (@array)
14 | {
15 | @file = split("\t", $key);
16 | print ui_columns_row([ @file[2], $action{@file[0]}, $type{@file[1]} ]);
17 | }
18 | print ui_columns_end();
19 |
20 | ui_print_footer("status.cgi?snap=$in{'snap'}", $in{'snap'});
21 |
--------------------------------------------------------------------------------
/index.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | &ReadParse();
5 | ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, "About ZFS Manager
".&help_search_link("zfs, zpool", "man", "doc", "google"), undef, undef, $text{'index_version'} );
6 |
7 | #start tabs
8 | @tabs = ();
9 | push(@tabs, [ "pools", "ZFS Pools", "index.cgi?mode=pools" ]);
10 | push(@tabs, [ "zfs", "ZFS File Systems", "index.cgi?mode=zfs" ]);
11 | if ($config{'show_snap'} =~ /1/) { push(@tabs, [ "snapshot", "Snapshots", "index.cgi?mode=snapshot" ]); }
12 | print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || $tabs[0]->[0], 1);
13 |
14 | #start pools tab
15 | print &ui_tabs_start_tab("mode", "pools");
16 |
17 | ui_zpool_list();
18 | if ($config{'pool_properties'} =~ /1/) {
19 | print "Create new pool";
20 | print " | ";
21 | print "Import pool";
22 | }
23 | print &ui_tabs_end_tab("mode", "pools");
24 |
25 | #start zfs tab
26 | print &ui_tabs_start_tab("mode", "zfs");
27 |
28 | print ""; #div tags are needed for new theme apparently
29 | ui_zfs_list();
30 | if ($config{'zfs_properties'} =~ /1/) { print "
Create file system"; }
31 | print "
";
32 | print &ui_tabs_end_tab("mode", "zfs");
33 |
34 | #start snapshots tab
35 | if ($config{'show_snap'} =~ /1/) {
36 | print &ui_tabs_start_tab("mode", "snapshot");
37 | ui_list_snapshots(undef, 1);
38 | if ($config{'snap_properties'} =~ 1) { print "Create snapshot"; }
39 | print &ui_tabs_end_tab("mode", "snapshot");
40 | }
41 |
42 | #end tabs
43 | print &ui_tabs_end(1);
44 |
45 | #alerts
46 | print "Alerts:
", get_alerts(), "";
47 |
48 | ui_print_footer("/", $text{'index'});
49 |
--------------------------------------------------------------------------------
/lang/en:
--------------------------------------------------------------------------------
1 | index_title=ZFS Manager
2 | index_root=The root directory is $1.
3 | index_version=alpha 0.1.5
4 | index_return=pool list
5 | snapshot_return=snapshot list
6 | zfs_return=file system list
7 |
8 | #general use
9 | destination=Destination:
10 | filename=Filename:
11 | continue=Continue
12 | create=Create
13 | destroy=Destroy
14 |
15 | #tasks
16 | tasks=Tasks
17 | differences=Differences:
18 | differences_desc=Show differences in
19 | rename=Rename:
20 | rename_desc=Rename
21 | clone=Clone:
22 | clone_desc: Clone
23 | destroy=Destroy:
24 | destroy_pool=Destroy pool
25 | destroy_filesystem=Destroy filesystem
26 | destroy_snap=Destroy snapshot
27 | snapshot=Snapshot:
28 | snapshot_desc=Create new snapshot based on filesystem:
29 | send=Send:
30 | send_desc=Send
31 | rollback=Rollback:
32 | rollback_desc=Rollback
33 |
34 | status_title=Zpool Status
35 |
36 | vdev_title=Manage Virtual Device
37 | property_title=Manage Property
38 | select_title=Select a device for new vdev
39 | replace_title=Replace a device
40 | diff_title=Snapshot Differences
41 |
42 | about_title=About ZFS Manager
43 |
44 | cmd_title=Issuing Command
45 | cmd_dscpt=Command Description:
46 | cmd_issue=Commands to be issued:
47 | cmd_results=Results from commands:
48 | cmd_with=with command...
49 | cmd_setzfs=Attempting to set zfs property
50 | cmd_setpool=Attempting to set pool property
51 | cmd_snapshot=Attempting to create snapshot
52 | cmd_send=Send snapshot
53 | cmd_gzip=to gzip file
54 | cmd_createzfs=Attempting to create filesystem
55 | cmd_clone=Attempting to clone
56 | cmd_rename=Attempting to rename
57 | cmd_createzpool=Attempting to create pool
58 | cmd_vdev=Attempting to
59 | cmd_promote=Attempting to promote
60 | cmd_scrub=Attempting to scrub pool
61 | cmd_upgrade=Attempting to upgrade pool
62 | cmd_export=Attempting to export pool
63 | cmd_import=Attempting to import pool
64 | cmd_zfsact=Attempting to
65 | cmd_destroy=Attempting to destroy
66 | cmd_affect=This action will affect the following:
67 | cmd_warning=Warning, this action will result in data loss, do you really want to continue?
68 | cmd_understand=I understand
69 | cmd_checkbox=checkbox must be selected
70 | cmd_multisnap=Attempting to destroy multiple snapshots...
71 | cmd_success=Success!
72 | cmd_error=error:
73 |
74 | snapshot_title=Snapshot
75 | snapshot_create=Create Snapshot
76 | snapshot_new=Select filesystem for snapshot
77 |
78 | zpool_upgrade_msg=This will enable all available features, many of which cannot be disabled again. See zpool-features in man pages for more information. *Avoid using if pool needs to retain backwards compatibilty.*
79 |
80 | promote_cmd=zfs promote clone-filesystem
81 | promote_desc=Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the origin file system becomes a clone of the specified file system.
The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the origin file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The rename subcommand can be used to rename any conflicting snapshots.
82 |
83 | clone_cmd=zfs clone [-p] [-o property=value] ... snapshot filesystem|volume
84 | clone_desc=Creates a clone of the given snapshot. See the "Clones" section for details. The target dataset can be located anywhere in the ZFS hierarchy, and is created as the same type as the original.
-p
Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the mountpoint property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
-o property=value
Sets the specified property; see zfs create for details.
85 |
86 | export_cmd=zpool export [-a] [-f] pool ...
87 | export_desc=Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.
Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used.
For pools to be portable, you must give the zpool command whole disks, not just partitions, so that ZFS can label the disks with portable EFI labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
-a Exports all pools imported on the system.
-f Forcefully unmount all datasets, using the "unmount -f" command.
This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption.
88 |
89 | #universal property descriptions
90 |
91 | prop_guid=A unique identifier for the pool or filesystem.
The 64 bit GUID of a dataset or bookmark does not change over its entire lifetime. When a snapshot is sent to another pool, the received snapshot has the same GUID. Thus, the guid is suitable to identify a snapshot across pools.
92 |
93 | #zfs property descriptions
94 | prop_aclinherit=Controls how ACL entries are inherited when files and directories are created. A file system with an "aclinherit" property of "discard" does not inherit any ACL entries. A file system with an "aclinherit" property value of "noallow" only inherits inheritable ACL entries that specify "deny" permissions. The property value "restricted" (the default) removes the "write_acl" and "write_owner" permissions when the ACL entry is inherited. A file system with an "aclinherit" property value of "passthrough" inherits all inheritable ACL entries without any modifications made to the ACL entries when they are inherited. A file system with an "aclinherit" property value of "passthrough-x" has the same meaning as "passthrough", except that the owner@, group@, and everyone@ ACEs inherit the execute permission only if the file creation mode also requests the execute bit. When the property value is set to "passthrough," files are created with a mode determined by the inheritable ACEs. If no inheritable ACEs exist that affect the mode, then the mode is set in accordance to the requested mode from the application.
95 | prop_aclmode=Controls how an ACL is modified during chmod(2). A file system with an "aclmode" property of "discard" deletes all ACL entries that do not represent the mode of the file. An "aclmode" property of "groupmask" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission bits, unless it is a user entry that has the same UID as the owner of the file or directory. In this case, the ACL permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "passthrough" indicates that no changes are made to the ACL other than generating the necessary ACL entries to represent the new mode of the file or directory.
96 | prop_acltype=Controls whether ACLs are enabled and if so what type of ACL to use. When a file system has the acltype property set to noacl (the default) then ACLs are disabled. Setting the acltype property to posixacl indicates Posix ACLs should be used. Posix ACLs are specific to Linux and are not functional on other platforms. Posix ACLs are stored as an xattr and therefore will not overwrite any existing ZFS/NFSv4 ACLs which may be set. Currently only posixacls are supported on Linux.
To obtain the best performance when setting posixacl users are strongly encouraged to set the xattr=sa property. This will result in the Posix ACL being stored more efficiently on disk. But as a consequence of this all new xattrs will only be accessable from ZFS implementations which support the xattr=sa property. See the xattr property for more details.
97 | prop_atime=Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is "on".
98 | prop_available=The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool. This property can also be referred to by its shortened column name, "avail".
99 | prop_canmount=If this property is set to "off", the file system cannot be mounted, and is ignored by "zfs mount -a". Setting this property to "off" is similar to setting the "mountpoint" property to "none", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "off" allows datasets to be used solely as a mechanism to inherit properties. One example of setting canmount=off is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
When the "noauto" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "zfs mount -a" command or unmounted by the "zfs unmount -a" command.
This property is not inherited.
100 | prop_casesensitivity=Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the casesensitivity property is sensitive. Traditionally, UNIX and POSIX file systems have case-sensitive file names.
The mixed value for the casesensitivity property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the mixed value behavior, see the Solaris ZFS Administration Guide.
101 | prop_checksum=Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, fletcher2, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice.
102 | prop_clones=A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space. Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The origin property exposes this dependency, and the destroy command lists any such dependencies, if they exist.
The clone parent-child dependency relationship can be reversed by using the promote subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from.
103 | prop_com.sun:auto-snapshot=zfs-auto-snapshot automatically creates, rotates, and destroys snapshots for all your ZFS datasets, and is compatible with both zfsonlinux and zfs-fuse.
104 | prop_compression=Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip" compression algorithm uses the same compression as the gzip(1) command. You can specify the "gzip" level by using the value "gzip-N" where N is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for gzip(1)). This property can also be referred to by its shortened column name "compress".
105 | prop_compressratio=The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running "zfs set compression=on dataset". The default value is "off".
106 | prop_context=This flag sets the SELinux context for all files in the filesytem under the mountpoint for that filesystem. See selinux(8) for more information.
107 | prop_copies=Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the "used" property and counting against quotas and reservations.
Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "-o copies=" option.
108 | prop_creation=The time this dataset was created.
109 | prop_createtxg=The transaction group (txg) in which the dataset was created. Bookmarks have the same createtxg as the snapshot they are initially tied to. This property is suitable for ordering a list of snapshots, e.g. for incremental send and receive.
110 | prop_dedup=Configures deduplication for a dataset. The default value is off. The default deduplication checksum is sha256 (this may change in the future). When dedup is enabled, the checksum defined here overrides the checksum property. Setting the value to verify has the same effect as the setting sha256,verify. If set to verify, ZFS will do a byte-to-byte comparsion in case of two blocks having the same signature to make sure the block contents are identical.
111 | prop_defcontext=This flag sets the SELinux context for unlabeled files. See selinux(8) for more information.
112 | prop_devices=Controls whether device nodes can be opened on this file system. The default value is "on".
113 | prop_dnodesize=Specifies a compatibility mode or literal value for the size of dnodes in the file system. The default value is legacy. Setting this property to a value other than legacy requires the large_dnode pool feature to be enabled.
Consider setting dnodesize to auto if the dataset uses the xattr=sa property setting and the workload makes heavy use of extended attributes. This may be applicable to SELinux-enabled systems, Lustre servers, and Samba servers, for example. Literal values are supported for cases where the optimal size is known in advance and for performance testing.
Leave dnodesize set to legacy if you need to receive a send stream of this dataset on a pool that doesn't enable the large_dnode feature, or if you need to import this pool on a system that doesn't support the large_dnode feature.
This property can also be referred to by its shortened column name, dnsize.
114 | prop_encryption=Controls the encryption cipher suite (block cipher, key length, and mode) used for this dataset. Requires the encryption feature to be enabled on the pool. Requires a keyformat to be set at dataset creation time.
Selecting encryption=on when creating a dataset indicates that the default encryption suite will be selected, which is currently aes-256-gcm. In order to provide consistent data protection, encryption must be specified at dataset creation time and it cannot be changed afterwards.
For more details and caveats about encryption see the Encryption section of zfs-load-key(8).
115 | prop_encryptionroot=For encrypted datasets, indicates where the dataset is currently inheriting its encryption key from. Loading or unloading a key for the encryptionroot will implicitly load / unload the key for any inheriting datasets (see zfs load-key and zfs unload-key for details). Clones will always share an encryption key with their origin. See the Encryption section of zfs-load-key(8) for details.
116 | prop_exec=Controls whether processes can be executed from within this file system. The default value is "on".
117 | prop_filesystem_count=The total number of filesystems and volumes that exist under this location in the dataset tree. This value is only available when a filesystem_limit has been set somewhere in the tree under which the dataset resides.
118 | prop_filesystem_limit=Limits the number of filesystems and volumes that can exist under this point in the dataset tree. The limit is not enforced if the user is allowed to change the limit. Setting a filesystem_limit on a descendent of a filesystem that already has a filesystem_limit does not override the ancestor\'s filesystem_limit, but rather imposes an additional limit. This feature must be enabled to be used (see zpool-features(5)).
119 | prop_fscontext=This flag sets the SELinux context for the filesytem being mounted. See selinux(8) for more information.
120 | prop_keyformat=Controls what format the user\'s encryption key will be provided as. This property is only set when the dataset is encrypted.
Raw keys and hex keys must be 32 bytes long (regardless of the chosen encryption suite) and must be randomly generated. A raw key can be generated with the following command:
\# dd if=/dev/urandom of=/path/to/output/key bs=32 count=1
Passphrases must be between 8 and 512 bytes long and will be processed through PBKDF2 before being used (see the pbkdf2iters property). Even though the encryption suite cannot be changed after dataset creation, the keyformat can be with zfs change-key.
121 | prop_keylocation=Controls where the user's encryption key will be loaded from by default for commands such as zfs load-key and zfs mount -l. This property is only set for encrypted datasets which are encryption roots. If unspecified, the default is prompt.
Even though the encryption suite cannot be changed after dataset creation, the keylocation can be with either zfs set or zfs change-key. If prompt is selected ZFS will ask for the key at the command prompt when it is required to access the encrypted data (see zfs load-key for details). This setting will also allow the key to be passed in via STDIN, but users should be careful not to place keys which should be kept secret on the command line. If a file URI is selected, the key will be loaded from the specified absolute file path.
122 | prop_keystatus=Indicates if an encryption key is currently loaded into ZFS. The possible values are none, available, and unavailable. See zfs load-key and zfs unload-key.
123 | prop_logbias=Provide a hint to ZFS about handling of synchronous requests in this dataset. If logbias is set to latency (the default), ZFS will use pool log devices (if configured) to handle the requests at low latency. If logbias is set to throughput, ZFS will not use configured pool log devices. ZFS will instead optimize synchronous operations for global pool throughput and efficient use of resources.
124 | prop_logicalused=The amount of space that is "logically" accessible by this dataset. See the referenced property. The logical space ignores the effect of the compression and copies properties, giving a quantity closer to the amount of data that applications see. However, it does include space consumed by metadata.
This property can also be referred to by its shortened column name, lrefer.
125 | prop_logicalreferenced=The amount of space that is "logically" accessible by this dataset. See the referenced property. The logical space ignores the effect of the compression and copies properties, giving a quantity closer to the amount of data that applications see. However, it does include space consumed by metadata.
This property can also be referred to by its shortened column name, lrefer.
126 | prop_mlslabel=The mlslabel property is a sensitivity label that determines if a dataset can be mounted in a zone on a system with Trusted Extensions enabled. If the labeled dataset matches the labeled zone, the dataset can be mounted and accessed from the labeled zone.
When the mlslabel property is not set, the default value is none. Setting the mlslabel property to none is equivalent to removing the property.
The mlslabel property can be modified only when Trusted Extensions is enabled and only with appropriate privilege. Rights to modify it cannot be delegated. When changing a label to a higher label or setting the initial dataset label, the {PRIV_FILE_UPGRADE_SL} privilege is required. When changing a label to a lower label or the default (none), the {PRIV_FILE_DOWNGRADE_SL} privilege is required. Changing the dataset to labels other than the default can be done only when the dataset is not mounted. When a dataset with the default label is mounted into a labeled-zone, the mount operation automatically sets the mlslabel property to the label of that zone.
When Trusted Extensions is not enabled, only datasets with the default label (none) can be mounted.
Zones are a Solaris feature and are not relevant on Linux.
127 | prop_mounted=For file systems, indicates whether the file system is currently mounted. This property can be either yes or no.
128 | prop_mountpoint=Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used.
When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is legacy, then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously legacy or none, or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
129 | prop_normalization=Indicates whether the file system should perform a unicode normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison process. If this property is set to a legal value other than none, and the utf8only property was left unspecified, the utf8only property is automatically set to on. The default value of the normalization property is none. This property cannot be changed after the file system is created.
130 | prop_nbmand=Controls whether the file system should be mounted with nbmand (Non Blocking mandatory locks). This is used for SMB clients. Changes to this property only take effect when the file system is umounted and remounted. See mount(8) for more information on nbmand mounts. This property is not used on Linux.
131 | prop_objsetid=A unique identifier for this dataset within the pool. Unlike the dataset\'s guid, the objsetid of a dataset is not transferred to other pools when the snapshot is copied with a send/receive operation. The objsetid can be reused (for a new dataset) after the dataset is deleted.
132 | prop_overlay=Allow mounting on a busy directory or a directory which already contains files or directories. This is the default mount behavior for Linux and FreeBSD file systems. On these platforms the property is on by default. Set to off to disable overlay mounts for consistency with OpenZFS on other platforms.
133 | prop_pbkdf2iters=Controls the number of PBKDF2 iterations that a passphrase encryption key should be run through when processing it into an encryption key. This property is only defined when encryption is enabled and a keyformat of passphrase is selected. The goal of PBKDF2 is to significantly increase the computational difficulty needed to brute force a user's passphrase. This is accomplished by forcing the attacker to run each passphrase through a computationally expensive hashing function many times before they arrive at the resulting key. A user who actually knows the passphrase will only have to pay this cost once. As CPUs become better at processing, this number should be raised to ensure that a brute force attack is still not possible. The current default is 350000 and the minimum is 100000. This property may be changed with zfs change-key. prop_recordsize=Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. ZFS automatically tunes block sizes according to internal algorithms optimized for typical access patterns. For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance. The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes. Changing the file system\'\s recordsize only affects files created afterward; existing files are unaffected. This property can also be referred to by its shortened column name, "recsize".
134 | prop_primarycache=Controls what is cached in the primary cache (ARC). If this property is set to all, then both user data and metadata is cached. If this property is set to none, then neither user data nor metadata is cached. If this property is set to metadata, then only metadata is cached. The default value is all.
135 | prop_readonly=Controls whether this dataset can be modified. The default value is "off".
This property can also be referred to by its shortened column name, "rdonly".
136 | prop_realtime=Controls the manner in which the access time is updated when atime=on is set. Turning this property on causes the access time to be updated relative to the modify or change time. Access time is only updated if the previous access time was earlier than the current modify or change time or if the existing access time hasn’t been updated within the past 24 hours. The default value is off.
137 | prop_redundant_metadata=Controls what types of metadata are stored redundantly. ZFS stores an extra copy of metadata, so that if a single block is corrupted, the amount of user data lost is limited. This extra copy is in addition to any redundancy provided at the pool level (e.g. by mirroring or RAID-Z), and is in addition to an extra copy specified by the copies property (up to a total of 3 copies). For example if the pool is mirrored, copies=2, and redundant_metadata=most, then ZFS stores 6 copies of most metadata, and 4 copies of data and some metadata.
When set to all, ZFS stores an extra copy of all metadata. If a single on-disk block is corrupt, at worst a single block of user data (which is recordsize bytes long) can be lost.
When set to most, ZFS stores an extra copy of most types of metadata. This can improve performance of random writes, because less metadata must be written. In practice, at worst about 100 blocks (of recordsize bytes each) of user data can be lost if a single on-disk block is corrupt. The exact behavior of which metadata blocks are stored redundantly may change in future releases.
The default value is all.
138 | prop_refcompressratio=The compression ratio achieved for the referenced space of this dataset, expressed as a multiplier. See also the compressratio property.
139 | prop_referenced=The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
This property can also be referred to by its shortened column name, refer.
140 | prop_refquota=Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used by descendents, including file systems and snapshots.
141 | prop_refreservation=The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by refreservation. The refreservation reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
If refreservation is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
If refreservation is set to auto, a volume is thick provisioned (or "not sparse"). refreservation=auto is only supported on volumes. See volsize in the Native Properties section for more information about sparse volumes.
This property can also be referred to by its shortened column name, refreserv.
142 | prop_reservation=The minimum amount of space guaranteed to a dataset and its descendants. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
This property can also be referred to by its shortened column name, reserv.
143 | prop_rootcontext=This flag sets the SELinux context for the root inode of the filesystem. See selinux(8) for more information.
144 | prop_secondarycache=Controls what is cached in the secondary cache (L2ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
145 | prop_shareiscsi=Like the "sharenfs" property, "shareiscsi" indicates whether a ZFS volume is exported as an iSCSI target. The acceptable values for this property are "on", "off", and "type=disk". The default value is "off". In the future, other target types might be supported. For example, "tape".
You might want to set "shareiscsi=on" for a file system so that all ZFS volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
146 | prop_sharenfs=Controls whether the file system is shared via NFS, and what options are to be used. A file system with a sharenfs property of off is managed with the exportfs(8) command and entries in the /etc/exports file. Otherwise, the file system is automatically shared and unshared with the zfs share and zfs unshare commands. If the property is set to on, the dataset is shared using the default options:
sec=sys,rw,crossmnt,no_subtree_check
See exports(5) for the meaning of the default options. Otherwise, the exportfs(8) command is invoked with options equivalent to the contents of this property.
When the sharenfs property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously off, or if they were shared before the property was changed. If the new property is off, the file systems are unshared.
147 | prop_sharesmb=Controls whether the file system is shared by using Samba USERSHARES and what options are to be used. Otherwise, the file system is automatically shared and unshared with the zfs share and zfs unshare commands. If the property is set to on, the net(8) command is invoked to create a USERSHARE.
Because SMB shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be invalid in the resource name, are replaced with underscore (_) characters. Linux does not currently support additional options which might be available on Solaris.
If the sharesmb property is set to off, the file systems are unshared.
The share is created with the ACL (Access Control List) "Everyone:F" ("F" stands for "full permissions", ie. read and write permissions) and no guest access (which means Samba must be able to authenticate a real user, system passwd/shadow, LDAP or smbpasswd based) by default. This means that any additional access control (disallow specific user specific access etc) must be done on the underlying file system.
148 | prop_snapdir=Controls whether the .zfs directory is hidden or visible in the root of the file system as discussed in the Snapshots section of zfsconcepts(8). The default value is hidden.
149 | prop_snapdev=Controls whether the volume snapshot devices under /dev/zvol/ are hidden or visible. The default value is hidden.
150 | prop_snapshot_count=The total number of snapshots that exist under this location in the dataset tree. This value is only available when a snapshot_limit has been set somewhere in the tree under which the dataset resides.
151 | prop_snapshot_limit=Limits the number of snapshots that can be created on a dataset and its descendents. Setting a snapshot_limit on a descendent of a dataset that already has a snapshot_limit does not override the ancestor's snapshot_limit, but rather imposes an additional limit. The limit is not enforced if the user is allowed to change the limit. For example this means that recursive snapshots taken from the global zone are counted against each delegated dataset within a zone. This feature must be enabled to be used (see zpool-features(5)).
152 | prop_special_small_blocks=This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class.
Before setting this property, a special class vdev must be added to the pool. See zpool(8) for more details on the special allocation class.
153 | prop_sync=Controls the behavior of synchronous requests (e.g. fsync, O_DSYNC). standard is the POSIX specified behavior of ensuring all synchronous requests are written to stable storage and all devices are flushed to ensure data is not cached by device controllers (this is the default). always causes every file system transaction to be written and flushed before its system call returns. This has a large performance penalty. disabled disables synchronous requests. File system transactions are only committed to stable storage periodically. This option will give the highest performance. However, it is very dangerous as ZFS would be ignoring the synchronous transaction demands of applications such as databases or NFS. Administrators should only use this option when the risks are understood.
154 | prop_type=The type of dataset: filesystem, volume, snapshot, or bookmark.
155 | prop_used=The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that is freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
The used space of a snapshot (see the Snapshots section of zfsconcepts(8)) is space that is referenced exclusively by this snapshot. If this snapshot is destroyed, the amount of used space will be freed. Space that is shared by multiple snapshots isn't accounted for in this metric. When a snapshot is destroyed, space that was previously shared with this snapshot can become unique to snapshots adjacent to it, thus changing the used space of those snapshots. The used space of the latest snapshot can also be affected by changes in the file system. Note that the used space of a snapshot is a subset of the written space of the snapshot.
The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using fsync(2) or O_SYNC does not necessarily guarantee that the space usage information is updated immediately.
156 | prop_usedbychildren=The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
157 | prop_usedbydataset=The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any refreservation and destroying any necessary snapshots or descendents).
158 | prop_usedbysnapshots=The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' used properties because space can be shared by multiple snapshots.
159 | prop_usedbyrefreservation=The amount of space used by a refreservation set on this dataset, which would be freed if the refreservation was removed.
160 | prop_userrefs=This property is set to the number of user holds on this snapshot. User holds are set by using the zfs hold command.
161 | prop_utf8only=Indicates whether the file system should reject file names that include characters that are not present in the UTF-8 character code set. If this property is explicitly set to off, the normalization property must either not be explicitly set or be set to none. The default value for the utf8only property is off. This property cannot be changed after the file system is created
162 | prop_quota=Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit.
Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
163 | prop_volblocksize=For volumes, specifies the block size of the volume. The blocksize cannot be changed once the volume has been written, so it should be set at volume creation time. The default blocksize for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
This property can also be referred to by its shortened column name, volblock.
164 | prop_volmode=This property specifies how volumes should be exposed to the OS. Setting it to full exposes volumes as fully fledged block devices, providing maximal functionality. The value geom is just an alias for full and is kept for compatibility. Setting it to dev hides its partitions. Volumes with property set to none are not exposed outside ZFS, but can be snapshotted, cloned, replicated, etc, that can be suitable for backup purposes. Value default means that volumes exposition is controlled by system-wide tunable zvol_volmode, where full, dev and none are encoded as 1, 2 and 3 respectively. The default value is full.
165 | prop_volsize=For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a refreservation is set instead. Any changes to volsize are reflected in an equivalent change to the reservation (or refreservation). The volsize can only be set to a multiple of volblocksize, and cannot be zero.
The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
Though not recommended, a "sparse volume" (also known as "thin provisioned") can be created by specifying the -s option to the zfs create -V command, or by changing the value of the refreservation property (or reservation property on pool version 8 or earlier) after the volume has been created. A "sparse volume" is a volume where the value of refreservation is less than the size of the volume plus the space required to store its metadata. Consequently, writes to a sparse volume can fail with ENOSPC when the pool is low on space. For a sparse volume, changes to volsize are not reflected in the refreservation. A volume that is not sparse is said to be "thick provisioned". A sparse volume can become thick provisioned by setting refreservation to auto.
166 | prop_written=The amount of referenced space written to this dataset since the previous snapshot.
167 | prop_xattr=Controls whether extended attributes are enabled for this file system. The default value is on.
168 | prop_zoned=Controls whether the dataset is managed from a non-global zone. Zones are a Solaris feature and are not relevant on other platforms. The default value is off.
The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the zfs create or zpool create commands, these properties are inherited from the parent dataset. If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
169 |
170 | #zpool property descriptions
171 | prop_allocated=Amount of storage space within the pool that has been physically allocated.
172 | prop_altroot=Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. altroot is not a persistent property. It is valid only while the system is up. Setting altroot defaults to using cachefile=none, though this may be overridden using an explicit setting.
173 | prop_ashift=Pool sector size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be set to the specified size, so this represents a space vs. performance trade-off. The typical case for setting this property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors to the OS (for compatibility reasons); in that case, set ashift=12 (which is 1<<12 = 4096). For optimal performance, the pool sector size should be greater than or equal to the sector size of the underlying disks. Since the property cannot be changed after pool creation, if in a given pool, you ever want to use drives that report 4KiB sectors, you must set ashift=12 at pool creation time.
174 | prop_autoexpand=Controls automatic pool expansion when the underlying LUN is grown. If set to "on", the pool will be resized according to the size of the expanded device. If the device is part of a mirror or raidz then all devices within that mirror/raidz group must be expanded before the new space is made available to the pool. The default behavior is "off". This property can also be referred to by its shortened column name, expand.
175 | prop_autoreplace=Controls automatic device replacement. If set to "off", device replacement must be initiated by the administrator by using the "zpool replace" command. If set to "on", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "off". This property can also be referred to by its shortened column name, "replace".
176 | prop_autotrim=When set to on space which has been recently freed, and is no longer allocated by the pool, will be periodically trimmed. This allows block device vdevs which support BLKDISCARD, such as SSDs, or file vdevs on which the underlying file system supports hole-punching, to reclaim unused blocks. The default setting for this property is off.
Automatic TRIM does not immediately reclaim blocks after a free. Instead, it will optimistically delay allowing smaller ranges to be aggregated in to a few larger ones. These can then be issued more efficiently to the storage. TRIM on L2ARC devices is enabled by setting l2arc_trim_ahead > 0.
Be aware that automatic trimming of recently freed data blocks can put significant stress on the underlying storage devices. This will vary depending of how well the specific device handles these commands. For lower end devices it is often possible to achieve most of the benefits of automatic trimming by running an on-demand (manual) TRIM periodically using the zpool trim command.
177 | prop_bootfs=Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
178 | prop_cachefile=Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "zpool import -c". Setting it to the special value "none" creates a temporary pool that is never cached, and the special value '' (empty string) uses the default location.
179 | prop_capacity=Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
180 | #prop_checkpoint=
181 | prop_comment=A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted. An administrator can provide additional information about a pool using this property.
182 | prop_dedupratio=The deduplication ratio specified for a pool, expressed as a multiplier. For example, a dedupratio value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See zfs(8) for a description of the deduplication feature.
183 | prop_delegation=Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See zfs(8) for more information on ZFS delegated administration.
184 | prop_expandsize=Amount of uninitialized space within the pool or device that can be used to increase the total capacity of the pool. Uninitialized space consists of any space on an EFI labeled vdev which has not been brought online (i.e. zpool online -e). This space occurs when a LUN is dynamically expanded.
185 | prop_failmode=Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows:
wait Blocks all I/O access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
continue Returns EIO to any new write I/O requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked.
panic Prints out a message to the console and generates a system crash dump.
186 | prop_feature@allocation_classes=GUID org.zfsonlinux:allocation_classes
READ-ONLY COMPATIBLE yes
DEPENDENCIES none
This feature enables support for separate allocation classes.
This feature becomes active when a dedicated allocation class vdev (dedup or special) is created with the zpool create or zpool add subcommands. With device removal, it can be returned to the enabled state if all the dedicated allocation class vdevs are removed.
187 | prop_feature@large_dnode=GUID org.zfsonlinux:large_dnode
READ-ONLY COMPATIBLE no
DEPENDENCIES extensible_dataset
The large_dnode feature allows the size of dnodes in a dataset to be set larger than 512B.
This feature becomes active once a dataset contains an object with a dnode larger than 512B, which occurs as a result of setting the dnodesize dataset property to a value other than legacy. The feature will return to being enabled once all filesystems that have ever contained a dnode larger than 512B are destroyed. Large dnodes allow more data to be stored in the bonus buffer, thus potentially improving performance by avoiding the use of spill blocks.
188 | prop_feature@livelist=GUID com.delphix:livelist
READ-ONLY COMPATIBLE yes
DEPENDENCIES none
This feature allows clones to be deleted faster than the traditional method when a large number of random/sparse writes have been made to the clone. All blocks allocated and freed after a clone is created are tracked by the the clone's livelist which is referenced during the deletion of the clone. The feature is activated when a clone is created and remains active until all clones have been destroyed.
189 | prop_feature@log_spacemap=GUID com.delphix:log_spacemap
READ-ONLY COMPATIBLE yes
DEPENDENCIES com.delphix:spacemap_v2
This feature improves performance for heavily-fragmented pools, especially when workloads are heavy in random-writes. It does so by logging all the metaslab changes on a single spacemap every TXG instead of scattering multiple writes to all the metaslab spacemaps.
This feature becomes active as soon as it is enabled and will never return to being enabled.
190 | prop_feature@project_quota=GUID org.zfsonlinux:project_quota
READ-ONLY COMPATIBLE yes
DEPENDENCIES extensible_dataset
This feature allows administrators to account the spaces and objects usage information against the project identifier (ID).
The project ID is new object-based attribute. When upgrading an existing filesystem, object without project ID attribute will be assigned a zero project ID. After this feature is enabled> parent inherit flag is set (via chattr +/-P or zfs project [-s|-C]). Otherwise, the new object's project ID will be set as zero. An object's project ID can be changed at anytime by the owner (or privileged user) via chattr -p $prjid or zfs project -p $prjid.
This feature will become active as soon as it is enabled and will never return to being disabled. Each filesystem will be upgraded automatically when remounted or when new file is created under that filesystem. The upgrade can also be triggered on filesystems via `zfs set version=current `. The upgrade process runs in the background and may take a while to complete for the filesystems containing a large number of files.
191 | prop_feature@redaction_bookmarks=GUID com.delphix:redaction_bookmarks
READ-ONLY COMPATIBLE no
DEPENDENCIES bookmarks, extensible_dataset
This feature enables the use of the redacted zfs send. Redacted zfs send creates redaction bookmarks, which store the list of blocks redacted by the send that created them. For more information about redacted send, see zfs(8).
192 | prop_fragmentation=The amount of fragmentation in the pool.
193 | prop_free=Number of blocks within the pool that are not allocated.
194 | prop_freeing=After a file system or snapshot is destroyed, the space it was using is returned to the pool asynchronously. freeing is the amount of space remaining to be reclaimed. Over time freeing will decrease while free increases.\
195 | prop_health=The current health of the pool. Health can be "ONLINE", "DEGRADED", "FAULTED", "OFFLINE", "REMOVED", or "UNAVAIL".
196 | #prop_leaked=
197 | prop_listsnapshots=Controls whether information about snapshots associated with this pool is output when "zfs list" is run without the -t option. The default value is off.
198 | prop_load_guid=A unique identifier for the pool. Unlike the guid property, this identifier is generated every time we load the pool (e.g. does not persist across imports/exports) and never changes while the pool is loaded (even if a reguid operation takes place).
199 | prop_multihost=Controls whether a pool activity check should be performed during zpool import. When a pool is determined to be active it cannot be imported, even with the -f option. This property is intended to be used in failover configurations where multiple hosts have access to a pool on shared storage.
Multihost provides protection on import only. It does not protect against an individual device being used in multiple pools, regardless of the type of vdev. See the discussion under zpool create.
When this property is on, periodic writes to storage occur to show the pool is in use. See zfs_multihost_interval in the zfs-module-parameters(5) man page. In order to enable this property each host must set a unique hostid. See genhostid(1) zgenhostid(8) spl-module-parameters(5) for additional details. The default value is off.
200 | prop_size=Total size of the storage pool.
201 | prop_version=The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the zpool upgrade command, though this property can be used when a specific version is needed for backwards compatibility. Once feature flags are enabled on a pool this property will no longer have a value.
202 |
203 |
204 | #snapshot property descriptiosn
205 | prop_defer_destroy=This property is on if the snapshot has been marked for deferred destroy by using the zfs destroy -d command. Otherwise, the property is off.
206 | prop_origin=For cloned file systems or volumes, the snapshot from which the clone was created. See also the clones property.
207 |
--------------------------------------------------------------------------------
/module.info:
--------------------------------------------------------------------------------
1 | desc=ZFS Manager
2 | name=ZFS
3 | longdesc_en=ZFS administration utility for webmin
4 | category=hardware
5 | os_support=*-linux freebsd solaris
6 |
--------------------------------------------------------------------------------
/property-list-en.pl:
--------------------------------------------------------------------------------
1 | BEGIN { push(@INC, ".."); };
2 | use WebminCore;
3 | init_config();
4 |
5 | sub property_desc
6 | #deprecated, migrate all to lang/en
7 | {
8 | my %hash = ( 'dedupditto' => 'Threshold for the number of block ditto copies. If the reference
9 | count for a deduplicated block increases above this number, a new
10 | ditto copy of this block is automatically stored. Default setting is
11 | 0.',
12 |
13 | 'feature@async_destroy' => 'GUID com.delphix:async_destroy
14 | READ-ONLY COMPATIBLE yes
15 | DEPENDENCIES none
16 |
17 | Destroying a file system requires traversing all of its data in order to return its used space to the pool. Without async_destroy
18 | the file system is not fully removed until all space has been reclaimed. If the destroy operation is interrupted by a reboot or
19 | power outage the next attempt to open the pool will need to complete the destroy operation synchronously.
20 |
21 | When async_destroy is enabled the file system\'s data will be reclaimed by a background process, allowing the destroy operation to
22 | complete without traversing the entire file system. The background process is able to resume interrupted destroys after the pool
23 | has been opened, eliminating the need to finish interrupted destroys as part of the open operation. The amount of space remaining
24 | to be reclaimed by the background process is available through the freeing property.
25 |
26 | This feature is only active while freeing is non-zero.',
27 |
28 | 'feature@bookmark_v2' => 'GUID com.datto:bookmark_v2
29 | READ-ONLY COMPATIBLE no
30 | DEPENDENCIES bookmark, extensible_dataset
31 |
32 | This feature enables the creation and management of larger bookmarks which are needed for other features in ZFS.
33 |
34 | This feature becomes active when a v2 bookmark is created and will be returned to the enabled state when all v2 bookmarks are destroyed.',
35 |
36 | 'feature@bookmark_written' => 'GUID com.delphix:bookmark_written
37 | READ-ONLY COMPATIBLE no
38 | DEPENDENCIES bookmark, extensible_dataset, bookmark_v2
39 |
40 | This feature enables additional bookmark accounting fields, enabling the written# property (space written since a bookmark) and estimates of send stream sizes for incrementals from bookmarks.
41 |
42 | This feature becomes active when a bookmark is created and will be returned to the enabled state when all bookmarks with these
43 | fields are destroyed.',
44 |
45 | 'feature@bookmarks' => 'GUID com.delphix:bookmarks
46 | READ-ONLY COMPATIBLE yes
47 | DEPENDENCIES extensible_dataset
48 |
49 | This feature enables use of the zfs bookmark subcommand.
50 |
51 | This feature is active while any bookmarks exist in the pool. All bookmarks in the pool can be listed by
52 | running zfs list -t bookmark -r poolname.',
53 |
54 | 'feature@device_rebuild' => 'GUID org.openzfs:device_rebuild
55 | READ-ONLY COMPATIBLE yes
56 | DEPENDENCIES none
57 |
58 | This feature enables the ability for the zpool attach and zpool replace subcommands to perform sequential reconstruction (instead of
59 | healing reconstruction) when resilvering.
60 |
61 | Sequential reconstruction resilvers a device in LBA order without immediately verifying the checksums. Once complete a scrub is
62 | started which then verifies the checksums. This approach allows full redundancy to be restored to the pool in the minimum amount of
63 | time. This two phase approach will take longer than a healing resilver when the time to verify the checksums is included. However,
64 | unless there is additional pool damage no checksum errors should be reported by the scrub. This feature is incompatible with raidz
65 | configurations.',
66 |
67 | 'feature@device_removal' => 'GUID com.delphix:device_removal
68 | READ-ONLY COMPATIBLE no
69 | DEPENDENCIES none
70 |
71 | This feature enables the zpool remove subcommand to remove top-level vdevs, evacuating them to reduce the total size of the pool.
72 |
73 | This feature becomes active when the zpool remove subcommand is used on a top-level vdev, and will never return to being enabled.',
74 |
75 | 'feature@edonr' => 'GUID org.illumos:edonr
76 | READ-ONLY COMPATIBLE no
77 | DEPENDENCIES extensible_dataset
78 |
79 | This feature enables the use of the Edon-R hash algorithm for checksum, including for nopwrite (if compression is also enabled, an
80 | overwrite of a block whose checksum matches the data being written will be ignored). In an abundance of caution, Edon-R requires
81 | verification when used with dedup: zfs set dedup=edonr,verify. See zfs(8).
82 |
83 | Edon-R is a very high-performance hash algorithm that was part of the NIST SHA-3 competition. It provides extremely high hash performance (over 350% faster than SHA-256), but was not selected because of its unsuitability as a general purpose secure hash algorithm. This implementation utilizes the new salted checksumming functionality in ZFS, which means that the checksum is pre-seeded
84 | with a secret 256-bit random key (stored on the pool) before being fed the data block to be checksummed. Thus the produced checksums
85 | are unique to a given pool.
86 |
87 | When the edonr feature is set to enabled, the administrator can turn on the edonr checksum on any dataset using the zfs set checksum=edonr. See zfs(8). This feature becomes active once a checksum property has been set to edonr, and will return to being enabled
88 | once all filesystems that have ever had their checksum set to edonr are destroyed.
89 |
90 | FreeBSD does not support the edonr feature.',
91 |
92 |
93 | 'feature@embedded_data' => 'GUID com.delphix:embedded_data
94 | READ-ONLY COMPATIBLE no
95 | DEPENDENCIES none
96 |
97 | This feature improves the performance and compression ratio of highly-compressible blocks. Blocks whose con-
98 | tents can compress to 112 bytes or smaller can take advantage of this feature.
99 |
100 | When this feature is enabled, the contents of highly-compressible blocks are stored in the block "pointer"
101 | itself (a misnomer in this case, as it contains the compresseed data, rather than a pointer to its location
102 | on disk). Thus the space of the block (one sector, typically 512 bytes or 4KB) is saved, and no additional
103 | i/o is needed to read and write the data block.
104 |
105 | This feature becomes active as soon as it is enabled and will never return to being enabled.',
106 |
107 | 'feature@empty_bpobj' => 'GUID com.delphix:empty_bpobj
108 | READ-ONLY COMPATIBLE yes
109 | DEPENDENCIES none
110 |
111 | This feature increases the performance of creating and using a large number of snapshots of a single filesystem or volume, and
112 | also reduces the disk space required.
113 |
114 | When there are many snapshots, each snapshot uses many Block Pointer Objects (bpobj\'s) to track blocks associated with that snap
115 | shot. However, in common use cases, most of these bpobj\'s are empty. This feature allows us to create each bpobj on-demand, thus
116 | eliminating the empty bpobjs.
117 |
118 | This feature is active while there are any filesystems, volumes, or snapshots which were created after enabling this feature.',
119 |
120 |
121 | 'feature@extensible_dataset' => 'GUID com.delphix:extensible_dataset
122 | READ-ONLY COMPATIBLE no
123 | DEPENDENCIES none
124 |
125 | This feature allows more flexible use of internal ZFS data structures, and exists for other features to
126 | depend on.
127 |
128 | This feature will be active when the first dependent feature uses it, and will be returned to the enabled
129 | state when all datasets that use this feature are destroyed.',
130 |
131 | 'feature@enabled_txg' => 'GUID com.delphix:enabled_txg
132 | READ-ONLY COMPATIBLE yes
133 | DEPENDENCIES none
134 |
135 | Once this feature is enabled ZFS records the transaction group number in which new features are enabled. This
136 | has no user-visible impact, but other features may depend on this feature.
137 |
138 | This feature becomes active as soon as it is enabled and will never return to being enabled.',
139 |
140 | 'feature@encryption' => 'GUID com.datto:encryption
141 | READ-ONLY COMPATIBLE no
142 | DEPENDENCIES bookmark_v2, extensible_dataset
143 |
144 | This feature enables the creation and management of natively encrypted datasets.
145 |
146 | This feature becomes active when an encrypted dataset is created and will be returned to the enabled state when all datasets that
147 | use this feature are destroyed.',
148 |
149 | 'feature@filesystem_limits' => 'GUID com.joyent:filesystem_limits
150 | READ-ONLY COMPATIBLE yes
151 | DEPENDENCIES extensible_dataset
152 |
153 | This feature enables filesystem and snapshot limits. These limits can be used to control how many filesystems and/or snapshots
154 | can be created at the point in the tree on which the limits are set.
155 |
156 | This feature is active once either of the limit properties has been set on a dataset. Once activated the feature is never deactivated.',
157 |
158 | 'feature@hole_birth' => 'GUID com.delphix:hole_birth
159 | READ-ONLY COMPATIBLE no
160 | DEPENDENCIES enabled_txg
161 |
162 | This feature improves performance of incremental sends ("zfs send -i") and receives for objects with many
163 | holes. The most common case of hole-filled objects is zvols.
164 |
165 | An incremental send stream from snapshot A to snapshot B contains information about every block that changed
166 | between A and B. Blocks which did not change between those snapshots can be identified and omitted from the
167 | stream using a piece of metadata called the ’block birth time’, but birth times are not recorded for holes
168 | (blocks filled only with zeroes). Since holes created after A cannot be distinguished from holes created
169 | before A, information about every hole in the entire filesystem or zvol is included in the send stream.
170 |
171 | For workloads where holes are rare this is not a problem. However, when incrementally replicating filesystems
172 | or zvols with many holes (for example a zvol formatted with another filesystem) a lot of time will be spent
173 | sending and receiving unnecessary information about holes that already exist on the receiving side.
174 |
175 | Once the hole_birth feature has been enabled the block birth times of all new holes will be recorded. Incre-
176 | mental sends between snapshots created after this feature is enabled will use this new metadata to avoid
177 | sending information about holes that already exist on the receiving side.
178 |
179 | This feature becomes active as soon as it is enabled and will never return to being enabled.',
180 |
181 |
182 | 'feature@large_blocks' => 'GUID org.open-zfs:large_block
183 | READ-ONLY COMPATIBLE no
184 | DEPENDENCIES extensible_dataset
185 |
186 | The large_block feature allows the record size on a dataset to be set larger than 128KB.
187 |
188 | This feature becomes active once a recordsize property has been set larger than 128KB, and will return to being enabled once all
189 | filesystems that have ever had their recordsize larger than 128KB are destroyed.',
190 |
191 | 'feature@lz4_compress' => 'GUID org.illumos:lz4_compress
192 | READ-ONLY COMPATIBLE no
193 | DEPENDENCIES none
194 |
195 | lz4 is a high-performance real-time compression algorithm that features significantly faster compression and decompression as well
196 | as a higher compression ratio than the older lzjb compression. Typically, lz4 compression is approximately 50% faster on compressible
197 | data and 200% faster on incompressible data than lzjb. It is also approximately 80% faster on decompression, while giving
198 | approximately 10% better compression ratio.
199 |
200 | When the lz4_compress feature is set to enabled, the administrator can turn on lz4 compression on any dataset on the pool using
201 | the zfs(8) command. Please note that doing so will immediately activate the lz4_compress feature on the underlying pool (even
202 | before any data is written). Since this feature is not read-only compatible, this operation will render the pool unimportable on
203 | systems without support for the lz4_compress feature. At the moment, this operation cannot be reversed. Booting off of lz4-compressed root pools is supported.',
204 |
205 |
206 | 'feature@multi_vdev_crash_dump' => 'GUID com.joyent:multi_vdev_crash_dump
207 | READ-ONLY COMPATIBLE no
208 | DEPENDENCIES none
209 |
210 | This feature allows a dump device to be configured with a pool comprised of multiple vdevs. Those vdevs may be arranged in any mirrored or raidz configuration.
211 |
212 | When the multi_vdev_crash_dump feature is set to enabled, the administrator can use the dumpadm(1M) command to configure a dump device on a pool comprised of multiple vdevs.
213 |
214 | Under FreeBSD and Linux this feature is registered for compatibility but not used. New pools created under FreeBSD and Linux will
215 | have the feature enabled but will never transition to active. This functionality is not required in order to support crash dumps
216 | under FreeBSD and Linux. Existing pools where this feature is active can be imported.',
217 |
218 | 'feature@obsolete_counts' => 'GUID com.delphix:obsolete_counts
219 | READ-ONLY COMPATIBLE yes
220 | DEPENDENCIES device_removal
221 |
222 | This feature is an enhancement of device_removal, which will over time reduce the memory used to track removed devices. When indirect blocks are freed or remapped, we note that their part of the indirect mapping is "obsolete", i.e. no longer needed.
223 |
224 | This feature becomes active when the zpool remove subcommand is used on a top-level vdev, and will never return to being enabled.',
225 |
226 | 'feature@redacted_datasets' => 'redacted_datasets
227 |
228 | GUID com.delphix:redacted_datasets
229 | READ-ONLY COMPATIBLE no
230 | DEPENDENCIES extensible_dataset
231 |
232 | This feature enables the receiving of redacted zfs send streams. Redacted zfs send streams create redacted datasets when received.
233 | These datasets are missing some of their blocks, and so cannot be safely mounted, and their contents cannot be safely read. For
234 | more information about redacted receive, see zfs(8).',
235 |
236 | 'feature@redacted_bookmarks' => 'GUID com.delphix:redaction_bookmarks
237 | READ-ONLY COMPATIBLE no
238 | DEPENDENCIES bookmarks, extensible_dataset
239 |
240 | This feature enables the use of the redacted zfs send. Redacted zfs send creates redaction bookmarks, which store the list of
241 | blocks redacted by the send that created them. For more information about redacted send, see zfs(8).',
242 |
243 | 'feature@resilver_defer' => 'GUID com.datto:resilver_defer
244 | READ-ONLY COMPATIBLE yes
245 | DEPENDENCIES none
246 |
247 | This feature allows zfs to postpone new resilvers if an existing one is already in progress. Without this feature, any new resilvers
248 | will cause the currently running one to be immediately restarted from the beginning.
249 |
250 | This feature becomes active once a resilver has been deferred, and returns to being enabled when the deferred resilver begins.',
251 |
252 | 'feature@sha512' => 'GUID org.illumos:sha512
253 | READ-ONLY COMPATIBLE no
254 | DEPENDENCIES extensible_dataset
255 |
256 | This feature enables the use of the SHA-512/256 truncated hash algorithm (FIPS 180-4) for checksum and dedup. The native 64-bit
257 | arithmetic of SHA-512 provides an approximate 50% performance boost over SHA-256 on 64-bit hardware and is thus a good minimum-
258 | change replacement candidate for systems where hash performance is important, but these systems cannot for whatever reason utilize
259 | the faster skein and edonr algorithms.
260 |
261 | When the sha512 feature is set to enabled, the administrator can turn on the sha512 checksum on any dataset using zfs set checksum=sha512. See zfs(8). This feature becomes active once a checksum property has been set to sha512, and will return to being enabled once all filesystems that have ever had their checksum set to sha512 are destroyed.',
262 |
263 | 'feature@skein' => 'GUID org.illumos:skein
264 | READ-ONLY COMPATIBLE no
265 | DEPENDENCIES extensible_dataset
266 |
267 | This feature enables the use of the Skein hash algorithm for checksum and dedup. Skein is a high-performance secure hash algorithm
268 | that was a finalist in the NIST SHA-3 competition. It provides a very high security margin and high performance on 64-bit hardware
269 | (80% faster than SHA-256). This implementation also utilizes the new salted checksumming functionality in ZFS, which means that the
270 | checksum is pre-seeded with a secret 256-bit random key (stored on the pool) before being fed the data block to be checksummed. Thus
271 | the produced checksums are unique to a given pool, preventing hash collision attacks on systems with dedup.
272 |
273 | When the skein feature is set to enabled, the administrator can turn on the skein checksum on any dataset using zfs set checksum=skein. See zfs(8). This feature becomes active once a checksum property has been set to skein, and will return to being enabled
274 | once all filesystems that have ever had their checksum set to skein are destroyed.',
275 |
276 | 'feature@spacemap_histogram' => 'GUID com.delphix:spacemap_histogram
277 | READ-ONLY COMPATIBLE yes
278 | DEPENDENCIES none
279 |
280 | This features allows ZFS to maintain more information about how free space is organized within the pool. If
281 | this feature is enabled, ZFS will set this feature to active when a new space map object is created or an
282 | existing space map is upgraded to the new format. Once the feature is active, it will remain in that state
283 | until the pool is destroyed.',
284 |
285 | 'feature@spacemap_v2' => 'GUID com.delphix:spacemap_v2
286 | READ-ONLY COMPATIBLE yes
287 | DEPENDENCIES none
288 |
289 | This feature enables the use of the new space map encoding which consists of two words (instead of one) whenever it is advantageous.
290 | The new encoding allows space maps to represent large regions of space more efficiently on-disk while also increasing their maximum
291 | addressable offset.
292 |
293 | This feature becomes active once it is enabled, and never returns back to being enabled.',
294 |
295 | 'feature@userobj_accounting' => 'GUID org.zfsonlinux:userobj_accounting
296 | READ-ONLY COMPATIBLE yes
297 | DEPENDENCIES extensible_dataset
298 |
299 | This feature allows administrators to account the object usage information by user and group.
300 |
301 | This feature becomes active as soon as it is enabled and will never return to being enabled. Each filesystem will be upgraded automatically when remounted, or when new files are created under that filesystem. The upgrade can also be started manually on filesystems by running `zfs set version=current `. The upgrade process runs in the background and may take a while to complete for
302 | filesystems containing a large number of files.',
303 |
304 | 'feature@zpool_checkpoint' => 'GUID com.delphix:zpool_checkpoint
305 | READ-ONLY COMPATIBLE yes
306 | DEPENDENCIES none
307 |
308 | This feature enables the zpool checkpoint subcommand that can checkpoint the state of the pool at the time it was issued and later
309 | rewind back to it or discard it.
310 |
311 | This feature becomes active when the zpool checkpoint subcommand is used to checkpoint the pool. The feature will only return back
312 | to being enabled when the pool is rewound or the checkpoint has been discarded.',
313 |
314 | 'feature@zstd_compress' => 'GUID org.freebsd:zstd_compress
315 | READ-ONLY COMPATIBLE no
316 | DEPENDENCIES extensible_dataset
317 |
318 | zstd is a high-performance compression algorithm that features a combination of high compression ratios and high speed. Compared to
319 | gzip, zstd offers slighty better compression at much higher speeds. Compared to lz4, zstd offers much better compression while being
320 | only modestly slower. Typically, zstd compression speed ranges from 250 to 500 MB/s per thread and decompression speed is over 1
321 | GB/s per thread.
322 |
323 | When the zstd feature is set to enabled, the administrator can turn on zstd compression of any dataset by running `zfs set compress=zstd `.
324 |
325 | This feature becomes active once a compress property has been set to zstd, and will return to being enabled once all filesystems
326 | that have ever had their compress property set to zstd are destroyed.
327 |
328 | Booting off of zstd-compressed root pools is not yet supported.',
329 |
330 |
331 | 'setuid' => 'Controls whether the set-UID bit is respected for the file system.
332 | The default value is "on".',
333 |
334 |
335 | 'vscan' => 'Controls whether regular files should be scanned for viruses when a
336 | file is opened and closed. In addition to enabling this property,
337 | the virus scan service must also be enabled for virus scanning to
338 | occur. The default value is "off".',
339 |
340 | );
341 | return %hash;
342 | }
343 |
344 |
--------------------------------------------------------------------------------
/property.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | require './property-list-en.pl';
5 | ReadParse();
6 | use Data::Dumper;
7 | ui_print_header(undef, $text{'property_title'}, "", undef, 1, 1);
8 | %props = property_desc();
9 | %pool_proplist = pool_properties_list();
10 | %proplist = properties_list();
11 |
12 | print ui_table_start("$text{'property_title'}: $in{'property'}", "width=100%", "10", ['align=left'] );
13 | if ($in{'zfs'}) {
14 | %get = zfs_get($in{'zfs'}, $in{'property'});
15 | print "File system: ".$in{'zfs'}."
";
16 | print "Property: ", $in{'property'}, " is currently: ", $get{$in{'zfs'}}{$in{'property'}}{value}, "
";
17 | print "Source: ", $get{$in{'zfs'}}{$in{'property'}}{source}."";
18 | print "
";
19 | print "
";
20 | } elsif ($in{'pool'}) {
21 | %get = zpool_get($in{'pool'}, $in{'property'});
22 | print "Pool: ".$in{'pool'}."
";
23 | print "Property: ", $in{'property'}, " is currently: ", $get{$in{'pool'}}{$in{'property'}}{value}, "
";
24 | print "Source: ", $get{$in{'pool'}}{$in{'property'}}{source}."
";
25 | print "
";
26 | }
27 |
28 | if ($props{$in{'property'}})
29 | {
30 | print "Description:
";
31 | print $props{$in{'property'}};
32 | print "
";
33 | print "
";
34 | }
35 |
36 | if ($text{'prop_'.$in{'property'}})
37 | {
38 | print "Description:
";
39 | print $text{'prop_'.$in{'property'}};
40 | print "
";
41 | print "
";
42 | }
43 | print ui_table_end();
44 |
45 | #this is where we see if we can/and how to edit zfs properties
46 | if (can_edit($in{'zfs'}, $in{'property'}) =~ 1) {
47 | print ui_form_start('cmd.cgi', 'post');
48 | print ui_hidden('property', $in{'property'});
49 | print ui_hidden('zfs', $in{'zfs'});
50 | print ui_hidden('pool', $in{'pool'});
51 | if ($in{'property'} =~ 'keystatus' and $get{$in{'zfs'}}{$in{'property'}}{value} =~ 'unavailable') {
52 | print ui_hidden('cmd', 'load-key');
53 | print "Load key";
54 | #print ui_submit('submit'), "
";
55 | } elsif ($in{'property'} =~ 'mountpoint') {
56 | print ui_hidden('cmd', 'setzfs');
57 | print ui_filebox('set', $get{$in{'zfs'}}{$in{'property'}}{value}, 0, undef, undef, 1);
58 | print ui_submit('submit'), "
";
59 | } elsif ($in{'property'} =~ 'mounted') {
60 | if ($get{$in{'zfs'}}{$in{'property'}}{value} =~ 'yes') {
61 | #fix this to a post command
62 | print ui_hidden('cmd', "unmount");
63 | print "Unmount this file system";
64 | } else {
65 | print ui_hidden('cmd', "mount");
66 | print "Mount this file system";
67 | }
68 | } elsif ($in{'property'} =~ 'comment') {
69 | print ui_hidden('cmd', 'setpool') ;
70 | print "Comment (limited to 32 characters): ".ui_textbox('set', $get{$in{'pool'}}{$in{'property'}}{value}, 32)."
";
71 | print ui_submit('submit', "
");
72 |
73 | } elsif ($in{'property'} =~ 'sharesmb') {
74 |
75 | } elsif ($in{'property'} =~ 'sharenfs') {
76 |
77 | } elsif ($in{'property'} =~ 'utf8only') {
78 |
79 | } elsif ($proplist{$in{'property'}} =~ 'text') {
80 |
81 | print "", ($in{'zfs'}) ? ui_hidden('cmd', 'setzfs') : "";
82 | print "Set ".$in{'property'}.": ".ui_textbox('set', $get{$in{'zfs'}}{$in{'property'}}{value});
83 | print ui_submit('submit'), "
";
84 |
85 | } elsif ($proplist{$in{'property'}} =~ 'special' || $pool_proplist{$in{'property'}} =~ 'special') {
86 |
87 | } elsif ($in{'property'} =~ /feature@/) {
88 | print ui_hidden('cmd', 'setpool');
89 | if ($get{$in{'pool'}}{$in{'property'}}{value} =~ 'disabled') {
90 | my @select = ['enabled', 'disabled'];
91 | print "Change to: ", ui_select('set', $get{$in{'pool'}}{$in{'property'}}{value}, @select, 1, 0, 1);
92 | print "
";
93 | print ui_submit('submit');
94 | print "
";
95 | }
96 | } else {
97 |
98 | if ($in{'zfs'}) {
99 | print ui_hidden('cmd', 'setzfs');
100 | my @select = [ split(", ", $proplist{$in{'property'}}), 'inherit' ];
101 | if ($proplist{$in{'property'}} eq 'boolean') { @select = [ 'on', 'off', 'inherit' ]; }
102 | print "Change to: ";
103 | #The following line was specifically added when com.sun:auto-snapshot does not have a value
104 | if ($get{$in{'zfs'}}{$in{'property'}}{value} eq "-") { $get{$in{'zfs'}}{$in{'property'}}{value} = 'inherit'; }
105 | print ui_select('set', $get{$in{'zfs'}}{$in{'property'}}{value}, @select, 1, 0, 1);
106 | }
107 | elsif ($in{'pool'}) {
108 | print ui_hidden('cmd', 'setpool') ;
109 | my @select = [ split(", ", $pool_proplist{$in{'property'}}) ];
110 | if ($pool_proplist{$in{'property'}} eq 'boolean') { @select = [ 'on', 'off' ]; }
111 | print ui_select('set', $get{$in{'pool'}}{$in{'property'}}{value}, @select, 1, 0, 1);
112 | }
113 | print ui_submit('submit');
114 | print "
";
115 | print "
";
116 | }
117 | print ui_form_end();
118 | }
119 |
120 | if ($in{'zfs'} && (index($in{'zfs'}, '@') != -1)) { ui_print_footer("status.cgi?snap=$in{'zfs'}", $in{'zfs'}); }
121 | if ($in{'zfs'} && (index($in{'zfs'}, '@') =~ -1)) { ui_print_footer("status.cgi?zfs=$in{'zfs'}", $in{'zfs'}); }
122 | if ($in{'pool'}) { ui_print_footer("status.cgi?pool=$in{'pool'}", $in{'pool'}); }
123 |
--------------------------------------------------------------------------------
/select.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | #deprecated
4 | require './zfsmanager-lib.pl';
5 | ReadParse();
6 | use Data::Dumper;
7 | popup_header($text{'select_title'});
8 |
9 | print ui_form_start("create.cgi", "post");
10 | print ui_table_start("Select VDEV");
11 | mount::generate_location("vdev", "");
12 | print ui_submit('Add to pool');
13 |
--------------------------------------------------------------------------------
/status.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | require './zfsmanager-lib.pl';
4 | ReadParse();
5 | use Data::Dumper;
6 |
7 | #show pool status
8 | if ($in{'pool'})
9 | {
10 | ui_print_header(undef, $text{'status_title'}, "", undef, 1, 1);
11 |
12 | #Show pool information
13 | ui_zpool_list($in{'pool'});
14 |
15 | #show properties for pool
16 | ui_zpool_properties($in{'pool'});
17 |
18 | #Show associated file systems
19 |
20 | ui_zfs_list("-r ".$in{'pool'});
21 |
22 | #Show device configuration
23 | #TODO: show devices by vdev hierarchy
24 | my %status = zpool_status($in{'pool'});
25 | print ui_columns_start([ "Virtual Device", "State", "Read", "Write", "Cksum" ]);
26 | foreach $key (sort {$a <=> $b} (keys %status))
27 | {
28 | if (($status{$key}{parent} =~ /pool/) && ($key != 0)) {
29 | print ui_columns_row(["".$status{$key}{name}."", $status{$key}{state}, $status{$key}{read}, $status{$key}{write}, $status{$key}{cksum}]);
30 | } elsif ($key != 0) {
31 | print ui_columns_row(["|_".$status{$key}{name}."", $status{$key}{state}, $status{$key}{read}, $status{$key}{write}, $status{$key}{cksum}]);
32 | }
33 |
34 | }
35 | print ui_columns_end();
36 | print ui_table_start("Status", "width=100%", "10");
37 | print ui_table_row("Scan:", $status{0}{scan});
38 | print ui_table_row("Read:", $status{0}{read});
39 | print ui_table_row("Write:", $status{0}{write});
40 | print ui_table_row("Checkum:", $status{0}{cksum});
41 | print ui_table_row("Errors:", $status{0}{errors});
42 | print ui_table_end();
43 |
44 | if ($status{0}{status} or $status{0}{action} or $status{pool}{see}) {
45 | print ui_table_start("Attention", "width=100%", "10");
46 | if ($status{0}{status}) { print ui_table_row("Status:", $status{0}{status}); }
47 | if ($status{0}{action}) { print ui_table_row("Action:", $status{0}{action}); }
48 | if ($status{0}{see}) { print ui_table_row("See:", $status{0}{see}); }
49 | print ui_table_end();
50 | }
51 |
52 |
53 | #--tasks table--
54 | print ui_table_start("Tasks", "width=100%", "10", ['align=left'] );
55 | if ($config{'zfs_properties'} =~ /1/) {
56 | print ui_table_row("New file system: ", "Create file system");
57 | }
58 | if ($config{'pool_properties'} =~ /1/) {
59 | if ($status{0}{scan} =~ /scrub in progress/) { print ui_table_row('Scrub ',"Stop scrub"); }
60 | else { print ui_table_row('Scrub ', "Scrub pool");}
61 | print ui_table_row('Upgrade ', "Upgrade pool");
62 | print ui_table_row('Export ', "Export pool");
63 | }
64 | if ($config{'pool_destroy'} =~ /1/) { print ui_table_row("Destroy ", "Destroy this pool"); }
65 | print ui_table_end();
66 |
67 | ui_print_footer('', $text{'index_return'});
68 | }
69 |
70 | #show filesystem status
71 | if ($in{'zfs'})
72 | {
73 | ui_print_header(undef, "ZFS File System", "", undef, 1, 1);
74 | #start status tab
75 | ui_zfs_list($in{'zfs'});
76 |
77 | #show properties for filesystem
78 | ui_zfs_properties($in{'zfs'});
79 |
80 | #show list of snapshots based on filesystem
81 | ui_list_snapshots('-rd1 '.$in{'zfs'}, 1);
82 | my %hash = zfs_get($in{'zfs'}, "all");
83 |
84 | #--tasks table--
85 | print ui_table_start("Tasks", "width=100%", "10");
86 | if ($config{'snap_properties'} =~ /1/) { print ui_table_row("Snapshot: ", ui_create_snapshot($in{'zfs'})); }
87 | if ($config{'zfs_properties'} =~ /1/) {
88 | print ui_table_row("New file system: ", "Create child file system");
89 | if (index($in{'zfs'}, '/') != -1) { print ui_table_row("Rename: ", "Rename ".$in{'zfs'}.""); }
90 | if ($hash{$in{'zfs'}}{origin}) { print ui_table_row("Promote: ", "This file system is a clone, promote $in{zfs}"); }
91 | }
92 | if ($config{'zfs_destroy'} =~ /1/) { print ui_table_row("Destroy: ", "Destroy this file system"); }
93 | print ui_table_end();
94 | ui_print_footer('index.cgi?mode=zfs', $text{'zfs_return'});
95 |
96 | }
97 |
98 | #show snapshot status
99 | #show status of current snapshot
100 | if ($in{'snap'})
101 | {
102 | ui_print_header(undef, $text{'snapshot_title'}, "", undef, 1, 1);
103 | %snapshot = list_snapshots($in{'snap'});
104 | print ui_columns_start([ "Snapshot", "Used", "Refer" ]);
105 | foreach $key (sort(keys %snapshot))
106 | {
107 | print ui_columns_row(["$snapshot{$key}{name}", $snapshot{$key}{used}, $snapshot{$key}{refer} ]);
108 | }
109 | print ui_columns_end();
110 | ui_zfs_properties($in{'snap'});
111 |
112 | my $zfs = $in{'snap'};
113 | $zfs =~ s/\@.*//;
114 |
115 | #--tasks table--
116 | print ui_table_start('Tasks', 'width=100%', undef);
117 | print ui_table_row('Differences', "Show differences in $in{'snap'}");
118 | if ($config{'snap_properties'} =~ /1/) {
119 | print ui_table_row("Snapshot: ", ui_create_snapshot($zfs));
120 | print ui_table_row("Rename: ", "Rename ".$in{'snap'}."");
121 | print ui_table_row("Send: ", "Send ".$in{'snap'}." to gzip");
122 | }
123 | if ($config{'zfs_properties'} =~ /1/) {
124 | print ui_table_row('Clone:', "Clone $in{'snap'} to new file system");
125 | print ui_table_row('Rollback:', "Rollback $zfs to $in{'snap'}");
126 | }
127 | if (($config{'snap_properties'} =~ /1/) && ($config{'zfs_properties'} =~ /1/)) {
128 | }
129 | if ($config{'snap_destroy'} =~ /1/) { print ui_table_row('Destroy:',"Destroy snapshot", ); }
130 | print ui_table_end();
131 | %parent = find_parent($in{'snap'});
132 | ui_print_footer('status.cgi?zfs='.$parent{'filesystem'}, $parent{'filesystem'});
133 | }
134 |
135 |
--------------------------------------------------------------------------------
/zfsmanager-lib.pl:
--------------------------------------------------------------------------------
1 | BEGIN { push(@INC, ".."); };
2 | use WebminCore;
3 | use POSIX qw(strftime);
4 | init_config();
5 | foreign_require("mount", "mount-lib.pl");
6 | my %access = &get_module_acl();
7 |
8 | sub properties_list
9 | #return hash of properties that can be set manually and their data type
10 | {
11 | my %list = ('atime' => 'boolean', 'devices' => 'boolean', 'exec' => 'boolean', 'nbmand' => 'boolean', 'readonly' => 'boolean', 'setuid' => 'boolean', 'shareiscsi' => 'boolean', 'utf8only' => 'boolean', 'vscan' => 'boolean', 'zoned' => 'boolean', 'relatime' => 'boolean', 'overlay' => 'boolean',
12 | 'aclinherit' => 'discard, noallow, restricted, passthrough, passthrough-x', 'aclmode' => 'discard, groupmaks, passthrough', 'casesensitivity' => 'sensitive, insensitive, mixed', 'checksum' => 'on, off, fletcher2, fletcher4, sha256', 'compression' => 'on, off, lzjb, lz4, gzip, gzip-1, gzip-2, gzip-3, gzip-4, gzip-5, gzip-6, gzip-7, gzip-8, gzip-9, zle, zstd', 'copies' => '1, 2, 3', 'dedup' => 'on, off, verify, sha256', 'logbias' => 'latency, throughput', 'normalization' => 'none, formC, formD, formKC, formKD', 'primarycache' => 'all, none, metadata', 'secondarycache' => 'all, none, metadata', 'snapdir' => 'hidden, visible', 'snapdev' => 'hidden, visible', 'sync' => 'standard, always, disabled', 'xattr' => 'on, off, sa', 'com.sun:auto-snapshot' => 'true, false', 'acltype' => 'noacl, posixacl', 'redundant_metadata' => 'all, most', 'recordsize' => '512, 1K, 2K, 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K, 1M', 'canmount' => 'on, off, noauto',
13 | 'keylocation' => 'text', 'keystatus' => 'special','quota' => 'text', 'refquota' => 'text', 'reservation' => 'text', 'refreservation' => 'text', 'volsize' => 'text', 'filesystem_limit' => 'text', 'snapshot_limit' => 'text',
14 | 'mountpoint' => 'special', 'sharesmb' => 'special', 'sharenfs' => 'special', 'mounted' => 'special', 'context' => 'special', 'defcontext' => 'special', 'fscontext' => 'special', 'rootcontext' => 'special');
15 | return %list;
16 | }
17 |
18 | sub pool_properties_list
19 | {
20 | my %list = ('autoexpand' => 'boolean', 'autoreplace' => 'boolean', 'delegation' => 'boolean', 'listsnapshots' => 'boolean',
21 | 'failmode' => 'wait, continue, panic', 'feature@async_destroy' => 'enabled, disabled', 'feature@empty_bpobj' => 'enabled, disabled', 'feature@lz4_compress' => 'enabled, disabled', 'feature@embedded_data' => 'enabled, disabled', 'feature@enabled_txg' => 'enabled, disabled', 'feature@bookmarks' => 'enabled, disabled', 'feature@hole_birth' => 'enabled, disabled', 'feature@spacemap_histogram' => 'enabled, disabled', 'feature@extensible_dataset' => 'enabled, disabled', 'feature@large_blocks' => 'enabled, disabled', 'feature@filesystem_limits' => 'enabled, disabled',
22 | 'altroot' => 'special', 'bootfs' => 'special', 'cachefile' => 'special', 'comment' => 'special');
23 | return %list;
24 | }
25 |
26 | sub create_opts #options and defaults when creating new pool or filesystem
27 | {
28 | my %list = ( 'atime' => 'on', 'compression' => 'off', 'canmount' => 'on', 'dedup' => 'off', 'exec' => 'on', 'readonly' => 'off', 'utf8only' => 'off', 'xattr' => 'on' );
29 | return %list;
30 | }
31 |
32 | sub get_zfsmanager_config
33 | {
34 | my $lref = &read_file_lines($module_config_file);
35 | my %rv;
36 | my $lnum = 0;
37 | foreach my $line (@$lref) {
38 | my ($n, $v) = split(/=/, $line, 2);
39 | if ($n) {
40 | $rv{$n} = $v;
41 | }
42 | $lnum++;
43 | }
44 | return %rv;
45 | }
46 |
47 | #determine if a property can be edited
48 | sub can_edit
49 | {
50 | my ($zfs, $property) = @_;
51 | %conf = get_zfsmanager_config();
52 | %zfs_props = properties_list();
53 | %pool_props = pool_properties_list();
54 | my %type = zfs_get($zfs, 'type');
55 | if ($type{$zfs}{type}{value} =~ 'snapshot') { return 0; }
56 | elsif ((($zfs_props{$property}) && ($config{'zfs_properties'} =~ /1/)) || (($pool_props{$property}) && ($config{'pool_properties'} =~ /1/))) { return 1; }
57 | }
58 |
59 | sub list_zpools
60 | {
61 | my ($pool) = @_;
62 | my %hash=();
63 | $list=`zpool list -H -o name,$config{'list_zpool'} $pool`;
64 |
65 | open my $fh, "<", \$list;
66 | while (my $line =<$fh>)
67 | {
68 | chomp ($line);
69 | my @props = split(" ", $line);
70 | $ct = 1;
71 | foreach $prop (split(",", $config{'list_zpool'})) {
72 | $hash{$props[0]}{$prop} = $props[$ct];
73 | $ct++;
74 | }
75 |
76 | }
77 | return %hash;
78 | }
79 |
80 | sub list_zfs
81 | {
82 | #zfs list
83 | my ($zfs) = @_;
84 | my %hash=();
85 | $list=`zfs list -H -o name,$config{'list_zfs'} $zfs`;
86 |
87 | open my $fh, "<", \$list;
88 | while (my $line =<$fh>)
89 | {
90 | chomp ($line);
91 | my @props = split(" ", $line);
92 | $ct = 1;
93 | foreach $prop (split(",", $config{'list_zfs'})) {
94 | $hash{$props[0]}{$prop} = $props[$ct];
95 | $ct++;
96 | }
97 | }
98 | return %hash;
99 | }
100 |
101 | sub list_snapshots
102 | {
103 | my ($snap) = @_;
104 | $list=`zfs list -t snapshot -H -o name,$config{'list_snap'} -s creation $snap`;
105 | $idx = 0;
106 | open my $fh, "<", \$list;
107 | while (my $line =<$fh>)
108 | {
109 | chomp ($line);
110 | my @props = split("\x09", $line);
111 | $ct = 0;
112 | foreach $prop (split(",", "name,".$config{'list_snap'})) {
113 | $hash{sprintf("%05d", $idx)}{$prop} = $props[$ct];
114 | $ct++;
115 | }
116 | $idx++;
117 | }
118 | return %hash;
119 | }
120 |
121 | sub get_alerts
122 | {
123 | my $alerts = `zpool status -x`;
124 | my %status = ();
125 | my $pool = ();
126 | if ($alerts =~ /all pools are healthy/)
127 | {
128 | return $alerts;
129 | } else
130 | {
131 | open my $fh, "<", \$alerts;
132 | while (my $line =<$fh>)
133 | {
134 | chomp ($line);
135 | $line =~ s/^\s*(.*?)\s*$/$1/;
136 | my($key, $value) = split(/:/, $line);
137 | $key =~ s/^\s*(.*?)\s*$/$1/;
138 | $value =~ s/^\s*(.*?)\s*$/$1/;
139 | if (($key =~ 'pool') && ($value))
140 | {
141 | $pool = $value;
142 | $status = ( $value );
143 | } elsif ((($key =~ 'state') || ($key =~ 'errors')) && ($value))
144 | {
145 | $status{$pool}{$key} = $value;
146 | }
147 | }
148 | my $out = "";
149 | foreach $key (sort(keys %status))
150 | {
151 | %zstat = zpool_status($key);
152 | $out .= "pool \'".$key."\' is ".$zstat{0}{state}." with ".$zstat{0}{errors}."
";
153 | if ($zstat{0}{status}) { $out .= "status: ".$zstat{0}{status}."
"; }
154 | $out .= "
";
155 | }
156 | $out .= "";
157 | return $out;
158 | }
159 | }
160 |
161 | #zpool_status($pool)
162 | sub zpool_status
163 | {
164 | my ($pool)=@_;
165 | my $parent = "pool";
166 | my %status = ();
167 | my $cmd=`zpool status $pool`;
168 | (undef, $cmdout) = split(/ pool: /, $cmd);
169 | ($status{0}{pool}, $cmdout) = split(/ state: /, $cmdout);
170 | chomp $status{0}{pool};
171 | if (index($cmd, "status: ") != -1) {
172 | ($status{0}{state}, $cmdout) = split("status: ", $cmdout);
173 | ($status{0}{status}, $cmdout) = split("action: ", $cmdout);
174 | if (index($cmd, " see: ") != -1) {
175 | ($status{0}{action}, $cmdout) = split(" see: ", $cmdout);
176 | ($status{0}{see}, $cmdout) = split(" scan: ", $cmdout);
177 | } else { ($status{0}{action}, $cmdout) = split(" scan: ", $cmdout); }
178 | } else {
179 | ($status{0}{state}, $cmdout) = split(" scan: ", $cmdout);
180 | }
181 | ($status{0}{scan}, $cmdout) = split("config:", $cmdout);
182 | ($status{0}{config}, $status{0}{errors}) = split("errors: ", $cmdout);
183 |
184 | $fh= $status{0}{config};
185 | @array = split("\n", $fh);
186 | foreach $line (@array) #while (my $line =<$fh>)
187 | {
188 | chomp ($line);
189 | my($name, $state, $read, $write, $cksum) = split(" ", $line);
190 |
191 | if ($name =~ "NAME") { #do nothing
192 | } elsif (($name =~ $status{0}{pool}) && (length($name) == length($status{0}{pool}))) {
193 | $status{0}{name} = $name;
194 | $status{0}{read} = $read;
195 | $status{0}{write} = $write;
196 | $status{0}{cksum} = $cksum;
197 | $devs++;
198 |
199 | #check if vdev is a log or cache vdev
200 | } elsif (($name =~ /log/) || ($name =~ /cache/))
201 | {
202 | $status{$devs} = {name => $name, state => $state, read => $read, write => $write, cksum => $cksum, parent => "pool",};
203 | $parent = $devs;
204 | $devs++;
205 |
206 | #check if vdev is a log or cache vdev
207 | } elsif (($name =~ /mirror/) || ($name =~ /raidz/) || ($name =~ /spare/))
208 | {
209 | $status{$devs} = {name => $name, state => $state, read => $read, write => $write, cksum => $cksum, parent => $parent};
210 | $parent = $devs;
211 | $devs++;
212 |
213 | #for all other vdevs, should be actual devices at this point
214 | } elsif ($name)
215 | {
216 | $status{$devs} = {name => $name, state => $state, read => $read, write => $write, cksum => $cksum, parent => $parent,};
217 | $devs++;
218 | }
219 |
220 | }
221 | return %status;
222 | }
223 |
224 | #zfs_get($pool, $property)
225 | sub zfs_get
226 | {
227 | my ($zfs, $property) = @_;
228 | if (~$property) {my $property="all";}
229 | my %hash=();
230 | my $get=`zfs get -H $property $zfs`;
231 | open my $fh, "<", \$get;
232 | while (my $line =<$fh>)
233 | {
234 | chomp ($line);
235 | my($name, $property, $value, $source) = split(/\t/, $line);
236 | $hash{$name}{$property} = { value => $value, source => $source };
237 | }
238 | return %hash;
239 | }
240 |
241 | #zpool_get($pool, $property)
242 | sub zpool_get
243 | {
244 | my ($pool, $property) = @_;
245 | if (~$property) {my $property="all";}
246 | my %hash=();
247 | my $get=`zpool get -H $property $pool`;
248 |
249 | open my $fh, "<", \$get;
250 | while (my $line =<$fh>)
251 | {
252 | chomp ($line);
253 | my($name, $property, $value, $source) = split(/\t/, $line);
254 | $hash{$name}{$property} = { value => $value, source => $source };
255 | }
256 | return %hash;
257 | }
258 |
259 | sub zpool_imports
260 | {
261 | my ($dir, $destroyed) = @_;
262 | if ($dir) { $dir = '-d '.$dir; }
263 | my %status = ();
264 | my $cmd = `zpool import $dir $destoryed`;
265 | $count = 0;
266 | @pools = split(/ pool: /, $cmd);
267 | shift (@pools);
268 | foreach $cmdout (@pools) {
269 | ($status{$count}{pool}, $cmdout) = split(/ id: /, $cmdout);
270 | chomp $status{$count}{pool};
271 | ($status{$count}{id}, $cmdout) = split(/ state: /, $cmdout);
272 | chomp $status{$count}{id};
273 | if (index($cmdout, "status: ") != -1) {
274 | ($status{$count}{state}, $cmdout) = split("status: ", $cmdout);
275 | ($status{$count}{status}, $cmdout) = split("action: ", $cmdout);
276 | if (index($cmdout, " see: ") != -1) {
277 | ($status{$count}{action}, $cmdout) = split(" see: ", $cmdout);
278 | ($status{$count}{see}, $cmdout) = split("config:\n", $cmdout);
279 | } else { ($status{$count}{action}, $cmdout) = split("config:\n", $cmdout); }
280 | } else {
281 | ($status{$count}{state}, $cmdout) = split("action: ", $cmdout);
282 | ($status{$count}{action}, $cmdout) = split("config:\n", $cmdout);
283 | }
284 | $status{$count}{config} = $cmdout;
285 | $count++;
286 | }
287 | return %status;
288 | }
289 |
290 | sub diff
291 | {
292 | my ($snap, $parent) = @_;
293 | my @array = split("\n", `zfs diff -FH $snap`);
294 | return @array;
295 | }
296 |
297 |
298 | sub list_disk_ids
299 | {
300 | my $byid = '/dev/disk/by-id'; #for linux
301 | my $byuuid = '/dev/disk/by-uuid';
302 | opendir (DIR, $byid);
303 | %hash = ();
304 | while (my $file = readdir(DIR))
305 | {
306 | if (!-d $byid."/".$file ) { $hash{'byid'}{$file} = readlink($byid."/".$file); }
307 | }
308 | opendir (DIR, $byuuid);
309 | while (my $file = readdir(DIR))
310 | {
311 | if (!-d $byuuid."/".$file ) { $hash{'byuuid'}{$file} = readlink($byuuid."/".$file); }
312 | }
313 | return %hash;
314 | }
315 |
316 | sub cmd_create_zfs
317 | #deprecated
318 | {
319 | my ($zfs, $options) = @_;
320 | my $opts = ();
321 | my %createopts = create_opts();
322 | $createopts{'volblocksize'} = '8k';
323 | if (${$options}{'sparse'}) { $opts .= "-s "; }
324 | delete ${$options}{'sparse'};
325 | if (${$options}{'zvol'}) {
326 | $zfs = "-V ".${$options}{'zvol'}." ".$zfs;
327 | delete ${$options}{'zvol'};
328 | }
329 | foreach $key (sort(keys %${options}))
330 | {
331 | $opts = (($createopts{$key}) && (${$options}{$key} =~ 'default')) ? $opts : $opts.' -o '.$key.'='.${$options}{$key};
332 | }
333 | my $cmd="zfs create $opts $zfs";
334 | return $cmd;
335 | }
336 |
337 | sub cmd_create_zpool
338 | #deprecated
339 | {
340 | my ($pool, $dev, $options, $poolopts, $force) = @_;
341 | my $opts = ();
342 | foreach $key (sort(keys %{$poolopts}))
343 | {
344 | $opts = (${$poolopts}{$key} =~ 'default') ? $opts : $opts.' -o '.$key.'='.${$poolopts}{$key};
345 | }
346 | foreach $key (sort(keys %{$options}))
347 | {
348 | $opts = (${$options}{$key} =~ 'default') ? $opts : $opts.' -O '.$key.'='.${$options}{$key};
349 | }
350 | my $cmd="zpool create $force $opts $pool $dev";
351 | return $cmd;
352 | }
353 |
354 | sub find_parent
355 | {
356 | my ($filesystem) = @_;
357 | my %parent = ();
358 | ($parent{'pool'}) = split(/[@\/]/g, $filesystem);
359 | $null = reverse $filesystem =~ /[@\/]/g;
360 | $parent{'filesystem'} = substr $filesystem, 0, $-[0];
361 | if (index($filesystem, '@') != -1) { (undef, $parent{'snapshot'}) = split(/@/, $filesystem); }
362 | return %parent;
363 | }
364 |
365 | sub ui_zpool_list
366 | {
367 | my ($pool, $action)=@_;
368 | my %zpool = list_zpools($pool);
369 | if ($action eq undef) { $action = "status.cgi?pool="; }
370 | @props = split(/,/, $config{list_zpool});
371 | print ui_columns_start([ "pool name", @props ]);
372 | foreach $key (sort(keys %zpool))
373 | {
374 | @vals = ();
375 | foreach $prop (@props) { push (@vals, $zpool{$key}{$prop}); }
376 | print ui_columns_row(["$key", @vals ]);
377 | }
378 | print ui_columns_end();
379 | }
380 |
381 | sub ui_zpool_status
382 | #deprecated
383 | {
384 | my ($pool, $action) = @_;
385 | if ($action eq undef) { $action = "status.cgi?pool="; }
386 | my %zpool = list_zpools($pool);
387 | print ui_columns_start([ "Pool Name", "Size", "Alloc", "Free", "Frag", "Cap", "Dedup", "Health"]);
388 | foreach $key (keys %zpool)
389 | {
390 | print ui_columns_row(["$key", $zpool{$key}{size}, $zpool{$key}{alloc}, $zpool{$key}{free}, $zpool{$key}{frag}, $zpool{$key}{cap}, $zpool{$key}{dedup}, $zpool{$key}{health} ]);
391 | }
392 | print ui_columns_end();
393 | }
394 |
395 | sub ui_zpool_properties
396 | {
397 | my ($pool) = @_;
398 | require './property-list-en.pl';
399 | my %hash = zpool_get($pool, "all");
400 | my %props = property_desc();
401 | my %properties = pool_properties_list();
402 | print ui_table_start("Properties", "width=100%", undef);
403 | foreach $key (sort(keys %{$hash{$pool}}))
404 | {
405 | if (($properties{$key}) || ($props{$key}) || ($text{'prop_'.$key}))
406 | {
407 | print ui_table_row(''.$key.'', $hash{$pool}{$key}{value});
408 | } else {
409 | print ui_table_row($key, $hash{$pool}{$key}{value});
410 | }
411 | }
412 | print ui_table_end();
413 | }
414 |
415 | sub ui_zfs_list
416 | {
417 | my ($zfs, $action)=@_;
418 | my %zfs = list_zfs($zfs);
419 | if ($action eq undef) { $action = "status.cgi?zfs="; }
420 | @props = split(/,/, $config{list_zfs});
421 | print ui_columns_start([ "file system", @props ]);
422 | foreach $key (sort(keys %zfs))
423 | {
424 | @vals = ();
425 | if ($zfs{$key}{'mountpoint'}) { $zfs{$key}{'mountpoint'} = "$zfs{$key}{mountpoint}"; }
426 | foreach $prop (@props) { push (@vals, $zfs{$key}{$prop}); }
427 | print ui_columns_row(["$key", @vals ]);
428 | }
429 | print ui_columns_end();
430 | }
431 |
432 | sub ui_zfs_properties
433 | {
434 | my ($zfs)=@_;
435 | require './property-list-en.pl';
436 | my %hash = zfs_get($zfs, "all");
437 | if (!$hash{$zfs}{'com.sun:auto-snapshot'}) { $hash{$zfs}{'com.sun:auto-snapshot'}{'value'} = '-'; }
438 | my %props = property_desc();
439 | my %properties = properties_list();
440 | print ui_table_start("Properties", "width=100%", undef);
441 | foreach $key (sort(keys %{$hash{$zfs}}))
442 | {
443 | if (($properties{$key}) || ($props{$key}) || ($text{'prop_'.$key}))
444 | {
445 | if ($key =~ 'origin') { print ui_table_row(''.$key.'', "$hash{$zfs}{$key}{value}"); }
446 | elsif ($key =~ 'clones') {
447 | $row = "";
448 | @clones = split(',', $hash{$zfs}{$key}{value});
449 | foreach $clone (@clones) { $row .= "$clone "; }
450 | print ui_table_row(''.$key.'', $row);
451 | } else { print ui_table_row(''.$key.'', $hash{$zfs}{$key}{value}); }
452 | } else {
453 | print ui_table_row($key, $hash{$zfs}{$key}{value});
454 | }
455 | }
456 | print ui_table_end();
457 | }
458 |
459 | sub ui_list_snapshots
460 | {
461 | my ($zfs, $admin) = @_;
462 | %snapshot = list_snapshots($zfs);
463 | @props = split(/,/, $config{list_snap});
464 | if ($admin =~ /1/) {
465 | print ui_form_start('cmd.cgi', 'post');
466 | print ui_hidden('cmd', 'multisnap');
467 | }
468 | print ui_columns_start([ "snapshot", @props ]);
469 | my $num = 0;
470 | foreach $key (sort(keys %snapshot))
471 | {
472 | @vals = ();
473 | foreach $prop (@props) { push (@vals, $snapshot{$key}{$prop}); }
474 | if ($admin =~ /1/) {
475 | print ui_columns_row([ui_checkbox("select", $snapshot{$key}{name}.";", "$snapshot{$key}{'name'}"), @vals ]);
476 | $num ++;
477 | } else {
478 | print ui_columns_row([ "$snapshot{$key}{name}", @vals ]);
479 | }
480 | }
481 | print ui_columns_end();
482 | if ($admin =~ /1/) { print select_all_link('select', '', "Select All"), " | ", select_invert_link('select', '', "Invert Selection") }
483 | if (($admin =~ /1/) && ($config{'snap_destroy'} =~ /1/)) { print " | ".ui_submit("Destroy selected snapshots"); }
484 | if ($admin =~ /1/) { print ui_form_end(); }
485 |
486 | }
487 |
488 | sub ui_create_snapshot
489 | {
490 | my ($zfs) = @_;
491 | $rv = ui_form_start('cmd.cgi', 'post')."\n";
492 | $rv .= "Create new snapshot based on filesystem: ".$zfs."
\n";
493 | my $date = strftime "zfs_manager_%Y-%m-%d-%H%M", localtime;
494 | $rv .= $zfs."@ ".ui_textbox('snap', $date, 28)."\n";
495 | $rv .= ui_hidden('zfs', $zfs)."\n";
496 | $rv .= ui_hidden('cmd', "snapshot")."\n";
497 | $rv .= ui_submit("Create");
498 | $rv .= ui_form_end();
499 | return $rv;
500 | }
501 |
502 | sub ui_cmd
503 | {
504 | my ($message, $cmd) = @_;
505 | print "$text{'cmd_'.$in{'cmd'}} $message $text{'cmd_with'}
\n";
506 | print "# ".$cmd."
\n";
507 | if (!$in{'confirm'}) {
508 | print ui_form_start('cmd.cgi', 'post');
509 | foreach $key (keys %in) {
510 | print ui_hidden($key, $in{$key});
511 | }
512 | print "Would you lke to continue?
\n";
513 | print ui_submit("yes", "confirm", 0)."
";
514 | print ui_form_end();
515 | } else {
516 | @result = (`$cmd 2>&1`);
517 | if (!$result[0])
518 | {
519 | print "Success!
\n";
520 | } else {
521 | print "error: ".$result[0]."
\n";
522 | foreach $key (@result[1..@result]) {
523 | print $key."
\n";
524 | }
525 | }
526 | }
527 | print "
";
528 | }
529 |
530 | sub ui_cmd_old
531 | {
532 | my ($message, $cmd) = @_;
533 | $rv = "Attempting to $message with command...
\n";
534 | $rv .= "# ".$cmd."
\n";
535 | if (!$in{'confirm'}) {
536 | $rv .= ui_form_start('cmd.cgi', 'post');
537 | foreach $key (keys %in) {
538 | $rv .= ui_hidden($key, $in{$key});
539 | }
540 | $rv .= "Would you lke to continue?
\n";
541 | $rv .= ui_submit("yes", "confirm", 0)."
";
542 | $rv .= ui_form_end();
543 | } else {
544 | @result = (`$cmd 2>&1`);
545 | if (!$result[0])
546 | {
547 | $rv .= "Success!
\n";
548 | } else {
549 | $rv .= "error: ".$result[0]."
\n";
550 | foreach $key (@result[1..@result]) {
551 | $rv .= $key."
\n";
552 | }
553 | }
554 | }
555 |
556 | return $rv;
557 | }
558 |
559 |
560 |
561 | sub ui_popup_link
562 | #deprecated
563 | {
564 | my ($name, $url)=@_;
565 | return "$name";
566 | }
567 |
568 | sub test_function
569 | {
570 |
571 | }
572 |
--------------------------------------------------------------------------------