mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-12-22 12:05:04 +01:00
Adapted logic for optimal blocksize
This commit is contained in:
parent
86b62a8805
commit
05ed400c32
@ -78,9 +78,15 @@ set_device_path(){
|
||||
then
|
||||
error "$device_path is not valid device."
|
||||
fi
|
||||
info "Device path set to: $device_path"
|
||||
# @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)") &&
|
||||
info "Device path set to: $device_path" &&
|
||||
PHYSICAL_BLOCK_SIZE_PATH="/sys/block/$device/queue/physical_block_size"
|
||||
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" ||
|
||||
error
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user