don't use swap size above 16G
This commit is contained in:
parent
2e5de10b64
commit
03b00859f4
1 changed files with 7 additions and 1 deletions
6
entry.sh
6
entry.sh
|
@ -76,7 +76,13 @@ function first_stage(){
|
||||||
|
|
||||||
export LVM_SIZE=$(dev_size ${DEVICE}2)
|
export LVM_SIZE=$(dev_size ${DEVICE}2)
|
||||||
|
|
||||||
|
if [[ $(($(mem_size)/1024/1024)) -gt 16384 ]]
|
||||||
|
then
|
||||||
|
export SWAP_SIZE=16384
|
||||||
|
else
|
||||||
export SWAP_SIZE=$(($(mem_size)/1024/1024))
|
export SWAP_SIZE=$(($(mem_size)/1024/1024))
|
||||||
|
fi
|
||||||
|
|
||||||
export ROOT_SIZE=$(($LVM_SIZE/1024/1024-$SWAP_SIZE-512))
|
export ROOT_SIZE=$(($LVM_SIZE/1024/1024-$SWAP_SIZE-512))
|
||||||
|
|
||||||
echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M
|
echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M
|
||||||
|
|
Loading…
Reference in a new issue