Skip to content

Commit

Permalink
adding logic for detecting BEK volume and mounting it
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 9, 2020
1 parent 2497ff0 commit 4c97088
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/vm-repair/azext_vm_repair/scripts/mount-encrypted-disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@ duplication_validation () {
fi
}

locatebekvol () {
trapper
echo "`date` Locating BEK volume" >> ${logpath}/${logfile}
export bekdisk=`lsblk -l -o LABEL,NAME| grep BEK | awk '{print $NF}'`
if [ -z ${bekdisk} ]
then
echo "`date` No BEK disk found, cannot continue" >> ${logpath}/${logfile}
exit
else
echo "`date` the BEK Volume is ${bekdisk}" >> ${logpath}/${logfile}
export bekdisk=/dev/${bekdisk}
fi
}

mountbekvol () {
trapper
echo "`date` Mounting BEK volume" >> ${logpath}/${logfile}
export bekmountpath=/mnt/azure_bek_disk/
mkdir -p ${bekmountpath}
mount ${bekdisk} ${bekmountpath}
echo "`date` BEK Volume ${bekdisk} mounted on ${bekmountpath}" >> ${logpath}/${logfile}
}


get_data_disk () {
trapper
echo "`date` Getting data disk" >> ${logpath}/${logfile} 2>&1
Expand Down Expand Up @@ -175,6 +199,8 @@ remount_boot () {
setlog
duplication_validation
create_mountpoints
locatebekvol
mountbekvol
get_data_disk
check_local_lvm
data_os_lvm_check
Expand All @@ -184,9 +210,4 @@ mount_boot
unlock_root
verify_root_unlock
mount_encrypted
<<<<<<< HEAD
remount_boot

=======
remount_boot
>>>>>>> upstream/master

0 comments on commit 4c97088

Please sign in to comment.