In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to boot the Linux ISO image directly from the hard disk". In the daily operation, I believe that many people have doubts about how to start the Linux ISO image directly from the hard disk. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to start the Linux ISO image directly from the hard disk". Next, please follow the editor to study!
Linux's GRUB2 boot loader can boot the Linux ISO file directly from the hard disk and start the ISO of Live CD without burning to a CD to install Linux to a hard disk partition or from a USB drive.
We implemented this process on Ubuntu 14.04-Ubuntu and Ubuntu-based Linux versions support this well. It works similarly on other Linux distributions.
Get the Linux ISO file
This secret technique requires a Linux system installed on your hard drive, and your computer must use the GRUB2 boot loader, which is the standard boot loader for most Linux systems. Sorry, you can't use the Windows boot loader to start a Linux ISO file directly.
Download the ISO file you want to use and put it in your Linux partition. GRUB2 should support most Linux systems. If you want to use them in a live environment and don't want to install them on your hard drive, make sure you download the "live CD" version of each Linux ISO. Many Linux-based bootable tool pads should also work.
Check the contents of ISO file
You may need to look inside the ISO files to know where those specific files are. For example, you can open ISO files by using graphical applications such as Ubuntu and other archive managers / file managers in GNOME-based desktop environments. In the Nautilus File Manager, right-click the ISO file and select Open using Archive Manager.
Locate the kernel file and initrd image. If you are using Ubuntu ISO files, you will find them in the casper folder-the vmlinuz file is the Linux kernel and the initrd file is the initrd image. Later, you need to know where they are in the ISO file.
Check the hard disk partition path
GRUB uses a different device naming method than Linux. In Linux systems, / dev/sda0 is the first partition on the hard disk-a refers to the first hard disk, and 0 refers to the first partition. In GRUB, the corresponding to / dev/sda0 is (hd0,1). 0 refers to the first hard disk, and 1 refers to the first partition on it. In other words, in GRUB device names, disk numbers start at 0 and partition numbers start at 1-- yeah, it's suddenly confusing. For example, (hd3,6) is the sixth partition on the fourth disk.
You can use the fdisk-l command to view this information. On Ubuntu, open the terminal and run the following command:
Sudo fdisk-l
You will see a list of Linux device paths, and you can convert them to GRUB device names yourself. For example, in the picture below, we can see that there is a system partition called / dev/sda1--, so for GRUB, it is (hd0,1).
Create a GRUB2 startup entry
The easiest way to add a custom startup entry is to edit the / etc/grub.d/40_custom script, which is designed for users to add their own startup entries. After editing the file, the contents of the / etc/defaults/grub file and / etc/grub.d/ script will be composited to create the / boot/grub/grub.cfg file-- you should not edit this file manually. It is designed to be generated automatically through the settings you specify in another file.
You need to open the / etc/grub.d/40_custom file with root privileges to edit it. On Ubuntu, you can do this by opening a terminal window and running the following command:
Sudo gedit / etc/grub.d/40_custom
Take it easy, you can open the file with your favorite text editor. For example, you can replace "gedit" with "nano" in the command and open it in a Nano text editor.
Unless you have added other custom startup entries, what you should see is an almost empty file. You need to add one or more ISO startup sections under the comment line.
Here's how to launch a Ubuntu or Ubuntu-based distribution from an ISO file, which we tested under Ubuntu 14.04:
Menuentry "Ubuntu 14.04 ISO" {set isofile= "/ home/name/Downloads/ubuntu-14.04.1-desktop-amd64.iso" loopback loop (hd0,1) $isofilelinux (loop) / casper/vmlinuz.efi boot=casper iso-scan/filename=$ {isofile} quiet splashinitrd (loop) / casper/initrd.lz}
Customize the startup entry to include the entry name of the menu you want, and specify the correct path to the ISO file on your computer, as well as the hard drive and partition device name that contains the ISO file. If the names or paths of the vmlinuz and initrd files are different, specify the correct paths for the files.
(if your / home/ directory is a partition, ignore the / home section, like this: set isofile= "/ name/Downloads/$ {isoname}").
Important: different Linux versions require different startup entries with different startup options, and the GRUB Live ISO multi-startup project provides different types of menu items for different Linux distributions. You should adjust these sample menu entries for the ISO file you want to launch. You can also simply search the web for the name and release number of the Linux distribution you want to launch, with the keyword "launch from ISO in GRUB" for more information.
If you want to add more ISO startup options, please add additional sections to the file.
Save the file when you are finished, return to the terminal window and run the following command:
Sudo update-grub
When you start the computer again, you will see the ISO startup entry, which you can select to start the ISO file. At startup, you may need to press Shift to display the GRUB menu.
At this point, the study on "how to start the Linux ISO image directly from the hard disk" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.