Jump to content











Photo
- - - - -

Boot Ubuntu or Linux-Lite from ISO using grub4dos

grug4dos linux-lite

  • Please log in to reply
5 replies to this topic

#1 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2017 - 05:24 PM

As you may know, in order to boot Linux-Lite from USB in it's page they recommend to use win32diskimager to extract the ISO to the USB, but doing this your USB device is not readable from Windows any more so you can't use it in Windows PC's until you clean and reformat it.

 

I haven't found any info for booting it from ISO, but I found info for booting Ubuntu from ISO:

 

 

title Run Ubuntu 16.04
find --set-root /ubuntu-16.04-desktop-amd64.iso
map --heads=0 --sectors-per-track=0 /ubuntu-16.04-desktop-amd64.iso (0xff) || map --mem /ubuntu-16.04-desktop-amd64.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/ubuntu-16.04-desktop-amd64.iso splash
initrd /casper/initrd.lz

 

Then as Linux-Lite is an Ubuntu derivative, I decided to use this approach making some adjustments for my needs.

 

This is my memu.lst entry to boot Linux-Lite from ISO on a partition root of my HDD:

 

title Linux Lite x64\nBoot Linux Lite x64 from HDD
##ISO file must be contiguous on disk in this case, use Wincontig
find --set-root /linux-lite-3.6-64bit.iso
map --heads=0 --sectors-per-track=0 /linux-lite-3.6-64bit.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz  file=/cdrom/preseed/custom.seed boot=casper iso-scan/filename=/linux-lite-3.6-64bit.iso splash
initrd /casper/initrd.gz

title Linux Lite x64\nBoot Linux Lite x64 on RAM
find --set-root /linux-lite-3.6-64bit.iso
map --mem /linux-lite-3.6-64bit.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz  file=/cdrom/preseed/custom.seed boot=casper iso-scan/filename=/linux-lite-3.6-64bit.iso splash
initrd /casper/initrd.gz
 

And I use this one when Linux-Lite is on the root of a USB stick:

 

iftitle [if exist /linux-lite-3.6-64bit.iso] Boot linux-lite-3.6-64bit\nBoot linux-lite-3.6-64bit from USB

##ISO file must be contiguous on disk in this case, use Wincontig

map --heads=0 --sectors-per-track=0 /linux-lite-3.6-64bit.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz  file=/cdrom/preseed/custom.seed boot=casper iso-scan/filename=/linux-lite-3.6-64bit.iso splash
initrd /casper/initrd.gz

iftitle [if exist /linux-lite-3.6-64bit.iso] Boot linux-lite-3.6-64bit\nBoot linux-lite-3.6-64bit on RAM
map --mem (hd0,0)/linux-lite-3.6-64bit.iso (0xFF)
map --hook
root (0xff)
kernel /casper/vmlinuz  file=/cdrom/preseed/custom.seed boot=casper iso-scan/filename=/linux-lite-3.6-64bit.iso splash
initrd /casper/initrd.gz

 

You need to know that you can't see partition containing the ISO from Linux-Lite when your PC boots.

 

I am using ATM grub4dos 0.4.6a (rev 2016-09-20).

 

Best Regards

 

alacran

 

Edit: Following Wonko comment in post # 5


Edited by alacran, 16 October 2017 - 10:38 AM.


#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 October 2017 - 07:21 PM

3.6 seems to work OK on E2B just as plain .iso file, no menu needed.

You can also add persistence too using a .mnu file...

# Make an ext3 file using RMPrepUSB in the root of the drive (i.e. File Name=linuxlite-rw  Volume Name=casper-rw)
# Size MUST be 300MB or larger (smaller ones may give 'not enough space' errors)
# Place this .mnu file and the ISO in either \_ISO\MainMenu\MNU or \_ISO\Linux\MNU
# This menu will work even on an NTFS USB boot drive
# IMPORTANT: you MUST run WinContig (Ctrl+F2) before booting E2B.
# This mnu can be used for 64-bit or 32-bit linux-lite

