Jump to content











Photo
- - - - -

help needed: booting wee -> grldr config (easy2boot)

weesetup wee grldr easy2boot ext2

  • Please log in to reply
13 replies to this topic

#1 antiplex

antiplex
  • Members
  • 4 posts
  • Location:behind that screen...
  •  
    Switzerland

Posted 21 October 2014 - 08:37 AM

dear community,

 

i have to admit that i'm a beginner when it comes to bootloaders but i've managed to create several usb-bootsticks with the help of grub4dos, rmprepusb and easytoboot.

 

what i am currently looking into is to have easy2boot booting of an ext2-formatted usb-stick (ext-filesystem preferrable in my case for reasons not related to booting itself).

 

i got this idea when i learned that wee is able to boot grldr from an ext-partiton (an weesetup.exe is not included in RMPrepUSB) but somehow i seem stuck at a certain point and after trying several configurations for hours am unsure would be the right thing to do.

 

i got as far as getting easy2boot's /menu.lst on the boot partition executed but instead of executing the files last command 'configfile /%grub%/menu.lst' i end up on the grub-shell.

there i can see that the variable %grub% has been set correctly and the easy2boot-scripts will launch successfully if i enter the last command manually 'configfile /%grub%/MENU.lst'.

so i wonder how i may automate this so that i don't have to manually type this last command every time i boot.

 

what seems a bit weird to me is how weesetup.exe makes use of script files provided by the '-s mymenu.txt' parameter as there seems to be some sort of hard-coded values/options that may remain if using a shorter script (visible when looking at the corresponding sectors with a hex-editor).

 

i already tried to add the command 'configfile /%grub%/menu.lst' to mymenu.txt in different ways but i don't seem to get it right.

is there a way to specify a menu.lst including a path as a parameter to grldr such as '--config-file=/my/path/to/menu.lst' or do i need an entirely different approach?

 

thanks for any hints,

anti



#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 October 2014 - 09:01 AM

Strange.

Cannot remember if grub4dos is CaSeSeNsItIvE on ext2/3, IF it is try with:

configfile /%grub%/menu.lst || configfile/%grub%/MENU.lst

or make sure that the menu.lst is actually named menu.lst (all small letters and not MENU.lst or other variation with mixed case).

When you are at the grub4dos prompt issue command:

ls /%grub%/

and check how grub4dos sees the file

 

:duff: 

Wonko



#3 steve6375

steve6375

    Platinum Member

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

Posted 21 October 2014 - 09:11 AM

Install Wee is in RMPrepUSB  Ctrl+W in Bootloaders tab.

ext2/3/4 is case sensitive

AFAIK there is no utility that works to make files contiguous on an ext2/3/4 volume???



#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 October 2014 - 09:54 AM

Install Wee is in RMPrepUSB  Ctrl+W in Bootloaders tab.

But there is no real *need* to use it, as the "plain" grldr installed on the MBR+hidden sectors will work nicely.
 

ext2/3/4 is case sensitive

Good, then it is probably as posted above a CaSe SeNsItIvEnEsS issue.
 

AFAIK there is no utility that works to make files contiguous on an ext2/3/4 volume???

Yes/no.
http://reboot.pro/to...tool-for-linux/
http://www.linux-mag...agmenting-Linux

But for a USB stick normally it makes more sense to "start from fresh" and copy files to it, they will be contiguous, like the good ol' poor man's NT 4.00 defrag way:
http://www.forensicf...519306/#6519306

The "old" (and "poor man" ) way to defrag a NT 4.00 Workstation in the old times (some of you might remember how NT 4.0 did not come with a built-in defragging tool) was exactly this, I had two installs of NT on two separate partitions, booted to the second (the "emergency") install, used xcopy to copy all the files from "main" partition to a third one, formatted (and optionally wiped) the first one, then xcopied back the files.

 

 

:duff:

Wonko



#5 steve6375

steve6375

    Platinum Member

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

Posted 21 October 2014 - 10:06 AM

If you look at the article results screenshot at the bottom in http://reboot.pro/to...tool-for-linux/
You will see that no files were actually made contiguous. defragfs can reduce fragmentation, but the ext2/3/4 FS seems to 'prefer' files to be fragmented. As you know, grub4dos partnew needs just 1 contiguous block run for a file.

