daily pastebin goal
92%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include /tmp/part-include
  2. %pre
  3.  
  4. #set $disk = $getVar('$disk', 'sda')
  5.  
  6. memKiB=`awk '/MemTotal:/{print $2 }' /proc/meminfo` memMiB=`expr $memKiB / 1024` mem=`expr \( \( $memMiB / 32 \) + 1 \) \* 32`
  7.  
  8. swapsize = 2048
  9.  
  10. if [ $mem -gt 2048  -a $mem -lt 8192 ]; then
  11.    swapsize=4096
  12. elif [ $mem -gt 8100 ]; then
  13.    swapsize=8192
  14. fi
  15.  
  16. # Default partition layout suitable for most servers
  17. # /boot    512M
  18. # swap     XXXXM
  19. # /        64G - 512M /boot - XXXXM swap
  20. # /data    Rest of disk
  21. cat <<-EOpart > /tmp/part-include
  22.     clearpart --drives=$disk --initlabel
  23.     part /boot --fstype ext3 --size=512 --asprimary --ondisk=$disk
  24.     part swap --size=$swapsize --asprimary --ondisk=$disk
  25.     part pv.00 --size=65536 --asprimary --ondisk=$disk
  26.     part pv.01 --size=100 --grow --ondisk=$disk --asprimary
  27.     volgroup OSVolGroup pv.00
  28.     logvol / --vgname=OSVolGroup --size=100 --grow --name=sysroot --fstype ext3
  29.     volgroup DataVolGroup pv.01
  30.     logvol /data --vgname=DataVolGroup --size=100 --grow --name=appdata --fstype ext3 --bytes-per-inode=65536
  31. EOpart
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top