check on filesystem for btrfs options

This commit is contained in:
Tobias Powalowski 2023-01-24 10:09:25 +01:00
parent 05a780f693
commit 9071e82051
2 changed files with 4 additions and 5 deletions

View file

@ -259,11 +259,12 @@ _autoprepare() {
_MP="$(echo "${fsspec}" | tr -d ' ' | cut -f3 -d:)" _MP="$(echo "${fsspec}" | tr -d ' ' | cut -f3 -d:)"
_LABEL_NAME="$(echo "${fsspec}" | tr -d ' ' | cut -f4 -d:)" _LABEL_NAME="$(echo "${fsspec}" | tr -d ' ' | cut -f4 -d:)"
_FS_OPTIONS="" _FS_OPTIONS=""
_BTRFS_DEVS="${_DEV}" _BTRFS_DEVS=""
_BTRFS_LEVEL="" _BTRFS_LEVEL=""
_BTRFS_SUBVOLUME="" _BTRFS_SUBVOLUME=""
_BTRFS_COMPRESS="" _BTRFS_COMPRESS=""
if [[ "${_FSTYPE}" == "btrfs" ]]; then if [[ "${_FSTYPE}" == "btrfs" ]]; then
_BTRFS_DEVS="${_DEV}"
[[ "${_MP}" == "/" ]] && _BTRFS_SUBVOLUME="root" [[ "${_MP}" == "/" ]] && _BTRFS_SUBVOLUME="root"
[[ "${_MP}" == "/home" ]] && _BTRFS_SUBVOLUME="home" [[ "${_MP}" == "/home" ]] && _BTRFS_SUBVOLUME="home"
_BTRFS_COMPRESS="compress=zstd" _BTRFS_COMPRESS="compress=zstd"

View file

@ -321,8 +321,8 @@ _mkfs() {
# lazytime Do not synchronously update access or modification times. Improves IO performance and flash durability. # lazytime Do not synchronously update access or modification times. Improves IO performance and flash durability.
[[ "${2}" == "f2fs" ]] && _F2FS_MOUNTOPTIONS="compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime" [[ "${2}" == "f2fs" ]] && _F2FS_MOUNTOPTIONS="compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime"
# prepare btrfs mount options # prepare btrfs mount options
[[ -n "${10}" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} subvol=${10}" [[ "${2}" == "btrfs" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} subvol=${10}"
[[ -n "${11}" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} ${11}" [[ "${2}" == "btrfs" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} ${11}"
_MOUNTOPTIONS="${_MOUNTOPTIONS} ${_SSD_MOUNT_OPTIONS} ${_F2FS_MOUNTOPTIONS}" _MOUNTOPTIONS="${_MOUNTOPTIONS} ${_SSD_MOUNT_OPTIONS} ${_F2FS_MOUNTOPTIONS}"
# eleminate spaces at beginning and end, replace other spaces with , # eleminate spaces at beginning and end, replace other spaces with ,
_MOUNTOPTIONS="$(echo "${_MOUNTOPTIONS}" | sed -e 's#^ *##g' -e 's# *$##g' | sed -e 's# #,#g')" _MOUNTOPTIONS="$(echo "${_MOUNTOPTIONS}" | sed -e 's#^ *##g' -e 's# *$##g' | sed -e 's# #,#g')"
@ -397,6 +397,4 @@ _mkfs() {
echo -n "${_DEV} ${5} ${2} defaults,${_MOUNTOPTIONS} 0 " >>/tmp/.fstab echo -n "${_DEV} ${5} ${2} defaults,${_MOUNTOPTIONS} 0 " >>/tmp/.fstab
_check_filesystem_fstab $@ _check_filesystem_fstab $@
fi fi
# clear values
unset "${7}" "${8}" "${9}" "${10}" "${11}"
} }