This agreement is adapted from the classic BSL-era CLA pattern (cf. MariaDB). It is signed by an employer/entity on behalf of all of its employees who contribute to the JustDB project. Individual contributors should sign
CLA-INDIVIDUAL.mdinstead unless their contributions are made on behalf of their employer.中文说明:本协议是 JustDB 项目的企业贡献者许可协议(MariaDB 同模式)。 若贵司员工以职务身份向 JustDB 提交代码,需由贵司(雇主实体)签署本协议,
This agreement is adapted from the classic BSL-era CLA pattern (cf. MariaDB, CockroachDB). It covers contributions to the JustDB project, which is distributed under the Business Source License 1.1 (BSL 1.1) with a Change Date of 2030-02-23, after which the licensed work converts to the Apache License 2.0.
中文说明:本协议是 JustDB 项目的个人贡献者许可协议。JustDB 以 BSL 1.1 授权 (Change Date 2030-02-23 后转为 Apache 2.0),因此外部贡献必须获得授权,项目才能在 BSL 与未来 Apache 双阶段许可下使用贡献者的代码。签署本协议即表示您同意上述授权。
| #!/usr/bin/perl -T | |
| # Get from https://xfs.org/index.php/Shrinking_Support with some small fix to support lvm | |
| use strict; | |
| use warnings; | |
| my $fd; | |
| $ENV{PATH} = "/usr/sbin"; | |
| $ENV{LC_ALL} = "C"; |
According to https://xfs.org/index.php/Shrinking_Support :
"Currently XFS Filesystems can't be shrunk."
You need backup the data and recreate the file system to shrink it.
But if you have a big xfs filesystem with not too much space used, For example, a 2T xfs volume with 100G data.
And you can take some risk to lose data.
Here is a way to shrink it without using new space.
The idea is:
1.temporary reduce the logic volume size, you can still read from xfs filesystem even after the partition or volume is shrunk if the real data is not wrote at the shrunk part
2.create a new volume
3.copy data