CentOS 無人值守安裝(ftp模式)

來源:互聯網
上載者:User

標籤:

每次安裝CentOS時候,都需要滑鼠勾選配置.一台機器安裝還可以接受,如果有多台,就不好了,下面就介紹下CentOS ftp形式無人值守安裝
  • 測試環境

    • 2台機器
      • 機器1: ip 192.168.1.103/24 跑了vsftpd服務,並且共用了/var/ftp, 目錄內容
        1. ks.cfg CentOS kickstart設定檔[就是安裝的設定檔, 每次安裝系統後,都會產生 /root/anaconda-ks.cfg]
        2. pub/CentOS/* CentOS光碟片中所有內容的複製[理論是可以掛在的, 但實驗掛在不行,讀取不到檔案]
      • 機器2 只需要放入CentOS的光碟片, 啟動後按鍵盤ESC, 輸入命令 linux ks=ftp://192.168.1.103/ks.cfg 即可完成
  • ks.cfg設定檔詳解

# Kickstart file automatically generated by anaconda.#version=DEVELinstallurl --url=ftp://192.168.1.103/pub/CentOS # 配置安裝樹目錄 本文已ftp方式lang en_US.UTF-8keyboard usnetwork --onboot no --device eth0 --mtu=1500 --bootproto dhcp --noipv6 # dhcp方式擷取iprootpw  --iscrypted $6$RyFEkouZJLufDNGf$POLwfvq2CHW2BY1qVGFzX6HoX1CsRGvaifo03Zec0uRQnupT.el3fg50b4I3pQRRMFZJqPdW8BypTe0shmZYi.# Reboot after installationrebootfirewall --service=sshauthconfig --enableshadow --passalgo=sha512selinux --enforcingtimezone --utc Asia/Shanghai # 預設時區bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb rhgb quiet quiet"# The following is the partition information you requested# Note that any partitions you deleted are not expressed# here so unless you clear all partitions first, this is# not guaranteed to workclearpart --all --drives=sda # 刪除磁碟part /boot --fstype=ext4 --size=500 # 分boot分區part / --fstype=ext4 --size=5000 # 分根分區part swap --grow --maxsize=1024 --size=1024 # 分swap分區 可以使用 `part swap --recommended` 推薦repo --name="CentOS"  --baseurl=ftp://192.168.1.103/pub/CentOS --cost=1000 # 鏡像源,包含所有的軟體包%packages --nobase@Core # 核心包, 可以自己添加多個%end%postyum install -y vim # 安裝後自動執行指令碼 可根據自己定義編寫%end

 

配置參數很多,只列出了一點詳細可參考官方網站centos kickstart 也可一用軟體自動產生ks.cfg檔案,搜尋軟體包 yum search kickstart 出來兩個 pykickstart|system-config-kickstart 安裝即可

CentOS 無人值守安裝(ftp模式)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.