Why does anaconda fail to create the swap partition in %post script during kickstart installation of Red Hat Enterprise Linux 6?
Issue
- The kickstart file contains the following line.
logvol swap --name=lv_swap --vgname=vg_sys --size=1044
- And the
%postscript is available in the kickstart file which contains the following snippet.
# Add additional swap partitions for priority
TASK='Add additional swap partition on dasdb1'
infolog "$TASK"
mkswap /dev/dasdb1
errorlog "$?"
# Add additional swap partitions for priority
TASK='Add additional swap partition on dasdc1'
infolog "$TASK"
mkswap /dev/dasdc1
errorlog "$?"
# Enable all swap partitions
TASK='Enable dasdb1 swap partitions'
infolog "$TASK"
swapon /dev/dasdb1
errorlog "$?"
# Enable all swap partitions
TASK='Enable dasdc1 swap partitions'
infolog "$TASK"
swapon /dev/dasdc1
errorlog "$?"
- Still post installation, the
swapspace is as follows.
[root@localhost ~]# free | grep -i swap
Swap: 1212404 0 1212404
[root@localhost ~]# cat /proc/meminfo | grep -i swap
SwapCached: 0 kB
SwapTotal: 1212404 kB
SwapFree: 1212404 kB
- The swap partitions miss
/dev/dasdc1as follows.
[root@localhost ~]# swapon -s
Filename Type Size Used Priority
/dev/dm-0 partition 1081340 0 -1
/dev/dasdb1 partition 131064 0 2
- Post installation, one can create and enable the
swapmanually on/dev/dasdc1.
Environment
- Red Hat Enterprise Linux 6.6
- Kickstart
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