iftitle [if exist $HOME$/linux-lite-3.6-32bit.iso] Linux-lite 3.6\n Boot using .mnu file with persistence
set ISO=$HOME$/linux-lite-3.6-32bit.iso
set PER=/linuxlite-rw
if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
#enable parttype output
debug 1
# make empty table entry in 3rd position in ptn table
parttype (%E2BDEV%,2) | set check=
debug off
set check=%check:~-5,4%
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0 0 0
if not "%check%"=="0x00" echo WARNING: PTN TABLE 3 IS ALREADY IN USE - PERSISTENCE MAY NOT WORK! && pause
debug 1
echo
if not exist %PER% echo -e $[0x0c]WARNING: %PER% persistence file not found! && pause
errorcheck off
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0x0 %PER%
errorcheck on
#map ptn 4 to ISO
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent quiet splash --
initrd /casper/initrd.gz


#3 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2017 - 08:50 PM

3.6 seems to work OK on E2B just as plain .iso file, no menu needed.
You can also add persistence too using a .mnu file...

# Make an ext3 file using RMPrepUSB in the root of the drive (i.e. File Name=linuxlite-rw  Volume Name=casper-rw)
# Size MUST be 300MB or larger (smaller ones may give 'not enough space' errors)
# Place this .mnu file and the ISO in either \_ISO\MainMenu\MNU or \_ISO\Linux\MNU
# This menu will work even on an NTFS USB boot drive# IMPORTANT: you MUST run WinContig (Ctrl+F2) before booting E2B.
# This mnu can be used for 64-bit or 32-bit linux-lite

Please explain me a little more this part: "Make an ext3 file using RMPrepUSB in the root of the drive (i.e. File Name=linuxlite-rw Volume Name=casper-rw)"

Also I think there is someting wrong on your very last paragrafph: "kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent quiet splash -- initrd /casper/initrd.gz" .I can tell you there is not that file on Linux-Lite preseed folder the one inside that folder is custom.seed

alacran



#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 October 2017 - 09:46 PM

I adapted the menu from a ubuntu one. It does work, but you can change it to custom.seed if you wish.

 

RMPrepUSB is my USB preparation utility (as in my tag line below!). One option is to create ext2/3/4 formatted files on a USB drive which can be used for persistence.



#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 October 2017 - 08:54 AM

If I may, back to the original Alacran's menu.lst entry this is seemingly "reversed" or "wrong":

 

 

map --mem /linux-lite-3.6-64bit.iso (0xff) || map --heads=0 --sectors-per-track=0 /linux-lite-3.6-64bit.iso (0xff)

this says "map the .iso in memory, if it fails, then try mapping it "directly".

 

So, if there is enough memory (which I believe on modern machines capable of running late 64 bit Ubuntu's is always true) the .iso will always be mapped to memory.

On the other hand if this fails, depending on the version of grub4dos (either needing a contiguous image or not) the direct mappeing may succeed or fail.

 

Traditionally a similar line was written "the other way round", attempting to map the .iso directly and if it failed (because it was not contiguous) then attempt to load it in memory.

 

Now, what is the difference?

 

Mapping directly is instantaneous, while mapping to memory implies copying the image to memory (which takes times), while it made some sense to attempt direct mapping (instantaneously either working or failing) and have memory mapping as "failback", doing the reverse doesn't seem like particularly smart. 

 

Personally I always liked to have two different, distinct menu.lst entries, so that you actually know how you are loading the thing (either in memory or direct mapping).

 

There may be reasons why one may want the thing loaded in memory and reasons why one may want to have it mapped directly, but these "conditional" loading lines don't actually guarantee *anything*.

 

@Steve6375

The possibility of using the "persistence" file, is it linked to the partnew "partition mapping" of the .iso or can it be achieved by creating the "casper-rw" file even without it? :unsure:

 

:duff:

Wonko



#6 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2017 - 10:22 AM

@ Wonko:

 

Yes, you are right, I'm going to fix first post. Already tested it boots fine both ways (provided it is not fragmented when mapping directly).

 

alacran






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users