diff options
author | Kim <kim.sidney@gmail.com> | 2018-02-22 11:40:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 11:40:47 +0100 |
commit | 42b06c04970392d7f2df8fdbcfa9345cfab95f33 (patch) | |
tree | 76cacdc079657fb7edb0c851c6431e7c42e1acd9 /scripts | |
parent | 622228a6e8c600c895192daa7f3227602ba1237c (diff) | |
download | vyatta-cfg-system-42b06c04970392d7f2df8fdbcfa9345cfab95f33.tar.gz vyatta-cfg-system-42b06c04970392d7f2df8fdbcfa9345cfab95f33.zip |
sometimes drives report they are not aligned
And then on reboot it hangs where it should start grub
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/install/install-get-partition | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index f1b373ae..a8590031 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -688,7 +688,12 @@ create_partitions() { lecho "Creating root partition on /dev/$ldrive" # Make the root partition - output=$(parted --script --align optimal /dev/$ldrive mkpart primary 0% $root_part_size) + # if optimal_io_size is empty use default of 2048s + if [ $(cat /sys/block/$ldrive/queue/optimal_io_size) -gt 0 ]; then + output=$(parted --script --align optimal /dev/$ldrive mkpart primary 0% $root_part_size) + else + output=$(parted --script --align optimal /dev/$ldrive mkpart primary 2048s $root_part_size) + fi status=$? if [ "$status" != 0 ]; then echo -e "Error creating primary partition on $ldrive.\nPlease see $INSTALL_LOG for more details.\nExiting..." |