![현재 설치에서 부팅 가능한 ISO 이미지 만들기](https://linux55.com/image/198644/%ED%98%84%EC%9E%AC%20%EC%84%A4%EC%B9%98%EC%97%90%EC%84%9C%20%EB%B6%80%ED%8C%85%20%EA%B0%80%EB%8A%A5%ED%95%9C%20ISO%20%EC%9D%B4%EB%AF%B8%EC%A7%80%20%EB%A7%8C%EB%93%A4%EA%B8%B0.png)
우리는 오래된 물리적 기계를 가지고 있습니다.우분투 배포판 버전 20.04실제 머신에는 총 과 가 103GB /root partition
있습니다 10GB as swap memory
. 현재 우리는 최대 45GB의 공간을 사용했습니다. 현재 설치에서 부팅 가능한 ISO 이미지를 생성하려고 합니다.
또한 다음 패키지를 사용하여 이미지를 생성하려고 합니다. 이 패키지를 실행하는 동안 "filesystem.squashfs 크기가 4GB를 초과합니다"라는 오류가 발생했습니다. 그런 다음 파일 시스템 파일이 8GB 이상을 소비하는지 확인했습니다. 따라서 이미지 파일을 생성할 수 없습니다. 현재 설치에서 이미지를 생성할 수 있는 다른 패키지/도구가 있나요? 감사해요!
1.remastersys – respin –https://itectec.com/ubuntu/ubuntu-build-the-own-ubuntu-iso/
2.distroshare 이미지 생성기 -https://github.com/Distroshare/distroshare-ubuntu-imager
답변1
이것은 스크립트입니다. 메모에 주의를 기울이세요. USB에 넣어서 부팅해야 합니다. Balena 에칭 기계는 iso에 적합합니다. iso는 스크립트에 의해 생성된 LIVE_BOOT 폴더에 위치합니다. balena etcher와 충분히 큰 USB 스틱 또는 외장 하드 드라이브를 사용하여 이미지를 사용 가능한 곳에 배치합니다. 루프백 장치로 설치할 수도 있습니다. 라이브 시스템 설치 및/또는 시스템 영구화에 대한 몇 가지 유용한 지침이 온라인에 있습니다.
스크립트를 텍스트 파일에 저장하고 실행합니다. makelive, "chmod +x makelive", "./makelive"와 같은 텍스트 파일 이름을 지정합니다. 댓글 아래의 변수를 변경하여 사전에 사물의 이름을 변경할 수도 있습니다. 즐기다!
#!/bin/bash
# Will create live iso from currently installed Debian system
#
# Make sure these are installed before starting this script
# Depends: rsync live-boot systemd-sysv debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin grub-efi-ia32-bin mtools dosfstools resolvconf
#
# Run script as root or under su in terminal
# Variables for computer name, iso name and volume label
HOSTNAME=debian-live
ISONAME=debian-live
LABEL=DEBLIVE
mkdir -p $HOME/LIVE_BOOT $HOME/LIVE_BOOT/chroot &&
rsync -aAXv --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,$HOME/LIVE_BOOT/*} /* $HOME/LIVE_BOOT/chroot &&
printf "" > $HOME/LIVE_BOOT/chroot/etc/fstab && printf "" > $HOME/LIVE_BOOT/chroot/etc/resolv.conf &&
echo "$HOSTNAME" > $HOME/LIVE_BOOT/chroot/etc/hostname &&
mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/BOOT,boot/grub/x86_64-efi,isolinux,live},tmp} &&
mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot &&
cp $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz && cp $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd &&
touch $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg &&
printf "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 600\nMENU RESOLUTION 640 480\nMENU COLOR border 30;44 #40ffffff #a0000000 std\nMENU COLOR title 1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel 7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel 37;44 #50ffffff #a0000000 std\nMENU COLOR help 37;40 #c0ffffff #a0000000 std\nMENU COLOR timeout_msg 37;40 #80ffffff #00000000 std\nMENU COLOR timeout 1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07 37;40 #90ffffff #a0000000 std\nMENU COLOR tabmsg 31;40 #30ffffff #00000000 std\n\nLABEL linux\n MENU LABEL Debian Live [BIOS/ISOLINUX]\n MENU DEFAULT\n KERNEL /live/vmlinuz\n APPEND initrd=/live/initrd boot=live\n\n LABEL linux\n MENU LABEL Debian Live [BIOS/ISOLINUX] (nomodeset)\n MENU DEFAULT\n KERNEL /live/vmlinuz\n APPEND initrd=/live/initrd boot=live nomodeset\nEOF" > $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg &&
touch $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg &&
printf "insmod part_gpt\ninsmod part_msdos\ninsmod fat\ninsmod iso9660\n\ninsmod all_video\ninsmod font\n\nset default=\"0\"\nset timeout=30\n\n# If X has issues finding screens, experiment with/without nomodeset.\n\nmenuentry \"Debian Live [EFI/GRUB]\" {\n search --no-floppy --set=root --label $LABEL\n linux (\$root)/live/vmlinuz boot=live\n initrd (\$root)/live/initrd\n}\n\nmenuentry \"Debian Live [EFI/GRUB] (nomodeset)\" {\n search --no-floppy --set=root --label $LABEL\n linux (\$root)/live/vmlinuz boot=live nomodeset\n initrd (\$root)/live/initrd\n}\nEOF" > $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg &&
cp $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg $HOME/LIVE_BOOT/staging/EFI/BOOT/ &&
touch $HOME/LIVE_BOOT/tmp/grub-embed.cfg &&
printf "if ! [ -d \"\$cmdpath\" ]; then\n # On some firmware, GRUB has a wrong cmdpath when booted from an optical disc.\n # https://gitlab.archlinux.org/archlinux/archiso/-/issues/183\n if regexp --set=1:isodevice '^(\([^)]+\))\/?[Ee][Ff][Ii]\/[Bb][Oo][Oo][Tt]\/?$' \"\$cmdpath\"; then\n cmdpath=\"\${isodevice}/EFI/BOOT\"\n fi\nfi\nconfigfile \"\${cmdpath}/grub.cfg\"\nEOF" > $HOME/LIVE_BOOT/tmp/grub-embed.cfg &&
cp /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/" && cp /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/" &&
cp -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/" &&
grub-mkstandalone -O i386-efi --modules="part_gpt part_msdos fat iso9660" --locales="" --themes="" --fonts="" --output="$HOME/LIVE_BOOT/staging/EFI/BOOT/BOOTIA32.EFI" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-embed.cfg" &&
grub-mkstandalone -O x86_64-efi --modules="part_gpt part_msdos fat iso9660" --locales="" --themes="" --fonts="" --output="$HOME/LIVE_BOOT/staging/EFI/BOOT/BOOTx64.EFI" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-embed.cfg" &&
(cd $HOME/LIVE_BOOT/staging && dd if=/dev/zero of=efiboot.img bs=1M count=20 && mkfs.vfat efiboot.img && mmd -i efiboot.img ::/EFI ::/EFI/BOOT && mcopy -vi efiboot.img $HOME/LIVE_BOOT/staging/EFI/BOOT/BOOTIA32.EFI $HOME/LIVE_BOOT/staging/EFI/BOOT/BOOTx64.EFI $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg ::/EFI/BOOT/) &&
xorriso -as mkisofs -iso-level 3 -o "${HOME}/LIVE_BOOT/$ISONAME.iso" -full-iso9660-filenames -volid "$LABEL" --mbr-force-bootable -partition_offset 16 -joliet -joliet-long -rational-rock -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-boot isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table --eltorito-catalog isolinux/isolinux.cat -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat -append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${HOME}/LIVE_BOOT/staging/efiboot.img "${HOME}/LIVE_BOOT/staging"
chmod 755 $HOME/LIVE_BOOT/$ISONAME.iso
rm -r $HOME/LIVE_BOOT/staging/
rm -r $HOME/LIVE_BOOT/chroot/
rm -r $HOME/LIVE_BOOT/tmp/