Linux U盘 启动盘

简介: /****************************************************************************** * Linux U盘 启动盘 * 说明: * 之前一直有个想法,那就是将x86的系统放在U盘中,像ARM那样做,但一直也不知 * 道大概要怎么查资料,最近搞redhat,查到了一些相关资料,记录一下。
/******************************************************************************
 *                          Linux U盘 启动盘
 * 说明:
 *     之前一直有个想法,那就是将x86的系统放在U盘中,像ARM那样做,但一直也不知
 * 道大概要怎么查资料,最近搞redhat,查到了一些相关资料,记录一下。
 *
 *                                         2017-3-6 深圳 南山平山村 曾剑锋
 *****************************************************************************/

一、参考文档:
    1. 制作一个linux的u盘最小系统
        http://zhuyi108.blog.51cto.com/2087327/845246
    2. 制作u盘启动linux系统
        http://www.voidcn.com/blog/mr_zhaojy/article/p-5974248.html
    3. U 盘启动LINUX
        http://blog.csdn.net/clozxy/article/details/5865632
    4. 定制自己的U盘Linux系统
        http://mowblog.com/%E5%AE%9A%E5%88%B6%E8%87%AA%E5%B7%B1%E7%9A%84u%E7%9B%98linux%E7%B3%BB%E7%BB%9F/
    5. CDlinux HOWTOs 文档
        http://cd-linux.sourceforge.net/archive/0.4/howto-cn.html
    6. GRUB (简体中文)
        https://wiki.archlinux.org/index.php/GRUB_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
    7. 什么是 initrd.img
        http://blog.csdn.net/chrisniu1984/article/details/3907874
    8. Linux2.6 内核的 Initrd 机制解析
        https://www.ibm.com/developerworks/cn/linux/l-k26initrd/
    9. Linux 初始 RAM 磁盘(initrd)概述
        https://www.ibm.com/developerworks/cn/linux/l-initrd.html
    10. Linux 引导过程内幕
        https://www.ibm.com/developerworks/cn/linux/l-linuxboot/
    11. LINUX下三个内核文件详解(vmlinuz/initrd.img/System.map)
        https://www.path8.net/tn/archives/5304

二、基本操作说明:
    1. U盘(SD卡)分两个区:
        1. /dev/sdb1;
        2. /dev/sdb2;
    2. mount /dev/sdb1 /mnt
    3. grub-install –root-directory=/mnt /dev/sdb
        Installing for i386-pc platform.
        Installation finished. No error reported.
    4. ls /boot/grub/
        fonts gfxblacklist.txt grub.cfg grubenv i386-pc locale unicode.pf2
    5. 编写/boot/grub/grub.cfg文件:
        set default=0
            insmod gzio
            insmod jpeg
            insmod part_msdos
            insmod ext2
            insmod ext3
            insmod ext4
        set timeout=10
        set root='hd0,1'
            # linux (hd0,1)/boot/vmlinuz rw # root=/dev/sdb2 rootfstype=ext3
            linux (hd0,1)/boot/vmlinuz rw root=/dev/sdb2 rootfstype=ext3
            initrd (hd0,1)/boot/initrd.img
            boot
    6. 拷贝对应的系统文件,最终/dev/sdb1分区目录如下:
        .
        └── boot
            ├── grub
            │   ├── fonts
            │   ├── grub.cfg
            │   ├── grubenv
            │   ├── i386-pc
            │   └── locale
            ├── initrd.img
            ├── initrd.img_redhat
            ├── initrd.img_ubuntu
            ├── vmlinuz
            ├── vmlinuz_redhat
            └── vmlinuz_ubuntu
    7. 下载Ubuntu Core,并将其解压到/dev/sdb2分区中,注意将passwd中间中root密码去掉,否则要输入密码。
    8. 如上所示,既有redhat,又有ubuntu的,遇到了redhat内核版本过低,Ubuntu Core版本高过不能挂载文件系统的问题。

三、遇到错误:
    1. 现象:
        ...
        mount: could not find filesystem /dev/root 
        Setting up other filesystems
        Setting up new root fs
        setuproot: moving /dev failed: No such file or directory
        ...
    2. 参考文档:
        1. [SOLVED] Getting existing CentOS5 system to run with a new motherboard
            https://www.centos.org/forums/viewtopic.php?t=24681
        2. Creating a New Initial RAM Disk
            https://wiki.centos.org/TipsAndTricks/CreateNewInitrd
    3. 原因:
        If you have changed a motherboard or moved a disk to a different system it may fail to boot due to the lack of appropriate drivers in the initial RAM disk image (initramfs for CentOS 6, initrd for CentOS 5).

 

目录
相关文章
|
机器人 Linux Shell
Linux系统下用Ventoy制作Windows启动盘
ubuntu18.04,ros对应的是melodic版本。转回Windows下使用Robot Studio时,由于系统user名为中文,必须要改动,误操作修改了注册表,又不小心删除了注册表一项内容,索性重装系统。还好之前装过很多系统,全程很简单,就是恢复win的环境有点累。
|
Ubuntu Linux Windows
无需任何启动盘,在windows系统上一键安装linux(ubuntu)双系统的方法!
            (转载请注明出处http://blog.csdn.net/buptgshengod)         随着学习工作的深入,安装学习linux系统显得尤为重要。但是有些人对于安装linux有些恐惧与陌生感,下面介绍一种傻瓜式安装linux作为第二系统的方法,而且无需分区。        使用的是wubi这款软件。点击进去会提示选择选择一个盘进行安装,选择除了c盘,
1610 0
|
Ubuntu Linux
Ubuntu15.10下制作Linux 操作系统优盘启动盘
上次电脑出现了一些问题,于是不得不重新装机了。下面就跟大家分享一下我在Ubuntu下制作优盘启动盘的一些心得。 准备原料 我这里用到的是 镜像文件是:debian-8.3.0-amd64-DVD-2.iso 优盘是: kingston 8.0G 操作系统是:Ubuntu 15.10 安装Unetbootin软件 在Ubuntu下安装一个软件是非常easy的事情,如下: sudo apt-get install unetbootin 格式化优盘 其实这一步可以省略的,毕竟等会制作启动盘的时候还会有相似的提示的。
935 0
|
12天前
|
Linux 数据安全/隐私保护 Windows
命令方式:window向linux传文件
【10月更文挑战第6天】本文介绍了如何在Linux系统中通过命令`ip a`获取IP地址,并在Windows系统下使用CMD命令行工具和SCP命令实现文件传输。示例展示了如何将D盘中的`mm.jar`文件上传至IP地址为192.168.163.122的Linux系统的/up/目录下,最后在Linux系统中确认文件传输结果。
167 65
|
3天前
|
安全 Linux
Linux系统之lsof命令的基本使用
【10月更文挑战第14天】Linux系统之lsof命令的基本使用
26 2
Linux系统之lsof命令的基本使用
|
11天前
|
Web App开发 网络协议 Linux
linux命令总结(centos):shell常用命令汇总,平时用不到,用到就懵逼忘了,于是专门写了这篇论文,【便持续更新】
这篇文章是关于Linux命令的总结,涵盖了从基础操作到网络配置等多个方面的命令及其使用方法。
39 1
linux命令总结(centos):shell常用命令汇总,平时用不到,用到就懵逼忘了,于是专门写了这篇论文,【便持续更新】
|
13天前
|
监控 安全 网络协议