#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 21 October 2014 - 10:21 AM

If you look at the article results screenshot at the bottom in http://reboot.pro/to...tool-for-linux/
You will see that no files were actually made contiguous. defragfs can reduce fragmentation, but the ext2/3/4 FS seems to 'prefer' files to be fragmented. As you know, grub4dos partnew needs just 1 contiguous block run for a file.

I know :smiling9:, and this is EXACTLY why I posted "Yes/no" and why I suggested to create the stick from fresh.

Still, if you try defragfs - say - 1,000 times, on 1,000 different stick setups, it may - by pure chance - manage to make a file contiguous.

 

:duff:

Wonko



#7 steve6375

steve6375

    Platinum Member

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

Posted 21 October 2014 - 10:22 AM

I tried copying to a freshly formatted ext2 volume and still the files were fragmented.



#8 steve6375

steve6375

    Platinum Member

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

Posted 21 October 2014 - 10:38 AM

To load grub4dos from wee, try just

 

/grldr

 

 

http://www.rmprepusb...ilt-in-commands

 

or is that what you did?



#9 antiplex

antiplex
  • Members
  • 4 posts
  • Location:behind that screen...
  •  
    Switzerland

Posted 21 October 2014 - 11:25 AM

steve, wonko, thanks for both of your input which helped me to get things to a new stage:

 

the good news is:

easy2boot finally starts meaning the part 'configfile /%grub%/menu.lst' is now correctly run.

the solution was probably a mix of two issues:

1. easy2boots /menu.lst comes with the line 'configfile /%grub%/menu.lst' but since ext-filesystems are of course case-sensitive (like a good fs should be imho) it won't find/match the file MENU.lst located in /%grub%/ so i corrected that.

2. i stripped weemenu.txt (the script thats going to be embedded into the wee-bootloader) to only contain

  find --set-root /grldr

  /grldr

and filled the file with newline-characters up to reaching the max possible site (784-1 in my case) to avoid any fragments/leftovers from the default menu-entries which appear to have been added by weesetup.exe even on a newly formatted stick.

 

the bad news is:

