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
Make sure rescue contains all COPY_AS_IS files #3027
Conversation
|
Without the fix: The reason is everything after |
| @@ -112,7 +112,7 @@ | |||
| # cf. https://github.com/rear/rear/pull/2405#issuecomment-633512932 | |||
| # FIXME: The following code fails if file names contain characters from IFS (e.g. blanks), | |||
| # cf. https://github.com/rear/rear/issues/1372 | |||
| if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x 1>/dev/null ; then | |||
| if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x -i 1>/dev/null ; then | |||
Check notice
Code scanning / Shellcheck (reported by Codacy)
Double quote to prevent globbing and word splitting. Note
| @@ -112,7 +112,7 @@ | |||
| # cf. https://github.com/rear/rear/pull/2405#issuecomment-633512932 | |||
| # FIXME: The following code fails if file names contain characters from IFS (e.g. blanks), | |||
| # cf. https://github.com/rear/rear/issues/1372 | |||
| if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x 1>/dev/null ; then | |||
| if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x -i 1>/dev/null ; then | |||
Check notice
Code scanning / Shellcheck (reported by Codacy)
Use "${array[@]}" (with quotes) to prevent whitespace problems. Note
|
systemtap |
|
@rmetrich Hi - is this related to Message Queue brokers? Could you say something about the background of this issue? I also saw from time to time that |
Yes this was seen with |
|
Is |
It seems to be a regular file: But none of this really matters, all we must take care of is archives with zero padding can be extracted properly. |
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.
Because even the old GNU tar version 1.15.1 in SLES10-SP4 supports (according to its man page)
-i, --ignore-zeros
ignore blocks of zeros in archive (normally mean EOF)
and because I cannot imagine that using '-i' may cause
unexpected bad consequences or regressions in certain cases,
I "just approve" it.
The files copied as-is in the rescue are copied using a 'tar -c | tar -x' command. It may happen that inodes are shrinking during the copy (e.g. /dev/mqueue/nnsc (HPE device)), which can cause the 'tar -x' command to stop extracting the next files, due to the padding zeros inserted in the shrank inode. The solution is to add '-i' option when extracting, to continue the processing.
|
@rmetrich |
|
@rear/contributors |
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.
@rmetrich nice find and thanks for making ReaR more robust in general.
Beyond that, does the rescue system actually need those mqueue files? If not then I'd suggest to also exclude them from the rescue image, as it will debloat or unclutter the rescue image.
If this is a common thing then we can also add it to the default exclude list, IMHO.
|
Only for the log (for completeness): I will never fully understand how 'tar' works. explain why "blocks filled with zeroes mean EOF" in 'tar'. |
It's probably not useful, as most of the devices in |
|
Related to this pull request We copy by default all in /dev/ into the recovery system because of in usr/share/rear/conf/GNU/Linux.conf I made a separated issue |
Moved the comment before the FIXME part and expained in the comment why 'tar' exits regularly when it reads a (longer) sequence of zeroes, cf. rear#3027 (comment)
|
@rmetrich It is much appreciated to get ReaR working |
Relax-and-Recover (ReaR) Pull Request Template
Please fill in the following items before submitting a new pull request:
Pull Request Details:
Type: Bug Fix
Impact: Normal
Reference to related issue (URL): N/A
How was this pull request tested?
Using an automated reproducer implemented using systemtap
Create a file in
/devwhich will be embedded in the rescue environmentExecute the systemtap script in charge of shrinking the file while being copied
Execute
rear mkrescuefrom another terminalThe files copied as-is in the rescue are copied using a
tar -c | tar -xcommand.It may happen that inodes are shrinking during the copy (e.g.
/dev/mqueue/nnsc(HPE device)), which can cause thetar -xcommand to stop extracting the next files, due to the padding zeros inserted in the shrank inode.This leads to an error when checking the integrity of the rescue environment.
The solution is to add
-ioption when extracting, to continue the processing.