Re: Kickstart-list Digest, Vol 137, Issue 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If i do not have my disk partitioning (for the purpose of dynamically calculating swap, note my logic is bit flawed for dynamic calculation, yes i divided it by a hardcoded value, but this was to test if it works) in %pre and have it outside, this works.

OS is Redhat 6.6

On Jan 29, 2016, at 9:36 AM, kickstart-list-request@xxxxxxxxxx wrote:

Send Kickstart-list mailing list submissions to
kickstart-list@xxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/kickstart-list
or, via email, send a message with subject or body 'help' to
kickstart-list-request@xxxxxxxxxx

You can reach the person managing the list at
kickstart-list-owner@xxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Kickstart-list digest..."
Today's Topics:

  1. Re: Kickstart-list Digest, Vol 137, Issue 1 (Abhijit Das)

From: Abhijit Das <abhijitd@xxxxxxxxx>
Subject: Re: Kickstart-list Digest, Vol 137, Issue 1
Date: January 29, 2016 at 9:35:50 AM PST
To: kickstart-list@xxxxxxxxxx
Reply-To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>


@ Arun - I believe it shouldn’t matter where the %pre is located. However, i have tried and the same error.

@ Chris - I appended —log /tmp/ks-pre.log to %pre but the log file is blank. /ks/anaconda.log tells me that %pre is executed but not .. 

Here i have modified %pre

%pre --log=/tmp/pre-log
#!/bin/bash
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6

disk=`sfdisk -s | head -1 | awk -F':' '{print $1}'`
mem=`cat /proc/meminfo | grep MemTotal: | sed 's/^.*MemTotal: \(.*\)kB*$/\1/'`
mem_mb=`expr $mem / 2048`
allparts=$( sfdisk -d | grep "/dev/"| grep -v "^#" | cut -d ":" -f1 )
for part in $allparts
do
 dd if=/dev/zero of=$part bs=512 count=16
done

cat << EOF > /tmp/disk_partition.sh
clearpart --all --drives=$disk
part /boot/efi --fstype=efi --grow --maxsize=200 --size=20
part /boot --fstype=ext4 --size=500
part pv.01 --grow --size=1
volgroup VolGroup01 --pesize=4096 pv.01
logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup01 --grow --size=1024
logvol swap --fstype=swap --name=lv_swap --vgname=VolGroup01 –-size=$mem_mb
EOF

APIKEY=aea1e3bb412e0e8273340f5e5ec22c33
HOSTNAME=$(hostname)
curl -s -o /tmp/deploytoken --data "private_token=${APIKEY}&hostname=${HOSTNAME}&message=preinstall_start" https://1.1.1.1/api/v2/deploy/log/start

chvt 1
exec < /dev/tty1 > /dev/tty1 2> /dev/tty1





On Jan 29, 2016, at 9:00 AM, kickstart-list-request@xxxxxxxxxx wrote:

Send Kickstart-list mailing list submissions to
kickstart-list@xxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/kickstart-list
or, via email, send a message with subject or body 'help' to
kickstart-list-request@xxxxxxxxxx

You can reach the person managing the list at
kickstart-list-owner@xxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Kickstart-list digest..."
Today's Topics:

  1. Dynamic allocation of swap not working. (Abhijit Das)
  2. Re: Dynamic allocation of swap not working. (Abhijit Das)
  3. Re: Dynamic allocation of swap not working. (Arun SAG)
  4. Re: Dynamic allocation of swap not working. (Chris Lumens)

From: Abhijit Das <abhijitz@xxxxxxxxxx>
Subject: Dynamic allocation of swap not working.
Date: January 28, 2016 at 8:34:49 PM PST
To: kickstart-list@xxxxxxxxxx
Reply-To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>



Trying to dynamically allocate swap

logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup00 --grow --size=1024
%include /tmp/swap_partition