files are likely not contiguous on ext2/3/4 which also happened in my case =(

so i can't boot any iso's of my partition formatted with an ext-filesystem.

i remember to have read this before but somehow was intrigued by believing wee would maybe change the game here which is of course nonsense as i just learned.

 

so it seems to me that i need to stick to proprietary ntfs (as i would want to use .iso's > 4gb) and hope to manage to keep all iso-files contiguous...

 

i guess chances for grub4dos being able to boot non-contig .iso-files are little given the fact that we live in a M$ dominated world?

 

anyways, thanks a lot for your support!


Edited by antiplex, 21 October 2014 - 11:26 AM.


#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 October 2014 - 02:56 PM

@antiplex

You can use FAT32 alright, at least as long as the .iso does not exceed the 4Gb limit.

 

But you may want to take a step back and have a look at the issue in perspective.

 

The Easy2boot is a nice tool that is suitable to make something that would be otherwise a bit complex, but perfectly doable manually, it may happen that people is distracted by the easyness of Easy2boot and loses sight of the actual "features" that are the base of it's functionalities.

  1. The Linux (kernel/IFS/whatever) allows to access a .iso imaged to a contiguous blocklist as if it was a "normal" partition
  2. The grub4dos can on-the-fly, through the partnew command, create such a partition entry AND mount it/access it's contents in the early "real mode" part of the booting.
  3. The grub4dos command partnew can calculate the location and the extents of the blocklist corresponding to a given file from the "outer filesystem" addressing entry.
  4. Easy2boot provides a structure to automate the above features/behaviours and make them easy to be used. 

I know how I should not :w00t: :ph34r: share these info to people that are not (yet) members of the booting club and know nothing about the secret handshake ;), but if you think a bit about it, there is no "real" need for an "outer filesystem", that would be used only to contain 1, 2 or a few more (if you are what I call a "Linux collector", people that tend to have several distro's with an overlapping of functionalities around 90% or 95%) "largish files".

If you look at the syntax for partnew, you will notice that it was intended:

http://diddy.boot-la...nds.htm#partnew



grub> help partnew
partnew: partnew [--active] PART TYPE START [LEN]
   Create a primary partition at the starting address START with the
   length LEN, with the type TYPE. START and LEN are in sector units. If
   --active is used, the new partition will be active. START can be a
   contiguous file that will be used as the content/data of the new
   partition, in which case the LEN parameter is ignored, and TYPE can be
   either 0x00 for auto or 0x10 for hidden-auto.

to map to a partition entry a contiguous blocklist and feature #3 above is a (nice, BTW) addition.

So, you could have a USB stick divided in (say) two halves, the first one with a partition (and related filesystem) containing grub4dos and related file and the rest UNpartitioned.

For all it matters you could use a plain text file (let's say a .ini) similar to this:



[MyStickLayout]
[ReservedSectors]
Start=1
Len=62
[RealFS]
Start=63
Len=4194304
[MyDistro_01]
Start=4194367
Len=2097152
[MyDistro_02]
Start=6291519
Len=1259520

to take note of the distro's that you dd (contiguously) in the UNpartitioned area, and then use a simple grub4dos batch to read this info and map on-the-fly the chosen blocklist using "START" and "LEN" instead of the filename.

Though the dd built-in grub4dos is (understandably) a bit slowish when compared to the "native" Linux one or corresponding Windows ports, you could use that same .ini to actually dd to the stick the distro's from within grub4dos (or write a Windows batch or Linux bash script to the same effect).

In a VERY simplified way, the .ini above (or something similar) would represent an extremely rough (but effective) filesystem allocation table. 

 

 

 

@Steve6375

I believe that the result of copying a file to an Ext2/3 in a contiguous file may depend on a zillion factors, size of the file, size of the filesystem, inodes number (whatever they are ;)), actual driver version, actual tool used to copy the file and command options used in it.

JFYI:

http://www.linux-mag...gmenting-Linux 

 

It seems that a t least a few of the good Linux guys are (finally) exiting "denial mode" and start admitting (without in any way doubt of the dogmatic "Ext2/3/4 FS need NOT any form of defragmentation") that in some special, rare, extreme cases ;) may not be such a bad idea to have contiguous filesystem contents.

 

:duff:
Wonko



#11 steve6375

steve6375

    Platinum Member

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

Posted 22 October 2014 - 04:05 PM

If you do use Easy2Boot, the latest version has a 500MB file called CONTIG.ISO.

E2B will automatically  use dd to copy a fragmented ISO into this CONTIG.ISO file and then map it using partnew.

 

So, if you use Easy2Boot to boot <500MB linux ISO files, you only need CONTIG.ISO to be contiguous.

Of course, it may take a while to copy the ISO file to CONTIG.ISO and so it is not ideal.

 

If you create a 1GB CONTIG.ISO (any contents) to replace the 500MB CONTIG.ISO then E2B will just use that instead.

 

@Wonko - bad link?



#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 22 October 2014 - 07:19 PM

 

@Wonko - bad link?

Yep, my bad, I had found a (German) page where some "news"  were posted about the revamp of e2defrag:

https://launchpad.net/e2defrag

and results of a few other tools, but posted another one (and right now cannot find the actual page I intended to post a link to :frusty:)

 

:duff:

Wonko



#13 antiplex

antiplex
  • Members
  • 4 posts
  • Location:behind that screen...
  •  
    Switzerland

Posted 06 November 2014 - 09:56 AM

please excuse my late reply, i am still thankful for your shared knowledge that i am just beginning to understand.

 

wonko's idea of dd-ing the iso's to some unpartitioned space of the usb-drive and referencing / mapping their sectors through configuration files sounds quite promising and i hope i'll soon find the time to further play around with this.

for me, there is normally no need to exchange my bigger .iso's too often as i mainly intend keep some basic toolset there.

so thanks for your detailed hints on this matter!

 

also good to learn what the CONTIG.ISO does as i wasn't aware of the functionality. is there anything specific to the CONTIG.ISO that i need to consider when creating a bigger CONTIG.ISO? as i understand so far, it would suffice to create a file full of zeroes in the intended size, right?

 

cheers, anti



#14 steve6375

steve6375

    Platinum Member

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

Posted 06 November 2014 - 10:28 AM

CONTIG.ISO can contain any data you like and be any size you like.







Also tagged with one or more of these keywords: weesetup, wee, grldr, easy2boot, ext2

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users