AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1169237
Accepted
GNULinuxOnboard
GNULinuxOnboard
Asked: 2019-08-29 16:15:08 +0800 CST2019-08-29 16:15:08 +0800 CST 2019-08-29 16:15:08 +0800 CST

如何将可引导的 ISO 文件刻录到硬盘上的分区以用作救援系统?

  • 772

我计划重新安装 Ubuntu,我想将一个小型可启动恢复系统(如 SystemRescueCD)刻录到我硬盘上的一个分区,但仍然能够在同一个驱动器上安装 Ubuntu 并能够启动 Ubuntu 和恢复分区。这可能吗?如果可以,我该怎么做?编辑:我当前的 Ubuntu 版本是 19.04。

system-installation grub2 dual-boot partitioning iso
  • 1 1 个回答
  • 13837 Views

1 个回答

  • Voted
  1. Best Answer
    schrodingerscatcuriosity
    2019-08-31T15:46:00+08:002019-08-31T15:46:00+08:00

    要从分区引导 ISO 映像:

    (hd0,6) 只是一个例子,你必须根据你拥有的分区来改变它。

    1. 获取 ISO(呵呵)

    2. 选择要从中引导 ISO 映像的分区。它不需要是一个特殊的分区,它可以是任何格式,或者至少是 FAT、NTFS、EXT*。(我没有和其他人尝试过)(如果你想要持久性,它必须是FAT)。它可以包含其他数据,不会有任何影响。记下它是什么分区,即/dev/sda6

    3. 将 ISO 复制到您的分区。要进行组织,您可以/isoboot/在分区的根目录中创建一个文件夹,然后创建一个具有标识系统名称的子文件夹,然后将 ISO 粘贴到那里。

    4. 安装 ISO。最简单的方法是使用"Open with disk image mounter"文件浏览器上下文菜单中的选项,右键单击文件。

    5. 挂载后,转到目录/boot/grub/并复制文件grub.cfg。粘贴进去 /isoboot/<your_system_name>。

    6. 在您的 Ubuntu 中,使用 sudo 权限打开文件/etc/grub.d/40_custom. 添加菜单项:

      menuentry 'Your name of the ISO system' {
        set root='hd0,6' # this mean /dev/sda6
        configfile /isoboot/<your_system_name>/grub.cfg
      }
      
    7. 运行update-grub。


    这在每个 ISO 上都不同,grub 配置文件可能有不同的名称

    配置 ISO grub.cfg 文件,System Rescue CD

    使用您喜欢的文本编辑器打开文件并进行以下更改:

    1. 在文件顶部添加行

      set isofile=/isoboot/systemrescuecd-6.0.3.iso
      loopback loop $isofile
      
      probe -u $root --set=rootuuid
      set imgdevpath="/dev/disk/by-uuid/$rootuuid"
      
    2. 在菜单条目中添加粗体文本

      
      menuentry "Boot SystemRescueCd using default options" {
          set gfxpayload=keep
          linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd archisolabel=SYSRCD603 img_loop=$isofile img_dev=$imgdevpath
          initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img
      }

      menuentry "Boot SystemRescueCd and copy system to RAM" { set gfxpayload=keep linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd archisolabel=SYSRCD603 copytoram img_loop=$isofile img_dev=$imgdevpath initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img }


    配置 ISO grub.cfg 文件,引导修复

    使用您喜欢的文本编辑器打开文件并进行以下更改:

    1. 在文件顶部添加行

      set isofile=/isoboot/boot-repair/boot-repair-disk-64bit.iso
      loopback loop $isofile
      
    2. 在菜单条目中添加粗体文本

      
      menuentry "Boot-Repair-Disk session" {
          set gfxpayload=keep
          linux   (loop)/casper/vmlinuz.efi file=/cdrom/preseed/lubuntu.seed boot=casper quiet splash iso-scan/filename=$isofile --
          initrd  (loop)/casper/initrd.lz
      }
      


    配置 ISO grub.cfg 文件,具有持久性的 Ubuntu

    这里我们将使用 ubuntu-16.04.6-desktop-i386.iso

    警告:持久性工作的文件系统类型必须是 FAT

    如何创建一个 casper-rw 文件

    将casper-rw文件与 ISO 一起复制

    使用您喜欢的文本编辑器打开文件grub.cfg并进行以下更改:

    1. 在文件顶部添加行

      set iso_path=/isoboot/ubuntu/ubuntu-16.04.6-desktop-i386.iso
      loopback loop $iso_path
      
    2. 在菜单条目中添加粗体文本

      
      menuentry "Try Ubuntu without installing" {
          linux   (loop)/casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=${iso_path} quiet splash persistent persistent-path=/isoboot/ubuntu ---
          initrd  (loop)/casper/initrd
      }
      menuentry "Install Ubuntu" {
          linux   (loop)/casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity iso-scan/filename=${iso_path} quiet splash ---
          initrd  (loop)/casper/initrd
      }
      menuentry "Check disc for defects" {
          linux   (loop)/casper/vmlinuz  boot=casper integrity-check iso-scan/filename=${iso_path} quiet splash ---
          initrd  (loop)/casper/initrd
      }
      menuentry "Test memory" {
          linux16 (loop)/install/mt86plus
      }
      


    从grub>终端访问系统

    grub> configfile (hd0,6)/isoboot/<your system folder>/grub.cfg
    
    • 3

相关问题

  • 如何在 Ubuntu 启动时显示或隐藏启动消息?

  • 您对台式机和家庭服务器的驱动器分区方案有什么建议?[关闭]

  • 安装时,我可以选择加密我的主文件夹——这是做什么的?

  • 在不使用标准升级系统的情况下升级有哪些替代方案?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve