(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 02 Dec 2020, 12:03
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Use grub to make a BIOS/UEFI bootable USB flash
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 1258

PostPosted: Fri 06 Dec 2019, 15:49    Post subject:  Use grub to make a BIOS/UEFI bootable USB flash
Subject description: For booting most anything
 

Do this to your USB Flash using gparted and grub-install from a linux distro:

Add this to the grub.cfg in the root of sdX1:
Code:
set root=(hd0,msdos2)
configfile /boot/grub/grub.cfg

Add this to the /boot/grub/grub.cfg of sdX2:
Code:
set timeout=5
set default=0

# Boot a puppy example
menuentry 'BionicPup64 8.0' {
   linux   /BionicPup64/vmlinuz   psubdir=BionicPup64 pmedia=usbflash pfix=fsck
   initrd   /BionicPup64/initrd.gz
}

# Boot an ISO file example
menuentry "linuxmint-19.2-mate-64bit ISO" {
   set isofile="/ISOs/linuxmint-19.2-mate-64bit.iso"
   loopback loop $isofile
   linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile liveimg noprompt noeject quiet splash --
   initrd (loop)/casper/initrd.lz
}


A BIOS machine will boot directly to partition 2 (sdX2), and a UEFI machine will boot to partition 1 (sdX1) and get transfered to the grub.cfg on partition 2 (sdX2)

Those entries boot puppies and ISO's that are on the ext3 partition. This is really important with large ISO's as Grub4Dos requires them to be on a fat32 and occupy only 1 extent. Grub will boot regardless of how many extents.

So for multiple large ISO's, ext3 and grub works better.
Back to top
View user's profile Send private message 
3guesses

Joined: 30 Sep 2014
Posts: 172

PostPosted: Thu 06 Feb 2020, 21:06    Post subject:  

Hi jafadmin,

Thanks for this post - this is of GREAT interest to me! One question: what is bootx64.efi (on sdX1)? Is it a Grub2 EFI bootloader? And if so, where do you get it from??? I believe there is one in /efi/boot/ in the Bionic Puppy 8.0 iso - should we use that?

Thanks Very Happy

Also, would it not be better/safer to set root using the UUID of sdX2 rather than with (hd0,msdos2) in /grub.cfg on sdX1?

Also #2, is it better/necessary to use ext3 rather than ext4 for sdX2? I don't know enough (anything) about the difference between the two filesystems...

Also #3, I believe that under Windows XP it is only possible to view/access the first partition on a USB flash drive, so if you wanted to be able to access the main partition (containing the ISO files, the main grub.cfg, etc) from XP then it would be better to have the main partition as the 1st partition on the flash drive and the ESP as the 2nd partition. And if the ESP is only used for the Grub2 EFI bootloader it can be really minimal in size (much smaller than 250MB!).

Also #4, it might be nicer (more convenient) to have the main grub.cfg in the root directory of sdX2 (rather than in /boot/grub) - I think you can specify that via command-line argument to grub-install? Else, make /boot/grub/grub.cfg on sdX2 redirect to /grub.cfg (similar to the one on sdX1)? A nice bit of symmetry... Cool

Also #5, ... nah, I got nothing Wink Laughing

EDIT I got an also #5! Should the USB flash drive be formatted to GPT or MBR? Or does it not matter?

EDIT Also #6, you might want a bootia32.efi in /EFI/boot on sdX1 so that it can be used on 32-bit EFI systems?

EDIT Also #7, I got an "error: cannot find EFI directory" when I ran the grub-install command from antiX19, so I did the following:
- mkdir /mnt/USBESP
- mount /dev/sdX1 /mnt/USBESP
- added "--efi-directory=/mnt/USBESP" to the grub-install command
This then worked. However, it also overwrote the contents of the /EFI/boot directory on sdX1... So then I created a /boot/grub/grub.cfg (just in case that is where it would look for it) that simply redirected to /grub.cfg on the ESP.
Back to top
View user's profile Send private message 
3guesses

Joined: 30 Sep 2014
Posts: 172

PostPosted: Thu 06 Feb 2020, 23:46    Post subject: antiX-19_x64-full.iso  

OK, so I tried using this method to boot the antiX 19 ISO (antiX-19_x64-full.iso) from USB via EFI (on my Asus T100TA), but without success - each time Grub2 bombed out with "error no suitable video mode found", so I added the "insmod all_video" command to the entries, but then the kernel just bombed out very early on. These are the entries from grub.cfg:

Code:
menuentry "(1) antiX-19_x64-full.iso" {
insmod all_video
   set isofile="/ISO/antiX-19_x64-full.iso"
   loopback loop $isofile
   linux (loop)/antiX/vmlinuz boot=antiX iso-scan/filename=$isofile liveimg noprompt noeject quiet splash --
   initrd (loop)/antiX/initrd.gz
}

menuentry "(2) antiX-19_x64-full.iso" {
insmod all_video
   set isofile="/ISO/antiX-19_x64-full.iso"
   loopback loop $isofile
   linux (loop)/antiX/vmlinuz boot=antiX iso-scan/filename=$isofile liveimg noprompt noeject quiet splasht disable=lxF menus --
   initrd (loop)/antiX/initrd.gz
}

menuentry "(3) antiX-19_x64-full.iso" {
insmod all_video
   set isofile="/ISO/antiX-19_x64-full.iso"
   loopback loop $isofile
   linux (loop)/antiX/vmlinuz boot=antiX iso-scan/filename=$isofile quiet splasht disable=lxF menus --
   initrd (loop)/antiX/initrd.gz
}

menuentry "(4) antiX-19_x64-full.iso" {
   set isofile="/ISO/antiX-19_x64-full.iso"
   loopback loop $isofile
   set root=(loop)
   configfile /boot/grub/grub.cfg
}

menuentry "(5) antiX-19_x64-full.iso" {
   set isofile="/ISO/antiX-19_x64-full.iso"
   loopback loop $isofile
   set root=(loop)
   configfile (loop)/boot/grub/grub.cfg
}


Looking at the menu entry in jafadmin's original post, I guessed that it was trying to reproduce what was in the grub menu entry in the Linux Mint ISO, so it seemed sensible to me just to redirect to the grub.cfg in the antiX 19 ISO - this is what entries (4) and (5) above were attempting to do. They do achieve this, but then when you try to boot into antiX you get the same "no suitable video mode found" error.

For reference, here is the grub.cfg from the antiX 19 ISO:

Code:
#------------------------------------------------------------------
# file: /boot/grub/grub.cfg for the Live version of antiX
#
# This file can get updated automatically on a LiveUSB via the save
# feature in the text menus.  It is possible to break these updates
# by editing this file.
#------------------------------------------------------------------


# search --no-floppy --set=root --fs-uuid %UUID%
set timeout=60
set gfxmode=1024x768
#set gfxpayload="3200x1800;2560x1440;2160x1440;1920x1080;1600x1200;1600x1050;1600x900;1440x900;1366x768;1280x1024;1280x800;1280x720;1024x768;auto"
set gfxpayload="2048x2048;2048x1280;2048x1080;1920x1080;1600x900;1600x1200;1600x1050;1500x1000;1440x960;1440x900;1368x912;1366x768;1280x800;1280x720;1280x1024;1200x800;1024x768;auto"
set default=1


# load defaults
#
if [ -s $prefix/config/defaults.cfg ]; then
source $prefix/config/defaults.cfg
fi


menuentry " antiX-19 x64-full (16 October 2019)" {
linux /antiX/vmlinuz quiet splasht disable=lxF
initrd /antiX/initrd.gz
}

#--custom  menuentry " Custom" {
#--custom  linux /antiX/vmlinuz quiet
#--custom  initrd /antiX/initrd.gz
#--custom  }

menuentry " antiX-19 x64-full Customize Boot (text menus)" {
linux /antiX/vmlinuz quiet splasht disable=lxF menus
initrd /antiX/initrd.gz
}

submenu ">>> Advanced Options for antiX-19 x64-full <<<" {

menu_color_normal=white/black
menu_color_highlight=yellow/light-gray

menuentry " antiX-19 x64-full Failsafe" {
linux /antiX/vmlinuz quiet splasht disable=lxF failsafe
initrd /antiX/initrd.gz
}

menuentry "antiX-19 x64-full Create Bootchart" {
linux /antiX/vmlinuz quiet splasht disable=lxF bootchart initcall_debug printk.time=y
initrd /antiX/initrd.gz
}

menuentry " antiX-19 x64-full (1024x768)" {
linux /antiX/vmlinuz quiet splasht disable=lxF
initrd /antiX/initrd.gz
}

menuentry " Power Off" --hotkey=P {
halt
}

menuentry " Reboot"  --hotkey=R {
reboot
}

if [ -f /boot/grub/theme/help.txt ]; then
menuentry " Help" --hotkey=H {
cat /boot/grub/theme/help.txt
echo -n "Press <Enter> to continue "
read xxx_help
}
fi
}


# load boot menus
#
if [  -f  $prefix/config/bootmenu.cfg ]; then
source $prefix/config/bootmenu.cfg
fi


I don't have much experience of Grub2, so I am grasping at straws a little here. Some help would be appreciated Razz
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Fri 07 Feb 2020, 23:08    Post subject:  

Just in case try to force a mode by appending "video=LVDS-1:800x600@60 "

if need more info see http://murga-linux.com/puppy/viewtopic.php?p=1048762#1048762
Back to top
View user's profile Send private message 
ivs


Joined: 13 Mar 2020
Posts: 10

PostPosted: Thu 19 Mar 2020, 11:25    Post subject:  

Hi Jafadmin,

I'm Running BionicPup64-8.0 On A USB. I Have A 500 GB Drive Windows 10 Installed.
I Want To Run Windows 10 From USB BionicPup64-8.0 Grub Menu.
Can I Do This ?
I Do Not Want To Install Grub On My Disk.
I Put All Sort Of Entries In The Menu, Like Following.
And I'm Not 100 % Sure Of What I'm Doing Too.
Keep Saying Invalid EFI File Path Etc.
Hope You Can Help Me With This.
Thanks.

menuentry "Start Windows 100 " --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6278DB1B78DAED33
chainloader +1
}
menuentry "Start Windows 10.a" {
insmod ntfs
insmod chain
root (hd0,0)
chainloader +1
}
menuentry "Start Windows 10.1" {
insmod ntfs
insmod chain
rootnoverify (hd0,0)
chainloader /bootmgr
}
menuentry "Start Windows 10.2" {
insmod ntfs
insmod chain
root (hd0,0)
chainloader /bootmgr
}

root# parted /dev/sda -l
Model: ATA WDC WD5000AADS-0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 32.3kB 1020MB 1020MB primary ntfs boot
2 1020MB 361GB 360GB primary ntfs
3 361GB 431GB 70.8GB primary ntfs
Model: SanDisk Ultra (scsi)
Disk /dev/sdb: 30.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 30.8GB 30.8GB primary fat32 boot, lba
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 6397
Location: King's Lynn, UK.

PostPosted: Thu 19 Mar 2020, 13:28    Post subject:  

3guesses wrote:
Hi jafadmin,

Thanks for this post - this is of GREAT interest to me! One question: what is bootx64.efi (on sdX1)? Is it a Grub2 EFI bootloader? And if so, where do you get it from??? I believe there is one in /efi/boot/ in the Bionic Puppy 8.0 iso - should we use that?


@ 3guesses:-

You may find the following to be of use. I had to undergo a rapid 'crash-course' in this stuff when I got my new HP tower back in January..... Rolling Eyes

https://drive.google.com/file/d/1rTL8nRuGmZcVLxpALOQhkAkQKQxkLefZ/view?usp=sharing

The enclosed grub.cfg file gives some examples that may prove useful.


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1457s ][ Queries: 11 (0.0958s) ][ GZIP on ]