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

Bind mount and btrfs dump target enhancement #37

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

licliu
Copy link
Collaborator

@licliu licliu commented Sep 29, 2024

These patch set is aimed at improving bind mount and btrfs dump target.

The 1st patch resolved the same issue with #28.
The 2nd patch and the 3rd patch are doing some renaming work.
The 4th patch tries to resolve the btrfs issue by keeping subvol info when handling kdump target and block device.
For user configured btrfs dump target, currently just leave it as it is, so that it will always use the first subvol. maybe we can add a subvol option in /etc/kdump.conf in the future.

We use findmnt to find the real mount point by mount source, however,
when there is a bind mount target, findmnt will give more than one
results and what we actually want is the one without fsroot.

Will fallback to previous method if the $_mntpoint is empty.

Signed-off-by: Lichen Liu <[email protected]>
Move all get_something_from_target() functions to one place.

Signed-off-by: Lichen Liu <[email protected]>
get_*_from_target() use findmnt --source to get infomation, but their
names sugget they will get info by target, renamed them in order to not
confuse readers.

Signed-off-by: Lichen Liu <[email protected]>
When using btrfs dump target, we need to use subvol to find the real
mntpoint instead of the first output of findmnt, which is almost always
root subvol.

All functions that call this function are also updated.

For user configured btrfs dump target, we don't need the subvol and
it will always use the first subvol.

Signed-off-by: Lichen Liu <[email protected]>
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.

1 participant