Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-26926

Non-existing parameter used as example on dynamic partition

XMLWordPrintable

    • Sat_docs_11_2024
    • None

      This section has an example of dynamic partition:

      https://docs.redhat.com/en/documentation/red_hat_satellite/6.14/html-single/provisioning_hosts/index#dynamic-partition-example_provisioning

       

      This is the code on the example:

       

      #Dynamic (do not remove this line)
      
      MEMORY=$((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024))
      if [ "$MEMORY" -lt 2048 ]; then
          SWAP_MEMORY=$(($MEMORY * 2))
      elif [ "$MEMORY" -lt 8192 ]; then
          SWAP_MEMORY=$MEMORY
      elif [ "$MEMORY" -lt 65536 ]; then
          SWAP_MEMORY=$(($MEMORY / 2))
      else
          SWAP_MEMORY=32768
      fi
      
      cat <<EOF > /tmp/diskpart.cfg
      zerombr yes
      clearpart --all --initlabel
      part /boot --fstype ext4 --size 200 --asprimary
      part swap --size "$SWAP_MEMORY"
      part / --fstype ext4 --size 1024 --grow
      EOF 

      After "zerombr" there shouldn't be any parameter. That "yes" over there is wrong and should not exist.  It should look like below:

      #Dynamic (do not remove this line)
      
      MEMORY=$((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024))
      if [ "$MEMORY" -lt 2048 ]; then
          SWAP_MEMORY=$(($MEMORY * 2))
      elif [ "$MEMORY" -lt 8192 ]; then
          SWAP_MEMORY=$MEMORY
      elif [ "$MEMORY" -lt 65536 ]; then
          SWAP_MEMORY=$(($MEMORY / 2))
      else
          SWAP_MEMORY=32768
      fi
      
      cat <<EOF > /tmp/diskpart.cfg
      zerombr
      clearpart --all --initlabel
      part /boot --fstype ext4 --size 200 --asprimary
      part swap --size "$SWAP_MEMORY"
      part / --fstype ext4 --size 1024 --grow
      EOF 

      This seems to be around for a while. I see it on 6.15, 6.14, 6.13, 6.12 and 6.11. I didn't go back more than that to check. 

              zuansorg Lena Ansorgová
              rhn-support-jpasqual Joniel Pasqualetto
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: