Product SiteDocumentation Site

13.4. kickstart 选​项​

下​面​的​选​项​可​以​放​入 kickstart 文​件​。​如​果​你​喜​欢​使​用​图​形​化​的​界​面​来​创​建 kickstart 文​件​,你​可​以​使​用​「​Kickstart 配​置​」​应​用​程​序​。​详​情​请​参​考 第 14 章 Kickstart Configurator。​

Note

如​果​某​选​项​后​面​跟​随​了​一​个​等​号​(=),它​后​面​就​必​须​指​定​一​个​值​。​在​示​例​命​令​中​,括​号​([])中​的​选​项​是​命​令​的​可​选​参​数​。​
autopart(可​选​)
ignoredisk(可​选​)
ignoredisk --drives=drive1,drive2,...
autostep(可​选​)
authauthconfig(必​需​)
bootloader(必​需​)
clearpart(可​选​)
cmdline(可​选​)
device(可​选​)
device <type> <moduleName> --opts=<options>
driverdisk(可​选​)
driverdisk <partition> [--type=<fstype>]
driverdisk --source=ftp://path/to/dd.img
driverdisk --source=http://path/to/dd.img
driverdisk --source=nfs:host:/path/to/img
firewall(可​选​)
firewall --enabled|--disabled [--trust=] <device> [--port=]
firstboot(可​选​)
halt(可​选​)
graphical(可​选​)
install(可​选​)
  • cdrom — Install from the first CD-ROM drive on the system.
  • harddrive — Install from a Red Hat installation tree on a local drive, which must be either vfat or ext2.
    • --biospart=
      从 BIOS 分​区​来​安​装​(如 82)。​
    • --partition=
      从​分​区​安​装​(如 sdb2)。​
    • --dir=
      包​含​安​装​树​的 variant 目​录​的​目​录​。​
    例​如​:
    harddrive --partition=hdb2 --dir=/tmp/install-tree
    
  • nfs — Install from the NFS server specified.
    • --server=
      要​从​中​安​装​的​服​务​器​(主​机​名​或 IP)。​
    • --dir=
      包​含​安​装​树​的 variant 目​录​的​目​录​。​
    • --opts=
      用​于​挂​载 NFS 输​出​的 Mount 选​项​(可​选​)。​
    例​如​:
    nfs --server=nfsserver.example.com --dir=/tmp/install-tree
    
  • url — Install from an installation tree on a remote server via FTP or HTTP.
    例​如​:
    url --url http://<server>/<dir>
    
    或​:
    url --url ftp://<username>:<password>@<server>/<dir>
    
interactive(可​选​)
iscsi(可​选​)
key(可​选​)
keyboard(必​需​)
be-latin1, bg, br-abnt2, cf, cz-lat2, cz-us-qwertz, de, de-latin1, 
de-latin1-nodeadkeys, dk, dk-latin1, dvorak, es, et, fi, fi-latin1, 
fr, fr-latin0, fr-latin1, fr-pc, fr_CH, fr_CH-latin1, gr, hu, hu101, 
is-latin1, it, it-ibm, it2, jp106, la-latin1, mk-utf, no, no-latin1, 
pl, pt-latin1, ro_win, ru, ru-cp1251, ru-ms, ru1, ru2,  ru_win, 
se-latin1, sg, sg-latin1, sk-qwerty, slovene, speakup,  speakup-lt, 
sv-latin1, sg, sg-latin1, sk-querty, slovene, trq, ua,  uk, us, us-acentos
lang(必​需​)
lang en_US
langsupport (deprecated)
@french-support
logvol(可​选​)
logvol <mntpoint> --vgname=<name> --size=<size> --name=<name> <options>
part pv.01 --size 3000 
volgroup myvg pv.01
logvol / --vgname=myvg --size=2000 --name=rootvol
logging(可​选​)
mediacheck(可​选​)
monitor(可​选​)
mouse(已​取​消​)
network(可​选​)
multipath(可​选​)
partpartition(对​于​安​装​是​必​需​的​,升​级​可​忽​略​)。
请​参​考 第 13.4.1 节 “高​级​的​分​区​示​例​” 里​关​于 part 的​详​细​示​例​。​
  • <mntpoint> — The <mntpoint> is where the partition is mounted and must be of one of the following forms:
    • /<path>
      例​如​,/、​/usr、​/home
    • swap
      该​分​区​被​用​作​交​换​空​间​。​
      要​自​动​决​定​交​换​分​区​的​大​小​,使​用 --recommended 选​项​:
      swap --recommended
      
      The recommended maximum swap size for machines with less than 2GB of RAM is twice the amount of RAM. For machines with 2GB or more, this recommendation changes to 2GB plus the amount of RAM.
    • raid.<id>
      该​分​区​用​于 software RAID(参​考 raid)。​
    • pv.<id>
      该​分​区​用​于 LVM(参​考 logvol)。​
  • --size= — The minimum partition size in megabytes. Specify an integer value here such as 500. Do not append the number with MB.
  • --grow — Tells the partition to grow to fill available space (if any), or up to the maximum size setting.

    Note

    If you use --grow= without setting --maxsize= on a swap partition, Anaconda will limit the maximum size of the swap partition. For systems that have less than 2GB of physical memory, the imposed limit is twice the amount of physical memory. For systems with more than 2GB, the imposed limit is the size of physical memory plus 2GB.
  • --maxsize= — The maximum partition size in megabytes when the partition is set to grow. Specify an integer value here, and do not append the number with MB.
  • --noformat — Tells the installation program not to format the partition, for use with the --onpart command.
  • --onpart= or --usepart= — Put the partition on the already existing device. For example:
    partition /home --onpart=hda1
    
    /home 置​于​必​须​已​经​存​在​的 /dev/hda1 上​。​
  • --ondisk= or --ondrive= — Forces the partition to be created on a particular disk. For example, --ondisk=sdb puts the partition on the second SCSI disk on the system.
  • --asprimary — Forces automatic allocation of the partition as a primary partition, or the partitioning fails.
  • --type= (replaced by fstype) — This option is no longer available. Use fstype.
  • --fstype= — Sets the file system type for the partition. Valid values are xfs, ext2, ext3, ext4, swap, vfat, and hfs.
  • --start= — Specifies the starting cylinder for the partition. It requires that a drive be specified with --ondisk= or ondrive=. It also requires that the ending cylinder be specified with --end= or the partition size be specified with --size=.
  • --end= — Specifies the ending cylinder for the partition. It requires that the starting cylinder be specified with --start=.
  • --bytes-per-inode= — Specifies the size of inodes on the filesystem to be made on the partition. Not all filesystems support this option, so it is silently ignored for those cases.
  • --recommended — Determine the size of the partition automatically.
  • --onbiosdisk — Forces the partition to be created on a particular disk as discovered by the BIOS.
  • --encrypted — Specifies that this partition should be encrypted.
  • --passphrase= — Specifies the passphrase to use when encrypting this partition. Without the above --encrypted option, this option does nothing. If no passphrase is specified, the default system-wide one is used, or the installer will stop and prompt if there is no default.

Note

如​果​因​为​某​种​原​因​分​区​失​败​了​,虚​拟​终​端 3 上​会​显​示​诊​断​信​息​。​
poweroff(可​选​)
raid(可​选​)
raid <mntpoint> --level=<level> --device=<mddevice> <partitions*>
part raid.01 --size=60 --ondisk=sda
part raid.02 --size=60 --ondisk=sdb 
part raid.03 --size=60 --ondisk=sdc
part swap --size=128 --ondisk=sda  
part swap --size=128 --ondisk=sdb  
part swap --size=128 --ondisk=sdc
part raid.11 --size=1 --grow --ondisk=sda  
part raid.12 --size=1 --grow --ondisk=sdb  
part raid.13 --size=1 --grow --ondisk=sdc
raid / --level=1 --device=md0 raid.01 raid.02 raid.03  
raid /usr --level=5 --device=md1 raid.11 raid.12 raid.13
reboot(可​选​)
repo(可​选​)
repo --name=<repoid> [--baseurl=<url>| --mirrorlist=<url>]
rootpw(必​需​)
rootpw [--iscrypted] <password>
selinux(可​选​)
selinux [--disabled|--enforcing|--permissive]
services(可​选​)
shutdown(可​选​)
skipx(可​选​)
text(可​选​)
timezone(可​选​)
timezone [--utc] <timezone>
upgrade(可​选​)
user(可​选​)
user --name=<username> [--groups=<list>] [--homedir=<homedir>] [--password=<password>] [--iscrypted] [--shell=<shell>] [--uid=<uid>]
vnc(可​选​)
vnc [--host=<hostname>] [--port=<port>] [--password=<password>]
volgroup(可​选​)
volgroup <name> <partition> <options>
part pv.01 --size 3000 
volgroup myvg pv.01 
logvol / --vgname=myvg --size=2000 --name=rootvol
请​参​考 第 13.4.1 节 “高​级​的​分​区​示​例​” 里​的 volgroup 的​详​细​示​例​。​
xconfig(可​选​)
zerombr(可​选​)
zfcp(可​选​)
%include (optional)
下​面​是​一​个​简​单​的​、​集​成​的​示​例​,它​展​示​了 clearpart、​raidpartvolgrouplogvol 等 kickstart 选​项​:
clearpart --drives=hda,hdc --initlabel  
# Raid 1 IDE config 
part raid.11    --size 1000     --asprimary     --ondrive=hda 
part raid.12    --size 1000     --asprimary     --ondrive=hda 
part raid.13    --size 2000     --asprimary     --ondrive=hda 
part raid.14    --size 8000                     --ondrive=hda 
part raid.15    --size 1 --grow                 --ondrive=hda             
part raid.21    --size 1000     --asprimary     --ondrive=hdc 
part raid.22    --size 1000     --asprimary     --ondrive=hdc 
part raid.23    --size 2000     --asprimary     --ondrive=hdc 
part raid.24    --size 8000                     --ondrive=hdc 
part raid.25    --size 1 --grow                 --ondrive=hdc  

# You can add --spares=x  
raid /          --fstype ext3 --device md0 --level=RAID1 raid.11 raid.21 
raid /safe      --fstype ext3 --device md1 --level=RAID1 raid.12 raid.22 
raid swap       --fstype swap --device md2 --level=RAID1 raid.13 raid.23 
raid /usr       --fstype ext3 --device md3 --level=RAID1 raid.14 raid.24 
raid pv.01      --fstype ext3 --device md4 --level=RAID1 raid.15 raid.25  

# LVM configuration so that we can resize /var and /usr/local later 
volgroup sysvg pv.01     
logvol /var             --vgname=sysvg  --size=8000     --name=var 
logvol /var/freespace   --vgname=sysvg  --size=8000     --name=freespacetouse 
logvol /usr/local       --vgname=sysvg  --size=1 --grow --name=usrlocal
这​个​高​级​示​例​实​现​了 RAID 上​的 LVM,以​及​根​据​以​后​的​需​要​重​新​调​整​不​同​目​录​的​大​小​的​能​力​。​