Home >Backend Development >PHP Tutorial >Making multi-version Fedora system installation USB flash drive_PHP tutorial

Making multi-version Fedora system installation USB flash drive_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:01:481105browse

Make multi-version Fedora system installation USB flash drive


Few people use CDs to install systems now. Almost all BIOS support USB start up. Therefore, it should be normal to use a USB flash drive (or mobile hard disk/SD card and other removable memory) for system installation. There are actually very few occasions where you need to use an installation disk (the system crashes, requiring a LiveCD; completely reinstalling the system, etc. My Fedora has been installed for 3 years, and I did not need to use an installation disk to install the system until I changed my computer). I didn't pay much attention to it before. I pulled it down as soon as it was ready and ready to use, and I didn't record the process or problems. This time I have an extra 16G USB flash drive. During the New Year holiday, I want to make an installation USB flash drive that can install multiple versions of Fedora and use the remaining space to store other data.

Reference: How to create and use Live USB


Use the dd command

The crudest way is dd, no installation required For any software, the system comes with commands and can be done with one line.


<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>sudo dd if=<安装盘.iso 的路径> of=</dev/sdX></li></ol>

You can also add bs=?MB and other parameters at the end to improve efficiency. After this command, don’t forget “sync” :-)

But its shortcomings are very obvious:

  • Waste of space: the entire USB disk is occupied, only Install a system
  • Read-only: Since iso is a CD-ROM file system (ISO 9660 CD-ROM filesystem), after dd it into the U disk, the system considers the U disk to be read-only.
  • Software error: If you open Gparted when inserting the USB flash drive, it will complain that the block size is incorrect.
  • Hide progress: As soon as the command starts, you are ready to wait for a few minutes. There will be no output before the end (can be solved by killall/kill, see the reference below)
SideNote: The dd command can check the progress through signals. Please refer to check the status of 'dd' in progress

Use GUI software

The following two software are not very reliable and are impatient. Please skip :-)

liveusb-creator

Install software from Fedora repository

<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>sudo yum install liveusb-creator</li></ol>

Using experience

Using the liveusb-creator GUI software seems to be easier.
But I have not succeeded. The problem is that this software has not been tested well. After completion, the MBR (maybe) has not been modified, resulting in the inability to realize the function of LiveCD (the system cannot be booted from the USB disk)
Advantages:

  • GUI is simple and easy to use
  • Can automatically download the required Fedora image
  • Progress display
  • Occupies only one partition, no waste of space

Disadvantages:

  • The burned boot disk cannot boot the system (at least I have not succeeded)
  • Only LiveCD can be burned. (A software that can only burn LiveCD, and the USB disk it makes cannot realize the function of LiveCD, you are kidding me :-p)
  • Even Fedora’s official Wiki does not recommend using it, it is better to use dd Spectrum

UNetbootin

Installation software

Go to UNetbootin’s homepage to download the corresponding version and install it (with RPM package)

Using experience

It seems to be the same as liveusb-creator, but it cannot be used under my F23:
a. After the installation is completed, start through the GUI icon, prompt: root permission is required, please Start via command line. (You can preview the interface)
b. Use the prompted command to start with sudo/su in the terminal. A bunch of errors are displayed and stuck:-(

Advantages:

  • Same as liveusb-creator
  • Support multiple distributions
  • Cross-platform (Win, Linux, Mac OS X)

Disadvantages:

  • (Failed to start successfully under F23, no comment), Fedora Wiki is not recommended, not as reliable as dd




Use the livecd-iso-to-disk command line tool

Here comes the key pointI finally found that livecd-tools is the best tool to use
Although it is a command. OK, but the operation is simple (even simpler than dd), the key is "it works"

Advantages:

  • Easy to use, almost as simple as dd
  • <.>It can process not only LiveCD, but also Server version installation DVD
  • Some progress is displayed
  • It only takes up a single partition, does not waste space, and is readable and writable.
  • Supports multiple LiveCD installations to the same partition
  • Disadvantages:

Requires a little manual processing: for the configuration file to start MENU
  • Install software



<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>sudo dnf install livecd-tools </li></ol>


How to use

Install the first LiveCD


<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>sudo livecd-iso-to-disk --reset-mbr --home-size-mb 1024 '/home/tekkamanninja/development/temp/Fedora-Live-Workstation-x86_64-23-10.iso' /dev/sdb1</li></ol>
wherein
  • –reset-mbr告诉 livecd-iso-to-disk 需要更新 U 盘(或存储器)的 MBR,这样系统才可以从 U 盘启动。作为被安装的首个 LiveCD 映像,这个是必须的。
  • –home-size-mb 1024(可选)告诉 livecd-iso-to-disk 创建一个1024MB 大小的 img 文件作为用户的home 分区,可以保留用户数据。注意:默认–encrypted-home ,建议在后面加上–unencrypted-home ,因为在实践过程中发现如果加密了home.img, 有可能导致 系统卡在启动阶段。原因是,在系统提示输入密码的时候,其他并行的启动信息输出阻碍了密码的输入,导致无法输入密码,系统无法挂载home.img, 卡死。这种情况出现在了F23 security lab LiveCD 中,在WorkStation LiveCD 中没有问题。
  • 如果你想自定义分区的标签,可以使用 –label ,例如,–label “Fedora-LiveCD”
  • *.iso 下载的 Fedora LiveCD 文件,不用多说了
  • /dev/sdb1 是安装的目标 U 盘分区,注意: 是分区,并非整个U 盘。 你可提前分好区,但记得目标分区必须标示为”boot”,否则工具会提示并退出。

命令执行完毕后,你的 U 盘就是可以启动并安装 Fedora 的启动盘了。

安装多个 LiveCD 到同一分区(可选)

在完成了第一个 LiveCD 的安装之后,我发现,其实 livecd-iso-to-disk 是支持多映像安装的。
第二个及之后 LiveCD 的安装 是的命令大致如下

<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>sudo livecd-iso-to-disk --multi  --livedir "security" --home-size-mb 1024 --unencrypted-home '/home/tekkamanninja/Downloads/Fedora-Live-Security-x86_64-23-10.iso'  /dev/sdb1</li><li>sudo livecd-iso-to-disk --multi  --livedir "server" '/home/tekkamanninja/Downloads/Fedora-Server-DVD-x86_64-23.iso' /dev/sdb1</li></ol>
与首个系统的主要区别在于: 添加了–multi –livedir
这个选项是告诉 工具:此次的 LiveCD 映像 安装于 /dev/sdb1 根目录下的 目录,这样就不会与原先安装的 LiveCD 冲突了。
只要你的 U 盘够大,要安装几个 LiveCD 映像 都可以。但是注意,在执行完此命令之后, 必须手动修改启动配置文件,否则你无法在启动时看到后面安装的 LiveCD 启动选项。


以本文为例,先安装了 F23 Workstation LiveCD, 之后安装了security Live CD,所有需要将 /security/syslinux/syslinux.cfg 中的


<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>menu separator</li><li>label linux0</li><li>menu label ^Start Fedora Live</li><li>kernel /security/syslinux/vmlinuz0 </li><li>append initrd=/security/syslinux/initrd0.img root=live:UUID=8fcd33eb-3dc2-4c04-8347-1b8099aa0d1c rootfstype=ext4 ro rd.live.image live_dir=security quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0</li></ol>

拷贝到 /syslinux/extlinux.conf 中。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1088146.htmlTechArticle制作多版本 Fedora 系统安装 U 盘 现在应该很少人使用光盘来安装系统了,几乎所有 BIOS 都支持USB启动。所以用 U盘 (或者移动硬盘/SD卡等移...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn