在 Ubuntu 或其它 GNU/Linux 系统下安装 Debian

家有老电脑不用就折腾不止,前段时间曾折腾一台老电脑,2007年上市,只支持 i386 系统,不支持U盘启动,在 winxp 系统下装了 Ubuntu,现在突发奇想,要在 Ubuntu 上安装 Debian。

在 Ubuntu 或其它 GNU/Linux 系统下安装 Debian

下载必须文件

引导系统的文件

  • vmlinuz
  • initrd.gz
  • boot.img.gz

安装 iso 映像,我这里选择的是网络安装版

  • debian-10.3.0-i386-netinst.iso

网络文件路径

上面下载的四个文件,存放的方式有下面几种

  • 在原系统上新建一个文件夹,如 /boot/debian ,四个文件都放在这下面,但如果 iso 文件也放在原硬盘,可能会导致安装文件系统失败,为了保险起见,我选择下面这种存放方法
  • 三个引导系统的文件放在原系统硬盘上,iso 放在U 盘上,虽然旧主板bios识别不了U盘,grub 2 下也识别不出,但启动新的引导安装时会识别出来
  • 四个文件都放在U盘上,这个前提是能识别U盘

从U盘加载ISO

从U盘加载ISO

若有兴趣可以尝试在grub加载usb模块,看看能不能识别出U盘

1
grub > insmod usb

修改 grub

它们放在Ubuntu 的 /boot 目录下,打开原来的Ubuntu 系统的grub 配置文件 /boot/grub/grub.cfg,其中可以看到下面格式的内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-96f946a0-0615-41ad-a3d7-e555b1096a61' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  96f946a0-0615-41ad-a3d7-e555b1096a61
        else
          search --no-floppy --fs-uuid --set=root 96f946a0-0615-41ad-a3d7-e555b1096a61
        fi
        linux   /boot/vmlinuz-4.15.0-91-generic root=UUID=96f946a0-0615-41ad-a3d7-e555b1096a61 ro  splash quiet $vt_handoff
        initrd  /boot/initrd.img-4.15.0-91-generic
}

照葫芦画瓢,复制上面一段粘贴在下面,做点小修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
menuentry 'New Install' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  96f946a0-0615-41ad-a3d7-e555b1096a61
        else
          search --no-floppy --fs-uuid --set=root 96f946a0-0615-41ad-a3d7-e555b1096a61
        fi
        linux   /boot/debian/vmlinuz root=UUID=96f946a0-0615-41ad-a3d7-e555b1096a61 ro  splash quiet $vt_handoff
        initrd  /boot/debian/initrd.img
}

修改的内容是去掉菜单样式和 linux、initrd 路径,这样修改后,grub启动菜单就是类似下面的样子(这里是后来在debian下测试)

grub启动菜单

选择 New Install 就可以进入安装模式,根据提示填写或敲回车就行。最后需要选择在硬盘上安装grub引导。

总结

通过这种方式,可以在任何有 grub 引导系统下安装新系统,所需要做的是准备系统引导文件+系统安装ISO文件,通过修改grub的引导路径来启动安装程序。

本文网址: https://pylist.com/topic/212.html 转摘请注明来源

Suggested Topics

Ubuntu/Debian 查看CPU温度的方法

刚 DIY 一个小主机,因为使用功率很低的CPU,买了一个金钱豹2U散热器,风扇声音很大,就把风扇拆下来,只使用下面的铜块。就得对CPU问寒问暖,时刻了解它的温度。...

ubuntu/debian 下自行编译 OpenWRT 固件

首先声明,自行编译是一个自我折腾的过程,没时间或精力就不要试了,这里介绍个人尝试在ubuntu/debian 下编译OpenWRT固件和应用SDK 的过程。...

Mac 极速安装Lua 简洁环境

Lua 的环境有两种: Lua 和 LuaJIT,为了速度,选择 LuaJIT,实行效率提升几十倍。LuaJIT 对应的是 Lua5.1 的语法。...

go get 使用socks5 代理安装依赖库

go 生态库还不够成熟,但会越来越完善,官方已经推出 `proxy.golang.org` ,国内的Gopher 们搭建了 `goproxy.cn`,尽管如此,我们在使用 `go get ...` 安装库时还是经常出现问题。...

现在最适合Linux的笔记本电脑是什么?

因为苹果公司最近停止支持在2012年15英寸retina MacBook Pro上运行的OS X的最后一个版本。如果你错过了,这个设计是受史蒂夫·乔布斯影响的最后一款,绝对是史诗级的,近十年来都无法触及,直到M1 MacBook问世才真正被超越。...

Mac 安装tensorflow

python 环境。在Mac 系统上实行 `pip install tensorflow` 可能会出现下面的错误提示...

Leave a Comment