Skip to content

Commit

Permalink
do not remove VGs, deactivate them, Closes: #990633
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Jul 3, 2021
1 parent cb9eda5 commit 21932b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/fai-diskimage
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ cleanup() {
. /var/run/fai/zerofree.$$ 2>/dev/null
rm /var/run/fai/zerofree.$$
fi
losetup -d $loop
# if FAI created a volume group, we can remove it after the loop device is removed
if [ -f /var/run/fai/vgremove.$$ ]; then
. /var/run/fai/vgremove.$$ 2>/dev/null
rm /var/run/fai/vgremove.$$
fi
rm -rf $mnt
losetup -d $loop
if [ -f /var/run/fai/FAI_INSTALLATION_IN_PROGRESS ]; then
if pgrep -F /var/run/fai/FAI_INSTALLATION_IN_PROGRESS; then
:
Expand Down
3 changes: 1 addition & 2 deletions lib/subroutines
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ cleanup_devicemapper() {
> /var/run/fai/vgremove.$PPID
vgroup=$(awk '/Executing: vgcreate/ {print $3}' $LOGDIR/format.log)
for v in $vgroup; do
vgchange -an $v
echo vgremove -f $v >> /var/run/fai/vgremove.$PPID
echo blkdeactivate /dev/$v/* >> /var/run/fai/vgremove.$PPID
done
fi
}
Expand Down

0 comments on commit 21932b3

Please sign in to comment.