mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-21 22:51:05 +01:00
Adapted logic for optimal blocksize
This commit is contained in:
parent
86b62a8805
commit
05ed400c32
@ -78,9 +78,15 @@ set_device_path(){
|
|||||||
then
|
then
|
||||||
error "$device_path is not valid device."
|
error "$device_path is not valid device."
|
||||||
fi
|
fi
|
||||||
|
info "Device path set to: $device_path"
|
||||||
# @see https://www.heise.de/ct/hotline/Optimale-Blockgroesse-fuer-dd-2056768.html
|
# @see https://www.heise.de/ct/hotline/Optimale-Blockgroesse-fuer-dd-2056768.html
|
||||||
OPTIMAL_BLOCKSIZE=$(expr 64 \* "$(sudo cat /sys/block/"$device"/queue/physical_block_size)") &&
|
PHYSICAL_BLOCK_SIZE_PATH="/sys/block/$device/queue/physical_block_size"
|
||||||
info "Device path set to: $device_path" &&
|
if [ -f "$device_path" ]
|
||||||
|
then
|
||||||
|
OPTIMAL_BLOCKSIZE=$(expr 64 \* "$(sudo cat $PHYSICAL_BLOCK_SIZE_PATH)") || error
|
||||||
|
else
|
||||||
|
OPTIMAL_BLOCKSIZE="1KB"
|
||||||
|
fi
|
||||||
info "Optimal blocksize set to: $OPTIMAL_BLOCKSIZE" ||
|
info "Optimal blocksize set to: $OPTIMAL_BLOCKSIZE" ||
|
||||||
error
|
error
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user