-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xfsprogs cli #3444
Xfsprogs cli #3444
Conversation
f453313
to
516e668
Compare
516e668
to
1612361
Compare
6d9dadd
to
b05a227
Compare
01930db
to
9e68835
Compare
9e68835
to
d274b97
Compare
d274b97
to
d49fcf4
Compare
Update in ⬆️ push:
|
Build and install xfs_info, xfs_admin and fsck.xfs cli to os spec. Also add Cargo.toml for xfscli package. pick 412d8bad packages: update cni-plugins to 1.3.0
8604ecd
to
e0a0bf2
Compare
Update in ⬆️ push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🚀
sources/xfscli/src/lib.rs
Outdated
}) | ||
} | ||
|
||
// Query xfs spaceman to get xfs information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'm sorry to have missed this in a previous pass, but these should be docstring comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed these comments to Docstring comments
All the commands for xfs progs that are listed on https://man7.org/linux/man-pages/man8/xfs_admin.8.html can be executed using this CLI. This CLI executes xfs_repair when -O arg and -c arg options are provided. It executes xfs_io to get the queried information for the mounted filesystem and xfs_db for unmounted filesystem.
The cli can be used as: - xfs_info -V - xfs_info $target where target is mount_point or block_device This works for both mounted and unmounted target. It fetches data using xfs_spaceman when the target is mounted and use xfs_db in case of unmounted target. Param "-t" for mtab is not included in this cli as xfs_spaceman -p xfs_info -c "info" -t "$mtab" "${target}" do not produce expected output.
This cli has been rewritten in Rust as bottlerocket does not have shell. This CLI is intented to get called uninteractively: 1. By Kubernetes 2. By systemd-fsck-root.service - This is disabled by default in bottlerocket. In case of Kubernetes, this binary will be used to repair the filesystem when it exists. We are keeping it open for interactive sesssion too, though it is recommended to invoke xfs_repair for Normal administrative filesystem repairs directly.
e0a0bf2
to
20f896d
Compare
Update in ⬆️ push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚢
Issue number:
Completes parts of # 3272
Description of changes:
Rewrite xfs_info, xfs_admin and fsck.xfs cli for bottlerocket as Bottlerocket does not have a shell.
xfs_spaceman when the target is mounted and use xfs_db in case of
unmounted target.
Param "-t" for mtab is not included in this cli as
xfs_spaceman -p xfs_info -c "info" -t "$mtab" "${target}"
do not produce expected output. The cli can be used as:
https://man7.org/linux/man-pages/man8/xfs_admin.8.html
can be executed using this CLI.
recommended to invoke xfs_repair for Normal administrative filesystem
repairs directly.
Testing done:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.