Ask about mounting btrfs subvolumes when skipping formatting
This commit is contained in:
parent
203ae18612
commit
1fe5a7ae88
39
installer
39
installer
@ -1057,16 +1057,22 @@ part_mount()
|
|||||||
|
|
||||||
mkdir -p "$mntp"
|
mkdir -p "$mntp"
|
||||||
|
|
||||||
if [[ $BTRFS -ne 2 && $fs && ${FS_OPTS[$fs]} && $part != "$BOOT" && $part != "$AUTO_ROOT" ]] && select_mntopts "$part" "$fs"; then
|
# skipped formatting on existing btrfs partition?
|
||||||
mount -o $MNT_OPTS "$part" "$mntp" > /dev/null 2> "$ERR"
|
if [[ $fs == 'btrfs' && $BTRFS -eq 0 ]] && yesno "Btrfs Subvolume Mount" "\nDo you have a subvolume on $part that should be mounted at $mntp?\n"; then
|
||||||
errshow 0 "mount -o $MNT_OPTS $part $mntp" || return 1
|
btrfs_name "\nEnter the name of initial subvolume on $part to be mounted at $mntp.\n\ne.g. mount -o subvol=YOUR_SUBVOL $part $mntp\n" || return 1
|
||||||
|
btrfs_mount "$part" "$mntp" "$SUBVOL" || return 1
|
||||||
else
|
else
|
||||||
MNT_OPTS=''
|
if [[ $BTRFS -ne 2 && $fs && ${FS_OPTS[$fs]} && $part != "$BOOT" && $part != "$AUTO_ROOT" ]] && select_mntopts "$part" "$fs"; then
|
||||||
mount "$part" "$mntp" > /dev/null 2> "$ERR"
|
mount -o $MNT_OPTS "$part" "$mntp" > /dev/null 2> "$ERR"
|
||||||
errshow 0 "mount $part $mntp" || return 1
|
errshow 0 "mount -o $MNT_OPTS $part $mntp" || return 1
|
||||||
|
else
|
||||||
|
MNT_OPTS=''
|
||||||
|
mount "$part" "$mntp" > /dev/null 2> "$ERR"
|
||||||
|
errshow 0 "mount $part $mntp" || return 1
|
||||||
|
fi
|
||||||
|
msg "Mount Complete" "\nMounted $part at $mntp\n" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg "Mount Complete" "\nMounted $part at $mntp\n" 1
|
|
||||||
part_countdec "$part"
|
part_countdec "$part"
|
||||||
part_cryptlv "$part"
|
part_cryptlv "$part"
|
||||||
return 0
|
return 0
|
||||||
@ -2469,6 +2475,19 @@ btrfs_name()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btrfs_mount()
|
||||||
|
{
|
||||||
|
local part="$1"
|
||||||
|
local mntp="$2"
|
||||||
|
local subvol="$3"
|
||||||
|
|
||||||
|
[[ $mntp == "$MNT" ]] && BTRFS_MNT="rootflags=subvol=$subvol"
|
||||||
|
select_mntopts "$part" 'btrfs' && [[ $MNT_OPTS ]] && MNT_OPTS+=','
|
||||||
|
mount -o ${MNT_OPTS}subvol="$subvol" "$part" "$mntp" 2> "$ERR"
|
||||||
|
errshow 0 "mount -o ${MNT_OPTS}subvol=$subvol $part $mntp" || return 1
|
||||||
|
msg "Mount Complete" "\nMounted $part subvol=$subvol at $mntp\n" 1
|
||||||
|
}
|
||||||
|
|
||||||
btrfs_subvols()
|
btrfs_subvols()
|
||||||
{
|
{
|
||||||
local part="$1"
|
local part="$1"
|
||||||
@ -2477,15 +2496,11 @@ btrfs_subvols()
|
|||||||
|
|
||||||
btrfs_name "\nEnter a name for the initial subvolume on $part e.g. 'subvol_root'." || return 1
|
btrfs_name "\nEnter a name for the initial subvolume on $part e.g. 'subvol_root'." || return 1
|
||||||
mvol="$SUBVOL"
|
mvol="$SUBVOL"
|
||||||
[[ $mntp == "$MNT" ]] && BTRFS_MNT="rootflags=subvol=$mvol"
|
|
||||||
btrfs subvolume create "$mntp/$mvol" > /dev/null 2> "$ERR"
|
btrfs subvolume create "$mntp/$mvol" > /dev/null 2> "$ERR"
|
||||||
errshow 0 "btrfs subvolume create $mntp/$mvol" || return 1
|
errshow 0 "btrfs subvolume create $mntp/$mvol" || return 1
|
||||||
|
|
||||||
umount_dir "$mntp" || return 1
|
umount_dir "$mntp" || return 1
|
||||||
select_mntopts "$part" 'btrfs' && [[ $MNT_OPTS ]] && MNT_OPTS+=','
|
btrfs_mount "$part" "$mntp" "$mvol" || return 1
|
||||||
mount -o ${MNT_OPTS}subvol="$mvol" "$part" "$mntp" 2> "$ERR"
|
|
||||||
errshow 0 "mount -o ${MNT_OPTS}subvol=$mvol $part $mntp" || return 1
|
|
||||||
msg "Mount Complete" "\nMounted $part subvol=$mvol at $mntp\n" 1
|
|
||||||
|
|
||||||
btrfs_extsubvols "$mntp" "$mvol" || return 1
|
btrfs_extsubvols "$mntp" "$mvol" || return 1
|
||||||
msg "Btrfs Setup" "\nSubvolume(s) created successfully.\n\nSubvolume root '$mvol' mounted at $mntp\n$([[ $SUBVOL_COUNT -gt 0 ]] && ls -R "$mntp")"
|
msg "Btrfs Setup" "\nSubvolume(s) created successfully.\n\nSubvolume root '$mvol' mounted at $mntp\n$([[ $SUBVOL_COUNT -gt 0 ]] && ls -R "$mntp")"
|
||||||
|
Reference in New Issue
Block a user