livecd-iso-to-disk的overlay设置

尝试将 CentOS 6.5 的 Live ISO 映像安装到 USB 设备时遇到空间不足的问题。文章详细介绍了安装过程中报错的原因,并解释了 --overlay-size-mb 和 --home-size-mb 参数的作用。

# ./livecd-iso-to-disk --home-size-mb 900 CentOS6.5.iso  /dev/sda1

Verifying image...

Unable to fit live image + overlay on available space on USB stick

+ Size of live image:  232

+ Home overlay size:  900

---------------------------

= Requested:  1132

- Available:  932

---------------------------

= To fit, free or decrease requested size total by:  200

Cleaning up to exit...



详细的三个参数:

  • --overlay-size-mb  依赖于USB设备,占用USB的空间

  • This option sets the overlay size in megabytes. The overlay is additional storage available to the live operating system if the operating system supports it. The USB storage device must have enough free space for the image and the overlay.

  • --home-size-mb

  • Sets the home directory size in megabytes.

  • --unencrypted-home

  • Disables the encryption of the home directory.


     本文转自fengyuzaitu 51CTO博客,原文链接:http://blog.51cto.com/fengyuzaitu/1570415,如需转载请自行联系原作者




#!/bin/bash ############# Part 0 Preparation ##################### if [ $# -ne 2 ];then echo "本脚本的用法为 sudo ./pxe-set.sh ip 网卡名" echo "按任意键关闭程序" read -n 1 -s -r -p "" exit 0 else pxeserver=$1 eth=$2 echo "PXE服务器主机地址为:$pxeserver,网卡为:$eth" fi ############# Part I Install All Debs ##################### echo "Installing all debs..." dpkg -i dnsmasq/*.deb if [ $? -eq 0 ]; then echo "installing dnsmasq successfully!" else echo "installing dnsmasq failed!" echo "installing dnsmasq failed!" > pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi dpkg -i netboot/*.deb if [ $? -eq 0 ]; then echo "installing netboot successfully!" else echo "installing netboot failed!" echo "installing netboot failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi dpkg -i nfs/*.deb if [ $? -eq 0 ]; then echo "installing nfs successfully!" else echo "installing nfs failed!" echo "installing nfs failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi ############# Part II Setting Up NFS ##################### mkdir -p /var/nfs/uosamd64 echo '/var/nfs *(ro,sync,no_subtree_check)' |sudo tee -a /etc/exports systemctl restart nfs-kernel-server if [ $? -ne 0 ]; then echo "restart nfs-kernel-server failed!" echo "restart nfs-kernel-server failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi mount *.iso tmpiso cp -r tmpiso/* /var/nfs/uosamd64 cp -r tmpiso/.disk /var/nfs/uosamd64 chown root:root -R /var/nfs/uosamd64 find /var/nfs/uosamd64 -type d -exec sudo chmod 755 {} \; ############# Part III Setting Up TFTP ##################### mkdir /var/tftp cp -r /usr/lib/debian-installer/images/10/amd64/text/debian-installer /var/tftp mv /var/tftp/debian-installer/amd64/grub/grub.cfg /var/tftp/debian-installer/amd64/grub/grub.cfg.bak echo " set menu_color_normal=white/black set menu_color_highlight=black/light-gray insmod gzio menuentry "Install uos" { set gfxpayload=keep linux /debian-installer/proamd64/live/vmlinuz-5.10.0 console=tty boot=live netboot=nfs nfsroot=$pxeserver:/var/nfs/uosamd64/ components union=overlay locales=zh_CN.UTF-8 livecd-installer -- initrd /debian-installer/proamd64/live/initrd-5.10.0.lz } menuentry "Try uos without installing" { set gfxpayload=keep linux /debian-installer/amd64/live/vmlinuz console=tty boot=live union=overlay quiet splash -- initrd /debian-installer/amd64/live/initrd.lz } " > /var/tftp/debian-installer/amd64/grub/grub.cfg mkdir /var/tftp/debian-installer/proamd64 cp -r tmpiso/live /var/tftp/debian-installer/proamd64 cp -r /var/tftp/debian-installer/amd64/grubx64.efi /var/tftp/ chown dnsmasq:nogroup /var/tftp -R if [ $? -ne 0 ]; then echo "chown tftp failed!" echo "chown tftp failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi if [ $? -ne 0 ]; then echo "installing nfs failed!" echo "installing nfs failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi ############# Part IV Setting Up DNSMASQ ##################### iprange=${pxeserver%.*} echo " listen-address=$pxeserver dhcp-boot=/debian-installer/amd64/bootnetx64.efi,boothost,$pxeserver interface=$eth bind-interfaces dhcp-range=$iprange.100,$iprange.200,1h dhcp-option=3,$pxeserver dhcp-option=6,$pxeserver dhcp-option=28,$iprange.255 enable-tftp tftp-root=/var/tftp " >> /etc/dnsmasq.conf systemctl restart dnsmasq if [ $? -ne 0 ]; then echo "restart dnsmasq failed!" echo "restart dnsmasq failed!" >> pxeset.log echo "Press any key to close this window..." read -n 1 -s -r -p "" exit 0 fi systemctl restart nfs-kernel-server systemctl restart dnsmasq systemctl enable nfs-kernel-server systemctl enable dnsmasq
最新发布
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值