Skip to content
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

Use libblockdev FS plugin for filesystem operations #1163

Conversation

vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Oct 27, 2023

With libblockdev 3.0 now released and required in Blivet, we can now start using the FS plugin for various filesystem operations we previously used the command line tools directly.

Most of the changes are just replacing the function calls with libblockdev. One major change is removing some filesystem support. We'll remove support for creating and managing of ReiserFS, JFS and HFS. These filesystems are either unsupported (ReiserFS userspace tools were removed from Fedora and ReiserFS is also deprecated in the upstream kernel) or very old and not used (HFS is supported only on PPC Mac which is no longer supported in Fedora, we are not removing HFS+ support).

TODO:

  • FS min size support -- blivet uses different tools for getting filesystem min size (ntfsresize used by blivet vs ntfsinfo used by libblockdev to get filesystem free space), we need to add support to libblockdev first
  • swap UUID and label format check, libblockdev support pending release: swap: Add support for checking label and UUID format libblockdev#978
  • fsck support -- blivet uses error codes for custom error messages, which libblockdev doesn't support

blivet/tasks/fsmkfs.py Outdated Show resolved Hide resolved
@vojtechtrefny
Copy link
Member Author

Jenkins, test this please.

@vojtechtrefny vojtechtrefny force-pushed the 3.9-devel_libblockdev-fs-plugin branch 2 times, most recently from bdb9f8d to 674939c Compare October 27, 2023 11:57
vojtechtrefny added a commit to vojtechtrefny/anaconda that referenced this pull request Oct 27, 2023
The next version of blivet will switch from calling the 'mount'
command for mounting to libblockdev FS plugin (which use libmount)
so the test needs to be changed. This way the check will work with
both the old and the new blivet's code.

Related: storaged-project/blivet#1163
@vojtechtrefny vojtechtrefny force-pushed the 3.9-devel_libblockdev-fs-plugin branch 2 times, most recently from f4cea18 to b7ff2ab Compare October 27, 2023 13:03
@vojtechtrefny vojtechtrefny marked this pull request as ready for review November 1, 2023 10:12
@vojtechtrefny
Copy link
Member Author

Marking as ready for review, we are still missing some features, but these can be implemented later in a separated PR without blocking this.

blivet/tasks/fswritelabel.py Outdated Show resolved Hide resolved
blivet/tasks/fswriteuuid.py Outdated Show resolved Hide resolved
blivet/tasks/fsresize.py Outdated Show resolved Hide resolved
Copy link
Contributor

@japokorn japokorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

ReiserFs support is scheluded to be removed from the kernel and
the userspace tools were removed in Fedora 35. This removes only
support for creating and managing ReiserFS, we will still
recognize the filesystem.
JFS is still supported but isn't really used or actively developed
anymore. It also isn't packaged for CentOS/RHEL and not supported
by libblockdev.
The minimum required version 1.41 was released 8 years ago, we can
now safely assume it is available everywhere.
We now require libblockdev >= 3.0 which will always have these
technologies.
libblockdev uses the FIFREEZE and FITHAW ioctls directly so we no
longer need to require the command line tool.
BlockDev.swap.mkswap supports the UUID parameter directly since
3.0.
We can now use the FSInfo task to get the filesystem label too.
We still need to manually spawn mkfs for HFS and GFS2 which are
not supported by libblockdev.
FormatCreateError doesn't accept the extra device name parameter.
HFS was replaced by HFS+ more than 20 years ago and is needed only
for the old PowerPC Macs and PPC is not supported by Fedora.
Removing now unused applications replaced by libblockdev.
This is no longer needed since the full LVM devices file support
introduced in storaged-project#972.
NTFS is now fully support, we no longer need to skip this test.
We can use the libblockdev utils instead of calling `modprobe`.
@vojtechtrefny vojtechtrefny merged commit 43a3e42 into storaged-project:3.9-devel Nov 10, 2023
11 checks passed
VladimirSlavik pushed a commit to VladimirSlavik/anaconda that referenced this pull request Nov 16, 2023
The next version of blivet will switch from calling the 'mount'
command for mounting to libblockdev FS plugin (which use libmount)
so the test needs to be changed. This way the check will work with
both the old and the new blivet's code.

Related: storaged-project/blivet#1163
(cherry picked from commit 5cffb0c)
VladimirSlavik pushed a commit to VladimirSlavik/anaconda that referenced this pull request Nov 20, 2023
The next version of blivet will switch from calling the 'mount'
command for mounting to libblockdev FS plugin (which use libmount)
so the test needs to be changed. This way the check will work with
both the old and the new blivet's code.

Related: storaged-project/blivet#1163
(cherry picked from commit 5cffb0c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants