In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to start a Fedora Live CD on the Internet. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Live CD is useful for many tasks, such as:
Install the operating system to a hard drive
Repair a boot loader or perform other rescue mode operations
Provide a suitable minimum environment for Web browsing
... And more.
As an alternative to using DVD and USB drives to store your Live CD images, you can upload them to an iSCSI server that is less likely to be lost or damaged. This guide shows you how to load your Live CD images to an ISCSI server and use the iPXE boot loader to access them.
Download a Live CD image $MY_RLSE=27 $MY_LIVE=$ (wget-Q-O-https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/$MY_RLSE/Workstation/x86_64/iso | perl-ne'/ (Fedora [^] *?-Live- [^] *?\ .iso) (? {print $^ N}) / ') $MY_NAME=fc$MY_RLSE $wget-O $MY_NAME.iso https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/$MY_RLSE/Workstation/x86_64/iso/$MY_LIVE
The above command downloads the Fedora-Workstation-Live-x86_64-27-1.6.iso Fedora Live image and saves it as fc27.iso. Change the value of MY_RLSE to download other file versions. Alternatively, you can browse https://getfedora.org/ to download the latest Fedora live image. Versions prior to 21 use different naming conventions and must be downloaded manually here. If you download a Live CD image manually, set the MY_NAME variable to the base name of the file without the extension. With this method, the commands in the following section will reference the correct file.
Convert Live CD image
Use the livecd-iso-to-disk tool to convert the ISO file to a disk image and add the netroot parameter to the embedded kernel command line:
$sudo dnf install-y livecd-tools$ MY_SIZE=$ (du-ms $MY_NAME.iso | cut-f 1) $dd if=/dev/zero of=$MY_NAME.img bs=1MiB count=0 seek=$ (($MY_SIZE+512)) $MY_SRVR=server-01.example.edu $MY_RVRS=$ (echo $MY_SRVR | tr'. "\ n" | tac | tr "\ n". | cut-b-${# MY_SRVR}) $MY_LOOP=$ (sudo losetup-- show-- nooverlap-- find $MY _ NAME.img) $sudo livecd-iso-to-disk-- format-- extra-kernel-args netroot=iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAME $MY_NAME.iso $MY_LOOP $sudo losetup-d $MY_LOOP upload Live images to your server
Create a directory on your ISCSI server to store your live image, and then upload your modified image to it.
For 21 and later releases:
$MY_FLDR=/images $scp $MY_NAME.img $MY_SRVR:$MY_FLDR/
For releases prior to 21:
$MY_FLDR=/images $MY_LOOP=$ (sudo losetup-- show-- nooverlap-- find-- partscan $MY_NAME.img) $sudo tune2fs-O ^ has_journal ${MY_LOOP} p1 $sudo e2fsck ${MY_LOOP} p1 $sudo dd status=none if=$ {MY_LOOP} p1 | ssh $MY_SRVR "dd of=$MY_FLDR/$MY_NAME.img" $sudo losetup-d $MY_LOOP defines iSCSI destination
Run the following command on your iSCSI server:
$sudo-I # MY_NAME=fc27 # MY_FLDR=/images # MY_SRVR= `hostname` # MY_RVRS=$ (echo $MY_SRVR | tr'.'"\ n" | tac | tr "\ n".'| cut-b-${# MY_SRVR}) # cat / etc/tgt/conf.d/$MY_NAME.conf backing-store $MY_FLDR/$MY_NAME.img readonly 1 allow-in-use yes END # tgt-admin-update ALL creates a bootable USB drive
The iPXE boot loader has a sanboot command that you can use to connect and start the live image hosted on your ISCSI server. It can be compiled in many different formats. The best working format depends on the hardware you are running. For example, the following instructions show you how to chain load iPXE from syslinux on a USB drive.
First, download iPXE and build it in its lkrn format. This should be done as an ordinary user on a workstation:
$sudo dnf install-y git $git clone http://git.ipxe.org/ipxe.git $HOME/ipxe $sudo dnf groupinstall-y "C Development Tools and Libraries" $cd $HOME/ipxe/src $make clean $make bin/ipxe.lkrn $cp bin/ipxe.lkrn / tmp
Next, prepare a USB drive with a MSDOS partition table and a FAT32 file system. The following command assumes that you have connected the USB drive that will be formatted. Note: you want a properly formatted drive!
$sudo-I # dnf install-y parted util-linux dosfstools # echo; find / dev/disk/by-id!-regex'. *-part.*'-name 'usb-*'-exec readlink-f {}\; | xargs-I bash-c "parted-s {} unit MiB print | perl-0-ne' / ^ Model: ([^ (] *). *\ n.cow? ([0-9] * MiB) / I & & print\" Found: {} =\ $2\ $1\ n\ "'" Echo; read-e-I "$(find / dev/disk/by-id!-regex'. *-part.*'-name 'usb-*'-exec readlink-f {}\;-quit)"-p "Drive to format:" MY_USB# umount $MY_USB? # wipefs-a $MY_USB# parted-s $MY_USB mklabel msdos mkpart primary fat32 1MiB 100% set 1 boot on # mkfs-t vfat-F 32 ${MY_USB} 1
Finally, install and configure syslinux on the USB drive to chain load iPXE:
# dnf install-y syslinux-nonlinux # syslinux- I ${MY_USB} 1 # dd if=/usr/share/syslinux/mbr.bin of=$ {MY_USB} # MY_MNT=$ (mktemp-d) # mount ${MY_USB} 1 $MY_MNT # MY_NAME=fc27 # MY_SRVR=server-01.example.edu # MY_RVRS=$ (echo $MY_SRVR | tr'.'"\ n" | tac | tr "\ n". | cut-b-${# MY_SRVR}) # cat $MY_MNT/syslinux.cfgui menu.c32default $MY_NAMEtimeout 100menu title SYSLINUXlabel $MY_NAME menu label ${MY_ name ^ ^} kernel ipxe.lkrn append dhcp & & sanboot iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAMEEND # cp / usr/share/syslinux/menu.c32 $MY_MNT # cp / usr/share/syslinux/libutil.c32 $MY_MNT # cp / tmp/ipxe.lkrn $MY_MNT # umount ${MY_USB} 1
By simply editing the syslinux.cfg file and adding additional menu items, you should be able to use the same USB drive to launch additional ISCSI targets on the network.
This is just one way to load IPXE. You can install syslinux directly on your workstation. Another option is to compile iPXE into an EFI executable and place it directly in your ESP. Another option is to compile iPXE as a PXE loader and place it on your TFTP server that can be referenced by DHCP. The best option depends on the environment
Finally, explain
If you compile IPXE in IPXE's EFI format, you may want to add the-filename\ EFI\ BOOT\ grubx64.efi parameter to the sanboot command.
You can create a custom live image. For more information, refer to creating and using live CD.
You can add the-overlay-size-mb and-home-size-mb parameters to the livecd-iso-to-disk command to create a permanently stored live image. However, if you have multiple concurrent users, you will need to set up your ISCSI server to manage writable coverage for each user independently. This is similar to the article "how to build a network startup server, part 4".
Live images support a persistenthome option (for example, persistenthome=LABEL=HOME) on their kernel command line. Used with CHAP-authenticated iSCSI targets, the persistenthome option provides an interesting alternative to NFS for centrally controlled home directories.
Thank you for reading! This is the end of the article on "how to start a Fedora Live CD on the Internet". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.