%pre
#!/bin/bash
mem=`cat /proc/meminfo | grep MemTotal: | sed 's/^.*MemTotal: \(.*\)kB*$/\1/'`
mem_mb=`expr $mem / 1024`
echo "logvol swap --name=lv_swap --vgname=VolGroup00 –-size=$mem_mb" > /tmp/swap_partition

It throws an error that /tmp/swap_partition is not found. Please advise how should i proceed.










From: Abhijit Das <abhijitz@xxxxxxxxxx>
Subject: Re: Dynamic allocation of swap not working.
Date: January 28, 2016 at 9:14:56 PM PST
To: kickstart-list@xxxxxxxxxx
Reply-To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>


I tried every possible way … still same error,

Here is my command section.

clearpart --linux
zerombr

part /boot/efi --fstype=efi --grow --maxsize=200 --size=20
part /boot --fstype=ext4 --size=500
part pv.008002 --grow --size=1

%include /tmp/disk_partition.cfg




Here is my complete %pre section now.

%pre
mem=`cat /proc/meminfo | grep MemTotal: | sed 's/^.*MemTotal: \(.*\)kB*$/\1/'`
mem_mb=`expr $mem / 1024`

cat << EOF > /tmp/disk_partition.cfg
volgroup VolGroup00 --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup00 --grow --size=1024
logvol swap --name=lv_swap --vgname=VolGroup00 –-size=$mem_mb
EOF

sleep 5

exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6

APIKEY=xxxx
HOSTNAME=$(hostname)
curl -s -o /tmp/deploytoken --data "private_token=${APIKEY}&hostname=${HOSTNAME}&message=preinstall_start" https://<internal_URL>

chvt 1



On Jan 28, 2016, at 8:34 PM, Abhijit Das <abhijitz@xxxxxxxxxx> wrote:


Trying to dynamically allocate swap

logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup00 --grow --size=1024
%include /tmp/swap_partition

%pre
#!/bin/bash
mem=`cat /proc/meminfo | grep MemTotal: | sed 's/^.*MemTotal: \(.*\)kB*$/\1/'`
mem_mb=`expr $mem / 1024`
echo "logvol swap --name=lv_swap --vgname=VolGroup00 –-size=$mem_mb" > /tmp/swap_partition

It throws an error that /tmp/swap_partition is not found. Please advise how should i proceed.











From: Arun SAG <sagarun@xxxxxxxxx>
Subject: Re: Dynamic allocation of swap not working.
Date: January 28, 2016 at 9:44:53 PM PST
To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>
Reply-To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>


On Thu, Jan 28, 2016 at 09:14:56PM -0800, Abhijit Das wrote:
I tried every possible way … still same error,

Here is my command section.

clearpart --linux
zerombr

part /boot/efi --fstype=efi --grow --maxsize=200 --size=20
part /boot --fstype=ext4 --size=500
part pv.008002 --grow --size=1

%include /tmp/disk_partition.cfg


Try moving the %include /tmp/disk_partition.cfg below the %pre section in
your kickstart file



From: Chris Lumens <clumens@xxxxxxxxxx>
Subject: Re: Dynamic allocation of swap not working.
Date: January 29, 2016 at 8:09:08 AM PST
To: kickstart-list@xxxxxxxxxx
Reply-To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>


Trying to dynamically allocate swap

logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup00 --grow --size=1024
%include /tmp/swap_partition

%pre
#!/bin/bash
mem=`cat /proc/meminfo | grep MemTotal: | sed 's/^.*MemTotal: \(.*\)kB*$/\1/'`
mem_mb=`expr $mem / 1024`
echo "logvol swap --name=lv_swap --vgname=VolGroup00 ???-size=$mem_mb" > /tmp/swap_partition

It throws an error that /tmp/swap_partition is not found. Please advise how should i proceed.

What OS and version?  Are there any other errors in your
/tmp/anaconda.log or on tty1?

- Chris




_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list



_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux