Browse Source

Sync filesystem changes before checking partition exists (#186)

time-fix
Luke Childs 5 years ago
committed by GitHub
parent
commit
8333ba3126
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      scripts/umbrel-os/external-storage/mount

6
scripts/umbrel-os/external-storage/mount

@ -37,6 +37,9 @@ check_dependencies () {
# Returns a list of block device paths
list_block_devices () {
# We need to run sync here to make sure the filesystem is reflecting the
# the latest changes in /sys/block/sd*
sync
# We use "2>/dev/null || true" to swallow errors if there are
# no block devices. In that case the function just returns nothing
# instead of an error which is what we want.
@ -58,6 +61,9 @@ get_block_device_model () {
is_partition_ext4 () {
partition_path="${1}"
# We need to run sync here to make sure the filesystem is reflecting the
# the latest changes in /dev/*
sync
blkid -o value -s TYPE "${partition_path}" | grep --quiet '^ext4$'
}

Loading…
Cancel
Save