Saturday, February 13, 2016

Boot ubuntu live cd and ubuntu net install cd from usb drive, flash

1- Install grub2 and grub-pc
$ sudo apt-get install grub2 grub-pc

2- install grub2 to usb drive
- mount usb drive /dev/sdc1 to /mnt
- create grub directory
- then install grub
$ sudo mount /dev/sdc1 /mnt
$ sudo mkdir /mnt/grub
$ sudo grub-install  --no-floppy --target=i386-pc --boot-directory=/mnt/grub /dev/sdc

3- Download ubuntu iso image to /mnt, both livecd and net install iso image (mini cd)
with name ubuntu-14.04-desktop-amd64.iso for live cd, precise.iso for mini cd 12.04 and trusty.iso for mini cd 14.04

4- create file grub.cfg in /mnt/grub/ with the following content.
menuentry "Ubuntu 14.04 ISO" {
         set isofile="/ubuntu-14.04-desktop-amd64.iso"
         loopback loop (hd0,1)$isofile
         linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
         initrd (loop)/casper/initrd.lz
 }

menuentry "precise" {
         set isofile="/precise.iso"
         loopback loop (hd0,1)$isofile
         linux (loop)/linux64
         initrd (loop)/initrd64.gz-
}
menuentry "trusty" {
         set isofile="/trusty.iso"
         loopback loop (hd0,1)$isofile
         linux (loop)/linux64
         initrd (loop)/initrd64.gz
}


5- now you can use the usb drive to boot. and it provide 3 options to choose: live cd or two other mini cd.


No comments:

Post a Comment