영구 저장소 없이 시스템 이미지를 만드시겠습니까?

영구 저장소 없이 시스템 이미지를 만드시겠습니까?

그래서 저는 grub에게 매번 부팅하라고 지시할 수 있지만 임시 메모리만 사용하는 시스템 이미지를 만들고 싶습니다. 완전히 설치되고 설정된 시스템 이미지를 생성한 다음 이 휘발성 상자에서 사용하고 싶습니다. 기본적으로 시작 시 변경된 내용은 유지되지만 재부팅 후에는 동일한 위치에서 시작됩니다.

나는 squashfs 이미지와 같은 것을 만든 다음 grub에게 해당 이미지를 부팅할 때마다 임시 저장 파티션을 사용하도록 지시함으로써 가능하다는 것을 알고 있지만 어떻게 해야 하는지 모르겠습니다. 어떻게 이런 식으로 간단한 데비안 이미지를 생성하고 사용할 수 있을까요?

답변1

라이브 ISO 이미지 부팅: Debian을 예로 들어 보겠습니다. 이 예에서 내 구성은 다음과 같습니다.

  • 내가 설치한 운영 체제(Debian)는 (EFI) 파티션에 있습니다.hd0,gpt5

  • iso 이미지를 사용합니다 debian-live-10.3.0-amd64-gnome+nonfree.iso.

  • 아래에 iso를 넣어두었어요/home/user/Live

40_custom설정에 따라 파일을 변경 해야 합니다 (아래 참조).

  1. 얻다iso 이미지.

  2. sudo로 열고 /etc/grub.d/40_custom다음을 추가하세요.

    set root=(hd0,gpt5) # here the partition where you placed your iso
    set iso_path=/home/user/Live/debian-live-10.3.0-amd64-gnome+nonfree.iso
    loopback loop $iso_path
    
  3. 파일 관리자를 사용하여 iso를 열고 /boot/grub/grub.cfg.

  4. 이 부분을 복사하여 이전 코드 아래에 붙여넣습니다.

    menuentry "Debian GNU/Linux Live (kernel 4.19.0-8-amd64)" {
      linux  /live/vmlinuz-4.19.0-8-amd64 boot=live components splash quiet "${loopback}"
      initrd /live/initrd.img-4.19.0-8-amd64
    }
    
  5. 로 변경:

    menuentry "Debian GNU/Linux Live(커널 4.19.0-8-amd64)" {
      운영 체제  (회보)/live/vmlinuz-4.19.0-8-amd64 boot=live 구성 요소가 자동으로 시작됩니다.findiso=$iso_path
      초기화 프로그램(회보)/live/initrd.img-4.19.0-8-amd64
    }
    

전체 파일 40_custom:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


set root=(hd0,gpt5) # here the partition where you placed your iso
set iso_path=/home/user/Live/debian-live-10.3.0-amd64-gnome+nonfree.iso
loopback loop $iso_path

menuentry "Debian GNU/Linux Live (kernel 4.19.0-8-amd64)" {
  linux  (loop)/live/vmlinuz-4.19.0-8-amd64 boot=live components splash quiet findiso=$iso_path
  initrd (loop)/live/initrd.img-4.19.0-8-amd64
}
  1. 달리기 update-grub.

다음에 재부팅하면 실시간 운영 체제를 실행하는 GRUB에 새 항목이 표시됩니다.

관련 정보