如何在 Cobbler 上導入和啟動 Ubuntu

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

如何在 Cobbler 上導入和啟動 Ubuntu

Cobbler 在 CentOS/RHEL/Fedora 系的發行版上工作良好,在 CentOS/RHEL/Fedora 上安裝 Cobbler 以後可以直接導入 CentOS/RHEL/Fedora ISO 文件,很順利,不過導入 Ubuntu/Debian ISO 就不是那麼幸運了,直接導入 ubuntu-11.10-server-amd64.iso 的話會報錯:

# cobbler import –path=/mnt/ –name=ubuntu-11.10-server-amd64
...
sent 710595315 bytes  received 36388 bytes  52639385.41 bytes/sec
total size is 710349452  speedup is 1.00
...
!!! TASK FAILED !!!

忽略上面的錯誤,會發現在 ks_mirror 下面已經導入了 ubuntu-11.10-server-amd64 整個 ubuntu 目錄:

# ls /var/www/cobbler/ks_mirror/
config  ubuntu-11.10-server-amd64

如果對上面已經導入的 ubuntu 目錄還不放心的話,可以刪除這個目錄後手動導入(直接 cp 就行):

# rm -rf /var/www/cobbler/ks_mirror/ubuntu-11.10-server-amd64

# mount -o loop -t iso9660 ubuntu-11.10-server-amd64.iso /mnt

# cp -r /mnt/ /var/www/cobbler/ks_mirror/ubuntu-11.10-server-amd64

完成導入(拷貝)后,做個鏈接:

# cd /var/www/cobbler/links/
# ln -s /var/www/cobbler/ks_mirror/ubuntu-11.10-server-amd64 ubuntu-11.10-server-amd64

然後加入 distro 和 profile:

# cobbler distro add --name=ubuntu-11.10-server-amd64 --kernel=/var/www/cobbler/ks_mirror/ubuntu-11.10-server-amd64/install/netboot/ubuntu-installer/amd64/linux --initrd=/var/www/cobbler/ks_mirror/ubuntu-11.10-server-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz --arch=x86_64 --breed=ubuntu --ksmeta="directory=/cblr/links/ubuntu-11.10-server-amd64"

# cobbler profile add --name=ubuntu-11.10-server-amd64 --distro=ubuntu-11.10-server-amd64 --kickstart=/var/lib/cobbler/kickstarts/ubuntu-11.10-server-amd64.seed

最後我們需要 ubuntu 能完成自動安裝,加入以下 kickstart 腳本 ubuntu-11.10-server-amd64.seed 到 /var/lib/cobbler/kickstarts/ :

# vi /var/lib/cobbler/kickstarts/ubuntu-11.10-server-amd64.seed
d-i     debian-installer/locale string en_US.UTF-8
d-i     debian-installer/splash boolean false
d-i     console-setup/ask_detect        boolean false
d-i     console-setup/layoutcode        string us
d-i     console-setup/variantcode       string
d-i     netcfg/get_nameservers  string
d-i     netcfg/get_ipaddress    string
d-i     netcfg/get_netmask      string 255.255.255.0
d-i     netcfg/get_gateway      string
d-i     netcfg/confirm_static   boolean true
d-i     clock-setup/utc boolean true
d-i     partman-auto/method string regular
d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman/confirm_write_new_label boolean true
d-i     partman/choose_partition        select Finish partitioning and write changes to disk
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     partman/default_filesystem string ext3
d-i     clock-setup/utc boolean true
d-i     clock-setup/ntp boolean true
d-i     clock-setup/ntp-server  string ntp.ubuntu.com
d-i     base-installer/kernel/image     string linux-server
d-i     passwd/root-login       boolean false
d-i     passwd/make-user        boolean true
d-i     passwd/user-fullname    string ubuntu
d-i     passwd/username string ubuntu
d-i     passwd/user-password-crypted    password $default_password_crypted
d-i     passwd/user-uid string
d-i     user-setup/allow-password-weak  boolean false
d-i     user-setup/encrypt-home boolean false
d-i     passwd/user-default-groups      string adm cdrom dialout lpadmin plugdev sambashare
d-i     apt-setup/services-select       multiselect security
d-i     apt-setup/security_host string security.ubuntu.com
d-i     apt-setup/security_path string /ubuntu
d-i     debian-installer/allow_unauthenticated  string false
d-i     pkgsel/upgrade  select safe-upgrade
d-i     pkgsel/language-packs   multiselect
d-i     pkgsel/update-policy    select none
d-i     pkgsel/updatedb boolean true
d-i     grub-installer/skip     boolean false
d-i     lilo-installer/skip     boolean false
d-i     grub-installer/only_debian      boolean true
d-i     grub-installer/with_other_os    boolean true
d-i     finish-install/keep-consoles    boolean false
d-i     finish-install/reboot_in_progress       note
d-i     cdrom-detect/eject      boolean true
d-i     debian-installer/exit/halt      boolean false
d-i     debian-installer/exit/poweroff  boolean false
d-i     pkgsel/include string openssh-server





[火星人 ] 如何在 Cobbler 上導入和啟動 Ubuntu已經有592次圍觀

http://coctec.com/docs/service/show-post-785.html