kickstart from a USB
I am trying to use a USB media for my kick start.
Step 1;
In my system if I connect a USB, it will detect as /dev/sdb1
I add the fllowing lines to my ks.cfg file
Load from USB Stick
harddrive --partition=sdb1 --dir=/
.
.
.
clearpart --all --initlabel --drives=sda
------------------------------------------
Disk partitioning information
------------------------------------------
part /boot --fstype=ext4 --size 100 --ondisk=sda --asprimary
part / --fstype=ext4 --size=2000 --grow --ondisk=sda --asprimary
and I modify the isolinux.cfg file to point to the ks.cfg file
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=hd:sdb1:/ks.cfg
I boot the computer with kickstart and it couldn't find the kickstart file!
Step 2:
I did the following changes;
In the kc.cfg file I change sdb1 to sda1:
Load from USB Stick
harddrive --partition=sda1 --dir=/
and in the isolinux.cfg file
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=hd:sda1:/ks.cfg
I boot the computer with kick start and the message was" there is no space to make the partitions (I think it was trying to partition the USB)
Step 3:
change the kickstart file where the hard drive partitioning occurs to:
clearpart --all --initlabel --drives=sdb
------------------------------------------
Disk partitioning information
------------------------------------------
part /boot --fstype=ext4 --size 100 --ondisk=sdb --asprimary
part / --fstype=ext4 --size=2000 --grow --ondisk=sdb --asprimary
I boot the computer and it load from USB, it partition the hard drive and after reboot, whithout USB conected, I am getting GRUB prompt ( I think the issue is it does not see the hard drive MRB). If I attache the USB and reboot, the system will boot with redhat?
Result;
If I use USB as /dev/sda1 then make the hard-drive as /dev/sdb there is a problem and somehow the USB becomming hard-drive MBR.
If I use USB as /dev/sdb1 then the system does not see the kickstart file!
Responses
Hi NRP
Which version of Red Hat Linux did you want to make your kickstart for? I suspect you are using rhel 6 with the /boot partition being ext4. Is it workstation or server?
By the way, when posting 'code', use '~~~' beginning and ending. The '#' at the beginning of text will cause the text to become huge. It would be tremendously easier to read your kickstart file if it was surrounded (beginning and end) with '~~~' characters
Example: (the below bit has three "~~~" characters, three above and three below to create the boxed code text below...
your code goes here
# hash marks to not cause the code
# to become 72p font when three tildes
# are used.
As an aside, consider using LVM or labels instead of the bare node name for your disk, here is why: (Red Hat article).
I noticed no bootloader directive in your kickstart. See this Red Hat documentation on the bootloader and other directives for kickstarts. The bootloader directive is mandatory according to paragraph 31.4 (scroll down to 'bootloader').
- Here's an example for rhel 6.
- This bit below assumes a disk of sda
-
The partitioning below may not suit your needs and there's worthwhile discussions on specific sizes, of course all based on the size of your available storage.
-
Note in the bit below with the use of the 'bootloader' directive.
zerombr
clearpart --all --initlabel
part /boot --label=boot --fstype=ext4 --size=512 --asprimary
partition pv.2 --size=0 --grow --ondisk=sda
volgroup disk0 --pesize=32768 pv.2
logvol swap --fstype swap --name=swap --vgname=disk0 --recommended
logvol / --fstype ext4 --name=slash --vgname=disk0 --grow --size=100
logvol /var --fstype ext4 --name=var --vgname=disk0 --size=12000
logvol /var/log --fstype ext4 --name=varlog --vgname=disk0 --size=8192
logvol /var/log/audit --fstype ext4 --name=varlogaudit --vgname=disk0 --size=4096
logvol /home --fstype ext4 --name=home --vgname=disk0 --size=12000
logvol /tmp --fstype ext4 --name=tmp --vgname=disk0 --size=12000
bootloader --location mbr --password changemeNow
This example above is a quick example and should be changed depending if your system is a workstation, a server, or what role your system may fulfill. The partitioning needs will certainly differ from what you actually need for size partitioning.
If you wanted an example of a kickstart file, use the anaconda-ks.cfg (named something like that) from an existing Linux system you have in the /root/ partition as an start point example. Additionally, you could install "system-config-kickstart" and create a kickstart file.
yum -y install system-config-kickstart
then run (as yourself)
system-config-kickstart
Kind Regards...
See this example uses rhel 6; note the bootloader directive in the file.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
