In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the Grub initiator to start the ISO image in the Linux system". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use the Grub initiator to start the ISO image in the Linux system".
If you want to use multiple Linux distributions, you don't have that many options. You can either install it into your physical or virtual machine, or boot from an ISO file in live mode. The second option requires less hard disk space, but it's a bit of a hassle, because you need to write the ISO file to a USB drive or CD/DVD to boot. However, there is another alternative: put the ISO image on your hard drive and start it in live mode. This solution is more space-efficient and fully functional than a full installation, which is a good alternative to slow virtual machines. Next I'll show you how to use the popular Grub boot loader to implement this scenario.
Obviously, you will need to use Grub, which is used by almost all modern Linux distributions. You also need the Linux version of the ISO file you want to use and download it to your local disk. Finally, you need to know where the boot partition is and how to describe it in Grub. For this, use the following command:
The code is as follows:
# fdisk-l
The one with'*'is the boot partition. For me, it is / dev/sda1, which is described as (hd0,1) in the language Grubb.
For reference, sda2 is hd0,2, sdb1 is hd1,1, and so on. You understand. )
What do we need to edit?
First, open / etc/default/grub and check the following line:
The code is as follows:
# GRUB_HIDDEN_TIMEOUT=0
You need to add'#'to comment before this line.
Save and open / etc/grub.d/40_custom.
In this file, you will add parameters to boot to ISO. The structure is as follows:
The code is as follows:
Menuentry "[Entry's title in the grub screen]" {
Set isofile= "[path to ISO file]"
Loopback loop [boot partition in Grub language] $isofile
[some specific] arguments
}
For example, if you want to launch Ubuntu from an ISO file, you want to add the following line to the 40_custom file:
The code is as follows:
Menuentry "Ubuntu 14.04 (LTS) Live Desktop amd64" {
Set isofile= "/ boot/ubuntu-14.04-desktop-amd64.iso"
Loopback loop (hd0,1) $isofile
Linux (loop) / casper/vmlinuz.efi boot=casper iso-scan/filename=$ {isofile} quiet splash
Initrd (loop) / casper/initrd.lz
}
If you want to start Gparted:
The code is as follows:
Menuentry "GParted Live amd64" {
Set isofile= "/ boot/gparted-live-0.18.0-2-amd64.iso"
Loopback loop (hd0,1) $isofile
Loopback loop $isofile
Linux (loop) / live/vmlinuz boot=live config union=aufs noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$ {isofile}
Initrd (loop) / live/initrd.img
}
Or even Fedora:
The code is as follows:
Menuentry "Fedora 20 Live Desktop x861664" {
Set isofile= "/ boot/Fedora-Live-Desktop-x86_64-20-1.iso"
Loopback loop (hd0,1) $isofile
Loopback loop $isofile
Linux (loop) / isolinux/vmlinuz0 root=live:CDLABEL=Fedora-Live-Desktop-x86_64-20-1 rootfstype=auto ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0 iso-scan/filename=$ {isofile}
Initrd (loop) / isolinux/initrd0.img
}
Note that the parameters can be modified according to the release. Fortunately, there are many places you can look up. I like this release, but there are many other distributions you can start. In the meantime, please pay attention to where you put the ISO file. If your home directory is encrypted or inaccessible, you may prefer to put these files on the boot partition like the example. However, first make sure that there is enough space in the boot partition.
Finally, don't forget to save the 40_custom file and update grub with the following command:
The code is as follows:
# sudo update-grub
So that you can see the changes at the next startup.
What's next?
Want more? All right, let's change the parameters and play. You can start an ISO file and keep it doing something. For example, if you are totally delusional and want an option to quickly erase your hard drive, you can use DBAN to make some settings. Now, be really careful, because this setting will erase your hard drive, and there is no recovery option at startup:
The code is as follows:
Menuentry "Darik's Boot and Nuke" {
Set isofile= "/ boot/dban.iso"
Loopback loop (hd0,1) $isofile
Linux (loop) / dban.bzi nuke= "dwipe" silent
}
Another option.
The code is as follows:
Menuentry "Darik's Boot and Nuke" {
Set isofile= "/ boot/dban.iso"
Loopback loop (hd0,1) $isofile
Linux (loop) / dban.bzi
}
The DBAN option can be displayed, giving you the option to erase the drive. Be careful, because it is still very dangerous.
In summary, there are many things to do with ISO files and Grub: from fast live sessions to one-click destruction. After that, you can also try launching some privacy distributions, such as Tails.
Thank you for reading, the above is the content of "how to use Grub initiator to start ISO image in Linux system". After the study of this article, I believe you have a deeper understanding of how to use Grub initiator to start ISO image in Linux system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.