Yadda ake Gudun Duk wani Rarraba Linux Kai tsaye daga Hard Disk a Ubuntu Amfani da Grub Menu


Yawancin suna ƙirƙirar kebul na bootable.

Wannan koyawa za ta mayar da hankali kan gabatar da hanyar da za ku iya gudanar da wasu rarrabawar Linux ISO kai tsaye daga rumbun kwamfutarka ta hanyar gyara Ubuntu 20.04 GRUB2 (yana aiki akan Ubuntu 18.04 ko baya) menu wanda shine tsoho bootloader a cikin mafi yawan rabawa na Linux na zamani, wanda ke ba da hanya mafi sauri ta amfani da tsarin aiki na Linux, kuma yana da tasiri mai girma akan sirrin saboda duk saitunan ku da kuma zaman rayuwa ba a kiyaye su ta tsohuwa.

Rarraba da aka gabatar a cikin wannan batu sune CentOS, Fedora, Kali Linux da Gentoo Live DVD.

Ubuntu 20.04 (ko duk wani rarraba Linux tare da GRUB2 boot loader) wanda aka sanya akan rumbun kwamfutarka.

  • Ubuntu 20.04 Jagoran Shigar Desktop

Mataki 1: Zazzage Fayilolin ISO Live Linux

1. Don samun damar taya da gudanar da kowane rarraba Linux ba tare da sanya su a cikin rumbun kwamfutarka ba, tabbatar da zazzage sakin “Rayuwar CD/DVD” na kowane hoton ISO na Linux.

  • Zazzage Hoton ISO Live CentOS
  • Zazzage Hoton ISO Live Fedora
  • Zazzage Hoton ISO na Kali Linux Live
  • Zazzage Hoton ISO na Gentoo Linux Live

Mataki 2: Ƙara Hotunan ISO zuwa Menu na GRUB2

2. Bayan kun zazzage Hotunan DVD na Linux ISO Live da kuka fi so, buɗe Ubuntu Nautilus tare da tushen gata ta amfani da 'sudo nautilus' umarni daga Terminal kuma ƙirƙirar directory mai suna live a cikin ku. Hanyar tushen tsarin kuma matsar da fayil ɗin ISO zuwa wannan babban fayil.

$ sudo nautilus

3. Don ci gaba da ci gaba zai buƙaci samar da Grub2 tare da ɓangaren diski ɗin mu UUID - Mai ganewa na musamman(bangaren inda fayilolin ISO suke). Don samun bangare UUID gudanar da umarnin blkid mai zuwa.

$ sudo blkid

Don ɓangarorin da aka ɗora ta atomatik ko faifai masu wuya akan tsarin boot suna gudanar da bin umarnin cat.

$ sudo cat /etc/fstab   

4. Wata hanya don samun ɓangaren UUID ɗinku shine, buɗe visualize grub.cfg abun ciki na fayil wanda yake cikin hanyar /boot/grub/ kuma bincika --fs -uuid kirtani (idan ba ku da rabuwa na /boot).

5. Bayan kun sami tushen ɓangaren UUID ku matsa zuwa /etc/grub.d/ directory, buɗe fayil ɗin 40_custom don gyarawa kuma ƙara. bin layi a kasan wannan fayil ɗin.

menuentry 'CentOS 8 Live' --class os --class gnu-linux --class gnu --class os --group group_main {
                set isofile="/live/CentOS-8-x86_64-1905-dvd1.iso"

         insmod ext2
         insmod loopback
         insmod iso9660      
                loopback loop (hd0,msdos1)$isofile      
                search --no-floppy --fs-uuid --set=root 3b87d941-8ee7-4312-98fc-1f26828d62ab                            
                linux (loop)/isolinux/vmlinuz boot=live fromiso=/dev/sda1/$isofile noconfig=sudo username=root hostname=centos
                initrd (loop)/isolinux/initrd.img
}

Anan umarni masu zuwa suna wakiltar:

  1. saitin isofile u003d Mai canza yanayin tsarin tsarin ISO.
  2. (hd0,msdos1) u003d Kashi na farko daga rumbun kwamfyuta na farko (A cikin Linux disks ana ƙidaya su farawa da 0) – daidai da /dev/sda1.
  3. –fs-uuid –setu003dtushen 59036d99-a9bd-4cfb-80ab-93a8d3a92e77 u003d Bangare na farko daga lambar UUID hard disk na farko.
  4. linux da initrd u003d Siffofin taya na kernel na al'ada - sun bambanta dangane da kowane rarraba Linux.

6. Bayan kun gama gyara fayil ɗin, sabunta-grub don ƙara sabon ISO (a cikin wannan yanayin CentOS) zuwa menu na Grub2. Don tabbatar da shi buɗe /boot/grub/grub.cfg kuma bincika a ƙasa don shigarwar ISO.

$ sudo update-grub

7. Domin gudanar da CentOS Live ISO, sake kunna kwamfutarka, zaɓi CentOS shigarwa daga menu na GRUB sannan danna maɓallin Enter.

Hakazalika, zaku iya ƙara sauran hotunan rarraba Linux Live ISO zuwa menu na GRUB2 kamar yadda aka nuna. Sake buɗe kuma shirya /etc/grub.d/40_custom grub fayil kuma ƙara abubuwan shigarwa masu zuwa.

menuentry 'Fedora Live' --class os --class gnu-linux --class gnu --class os --group group_main {
                set isofile="/live/Fedora-Workstation-Live-x86_64-32-1.6.iso"

         insmod ext2
         insmod loopback
         insmod iso9660      
                loopback loop (hd0,msdos1)$isofile      
                search --no-floppy --fs-uuid --set=root 3b87d941-8ee7-4312-98fc-1f26828d62ab                            
                linux (loop)/isolinux/vmlinuz boot=live fromiso=/dev/sda1/$isofile noconfig=sudo username=root hostname=fedora
                initrd (loop)/isolinux/initrd.img
}
menuentry 'Kali Linux Live' --class os --class gnu-linux --class gnu --class os --group group_main {
                set isofile="/live/kali-linux-2020.2-live-i386.iso"

         insmod ext2
         insmod loopback
         insmod iso9660      
                loopback loop (hd0,msdos1)$isofile      
                search --no-floppy --fs-uuid --set=root 3b87d941-8ee7-4312-98fc-1f26828d62ab                            
                linux (loop)/live/vmlinuz boot=live fromiso=/dev/sda1/$isofile noconfig=sudo username=root hostname=kalilinux
                initrd (loop)/live/initrd.img
}
menuentry 'Gentoo Linux Live' --class os --class gnu-linux --class gnu --class os --group group_main {
                set isofile="/live/livedvd-amd64-multilib-20160704.iso"

         insmod ext2
         insmod loopback
         insmod iso9660      
                loopback loop (hd0,msdos1)$isofile      
                search --no-floppy --fs-uuid --set=root 3b87d941-8ee7-4312-98fc-1f26828d62ab                            
                linux (loop)/live/vmlinuz boot=live fromiso=/dev/sda1/$isofile noconfig=sudo username=root hostname=gentoo
                initrd (loop)/live/initrd.img
}

8. Sa'an nan kuma sabunta menu na GRUB ɗinku, sake kunna kwamfutar ku kuma zaɓi Linux rarraba ISO da kuka fi so daga menu na GRUB.

$ sudo update-grub

9. Idan ba ku da isasshen sarari kyauta akan sashin tushen ku, don ɗaukar nauyin sauran fayilolin ISO na Linux kuna iya ƙara wani babban diski sannan ku matsar da duk fayilolin ISO ɗin Linux ɗin ku zuwa wurin. Bayan ka ƙirƙiri partition kuma ƙara tsarin fayil saika shi akan hanyar /mnt don samun samuwa.

$ sudo mount /dev/sdb1 /mnt

10. Daga nan sai a matsar da dukkan ISO akan sabon Hard Disk sannan ka kwace UUID dinsa ta hanyar amfani da blkid order.

$ sudo blkid

11. Sake buɗe kuma gyara /etc/grub.d/40_custom fayil ɗin grub kuma ƙara wasu hotuna rarraba Linux Live ISO zuwa GRUB2 menu ta amfani da hanya iri ɗaya amma kula da kowane. rarraba sigogin booting Kernel Live wanda za'a iya dubawa ta hanyar hawa hoton ISO ta amfani da zaɓi mount -o loop ko tuntuɓar shafukan Wiki rarraba.