diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-04-25 14:03:29 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-05-02 17:31:08 +0200 |
commit | dd999bfe34e7f812d4ce61828f262ee06b5d4fa4 (patch) | |
tree | 587d17a5f5226f53892e0413bdd36c0e5c2f1c1d /tests/units/test_0001_probe.py | |
parent | 22dce48d3ec27d0db8f6a069744d44454382bcc4 (diff) |
utils: rewrite ogReduceFs
Drop subprocess call to bash function ogReduceFs. Use a native python
solution with subprocess calls to the required underlying tools.
Use get_filesystem_type to get the filesystem from a partition and call
the corresponding supported filesystem shrink function.
Filesystem specific functions are declared "_reduce_{filesystem}" and
should not be imported elsewhere.
In case of NTFS filesystems, the output of 'ntfsresize' is processed
directly. This is dirty, but we can expect no changes to the output
strings if we read the following comment in the nftsresize.c source
code:
https://github.com/tuxera/ntfs-3g/blob/edge/ntfsprogs/ntfsresize.c#L12
ntfsresize requires to do previous dry-run executions to confirm
that the resizing is possible.
If a dry-run fails but a 10% increase in size is still smaller than
original filesystem then retry the operation until dry-run reports
sucess or the size increase is bigger than original.
If resizing to a smaller ntfs filesystem is not possible then ogReduceFs
will do nothing.
Diffstat (limited to 'tests/units/test_0001_probe.py')
0 files changed, 0 insertions, 0 deletions