Skip to content

Commit

Permalink
restore-single-files: reduce chance of UUID collision
Browse files Browse the repository at this point in the history
XFS can't mount multiple images that happen to have the same UUID.
This can happen either due to PL-132849 or if you'd like to restore
from multiple revisions of the same disk.

This change reduces the chance by changing the UUID during restore.
However, there's a small mount/umount cycle with the old UUID that
could collide, but xfs needs a clean log to change the UUID.

Re PL-132849
  • Loading branch information
ctheune committed Aug 14, 2024
1 parent 59764de commit 7d2cd32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/restore-single-files/restore-single-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ while [ ! -e $LOOPPART ]; do
sleep 0.2
done

info "Pre-mounting image to flush log"
mount -oloop ${LOOPPART} $LOOPMNT
umount $LOOPMNT

info "Regenerating UUID to avoid collisions"
xfs_admin -U generate ${LOOPPART}

info "Mounting image"
mount -oloop ${LOOPPART} $LOOPMNT

Expand Down

0 comments on commit 7d2cd32

Please sign in to comment.