Mount device

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-01-31 23:33:23 +01:00
parent bbc136b66b
commit 0478edcbb8

View File

@@ -237,12 +237,12 @@ create_fs_structure () {
local cmd local cmd
printf "${BLUE}Prepare root filesystem structure ${GREEN}'subvol=%s'${NO_COLOR}\n" \ printf "${BLUE}Prepare root filesystem structure with subvol=${GREEN}'%s'${NO_COLOR}\n" \
"$SUBVOL" "$SUBVOL"
if [ $dryrun -eq 1 ]; then if [ $dryrun -eq 1 ]; then
printf "${MAGENTA}Would mount target root at ${GREEN}'%s'${NO_COLOR}\n" "$SUBVOL" printf "${MAGENTA}Would mount target root at ${GREEN}'%s'${NO_COLOR}\n" "$SUBVOL"
else else
printf "${MAGENTA} - mount target root at ${GREEN}'%s'${NO_COLOR}\n" "$SUBVOL" printf "${BLUE} - mount target root"
mount_target /dev/disk/by-partlabel/${PREFIX}-${LABEL} $MOUNT_POINT btrfs $SUBVOL mount_target /dev/disk/by-partlabel/${PREFIX}-${LABEL} $MOUNT_POINT btrfs $SUBVOL
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
die "Can't mount root filesystem ${PREFIX}-${LABEL}" die "Can't mount root filesystem ${PREFIX}-${LABEL}"
@@ -677,6 +677,12 @@ mount_target () {
local cmd local cmd
if [ ! -h $DEV_NAME ]; then
printf "${RED}Error: ${NO_COLOR}Can't access given device ${GREEN}'%s'{NO_COLOR}\n" \
"$DEV_NAME"
return 1
fi
case $FS_TYPE in case $FS_TYPE in
"btrfs") "btrfs")
if [ -h $DEV_NAME ]; then if [ -h $DEV_NAME ]; then