Grub4dos - Chit-chat

Using applications, configuring, problems
Message
Author
wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#21 Post by wiak »

jafadmin wrote:@MOTL I run BionicPup32 on older hardware by adding the "forcepae" on the "kernel" line. Works like a charm ..
As far as I recall "forcepae" doesn't work for most old hardware - only those that use Pentium M or Celeron M processors. I could be wrong, haven't used it in a long time and didn't duckngo it, but its all about whether the processor has a pae flag or not.

wiak

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#22 Post by rcrsn51 »

When enrique started this thread, he wanted to discuss how Grub4Dos works in modern environments like GPT.

Unfortunately, some community members cannot be bothered reading an entire thread before posting their own pearls of wisdom. So this thread has devolved into a tutorial on frugal installs.

People who are still interested in the original objective can read my notes here.

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#23 Post by enrique »

rcrsn51 wrote:...People who are still interested in the original objective can read my notes here.
Well my original personal objective was to test that in fact grub4dos can be used to boot Puppys stored in GPT formatted HDD. I was 99% sure it should work but never tested it my self in reality.

But I try to leave the tread objective as open as possible to promote participation. Well nothing did work for me as in fact almost no comment regards grub4dos/gpt was posted.

rcrsn51 thanks you for your post. Very nicely done. Those test probe grub4dos have no identifiable limitations with GPT.

As to answer your question "he provides no details of how he installed". Some where in my previous posts I did said that once people try gru4dos_gpt.tar.xz.tar and place comments, that I will then post how simple was done. But post never happened.

Yes is as ridiculous simple as placing glrdr in any of the available partitions and running bootlace.com --gpt on the device drive.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#24 Post by jafadmin »

Sorry for misreading the thread title. I was laboring under the impression that the thread was about "Grub4Dos Chit Chat" which I realize now is an error, and the true topic is actually about posting etiquette :roll:

Re: bootlace.com; The 0.4.6a version by Yaya will write to a GPT partition, the 0.4.5c version will not.

http://reboot.pro/topic/22106-using-boo ... ng-to-pbr/

.
Last edited by jafadmin on Tue 23 Jun 2020, 21:07, edited 2 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

Re: Grub4dos - Chit-chat

#25 Post by wiak »

enrique wrote:Grub4dos - Chit-chat

This is NOT for:
*ask for for general installation help, Please search the forum for that. Or Open a new thread on Help.

This is a place to exchange Info Ideas or question you may have on how grub4dos becomes Puppy default, the basic Inner works.
For example, Why it is been said you can not used it on GPT?
My own reading of what this thread was about remains the same. GPT concerns were indicated as only as a "For example". Seemed more to be a "place to exchange info ideas or questions you may have on how grub4dos becomes Puppy default, the basic Inner works" - I can't but interpret that as pretty general about grub4dos menu.lst etc and not specificantly only about GPT, but hardly seems to matter if the information helps someone in need...

Personally I've long ago experimented booting from GPT arranged usb sticks via grub4dos (and indeed I have one laptop, which only has my Linix install now on its hdd, arranged exactly like that - previously having Windows on it but which I scrubbed) and probably have notes of my own pearls of non-wisdom somewhere to remind myself how I did it, but I wasn't answering that part at all since I didn't take the time to search through my disorganised notes on the matter

wiak

What a messy post. That coffee I just had was too strong.
Last edited by wiak on Tue 23 Jun 2020, 04:18, edited 3 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

Re: Grub4dos - Chit-chat

#26 Post by wiak »

Sorry, messed-up double post whilst trying to arrange my notes.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#27 Post by bigpup »

Yes is as ridiculous simple as placing glrdr in any of the available partitions and running bootlace.com --gpt on the device drive.
Will Grub4dos Config do this?
If no.
To be useful. Grub4dos Config will need to be code changed to provide this ability.

Where is the how to?

If you only want GPT talked about.
Change the topic tittle to say that.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#28 Post by enrique »

Thanks to all of you.

Title - I guess wrongly chosen.
Chit-chat = small talk, gossip or from wiki "In a nutshell, it is a polite conversation about unimportant things."

Objective - To prove grub4dos can be use in GPT

Motivation. I was tired of been wrongly corrected. So I decided to prove i was not.

Conclusions:
I guess I obtained my objective. Now some users admit grub4dos can be use under GPT.
Learned more about people in Puppy forum. Some will never admit.... Others claim always new but choose not to mention...
Learned I been spending to much time at the forum myself. Previously I was showing up as much as 10 times a day. Now I hope to keep it once a day or so unless I am helping some one that really show interest on been help.

See with the heatwave I move out my desk and away of some of my home projects. So I did end up spending more time here. I am planing to go back to my home projects where I can release more easy my stress.

Godbless Puppy and it derivatives, Long live murga-linux.com

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#29 Post by jafadmin »

@enrique,

"bootlace.com" does NOT equal Grub4Dos. They are two separate things. Even if you had the yaya version of bootlace.com, Grub4Dos as implemented DOES NOT install to a GPT partition.

This distinction is important because we don't want to confuse users into thinking that it will.

To be clear: None of the puppy versions I use have the yaya version of bootlace.com, and therefore will not install onto a GPT partition.

IF Grub4Dos was rewritten, and IF the yaya version of bootlace.com is included with it, THEN it might be possible for folks in the "user" community to install to a GPT partition using Grub4Dos, but not until then.

These guys are right. Grub4Dos will not install puppy onto a GPT partition as distributed.
Last edited by jafadmin on Wed 24 Jun 2020, 03:06, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#30 Post by bigpup »

Where is the how to?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#31 Post by enrique »

This game of words is stressing me up. I will not getting into why there is or not a pet that can play the latest update of a program.

One thing I want so set clear, even when I am stress up, it does not mean I do not admired all the great minds of this forum. Yes the same that are stressing me up at the moment. I like Puppy and I love all of you.

bigpup wants a how to. I hope it is not to tell me later it is to techy!! or it is not Puppy way. If you expect that from me, then I suggest you to wait some one update any of the available pets.

How I build it? Using Linux. You can not expect to talk about Linux file system: images, mounting, loop, formatting, partitioning, listing blocks, etc, etc without using the terminal and the commands.

WARNING. Some of the following commands have the potential to destroy your HDD or USB if incorrectly applied. So if you are newbie just make sure you have backup all your test device (Yes your whole PC). You been warned. So be smart, back up and ask all you think you do not understand, before doing anything. In particular make sure you have identify your target USB/img/HDD etc. So ask, ask and ask again.

I will divide this in at least two parts. Lets start with the empty HDD image.
1) Connect to Internet and move to a Linux ext directory with space
2) Lets create a working directory

Code: Select all

mkdir testdir
cd testdir
3) Lets download recent grub4dos and extract files

Code: Select all

wget https://github.com/chenall/grub4dos/releases/download/2020-02-29-3c0308b/grub4dos-0.4.6a-2020-02-29.7z
uextract grub4dos-0.4.6a-2020-02-29.7z
cd grub4dos-0.4.6a-2020-02-29.7z.extracted/grub4dos-0.4.6a
4) I strongly suggest to learn with file images that simulate Full GPT HDD. And use qemu to play virtually the GPT image. Or you can build your GPT USB as you normally will do at your own risk.
5) Building a image.
a) Lets create a 1 GB EMPTY ( 0x00 ) image

Code: Select all

dd if=/dev/zero of=1GB_GPT.img bs=512 count=2048K

b) Lets Create GPT and partitions: So as it is GPT we need at least 'EFI System' and I took the liberty of making it size 255MB. For Linux we need a swap and space for Linux OS. So I too the liberty to say swap for quemu equal 256MB, then the rest 512MB for Linux. Here the command to create such sample.

Code: Select all

sgdisk --clear \
   --new 1::+255M --typecode=1:ef00 --change-name=1:'EFI System' \
   --new 2::+512M --typecode=2:8300 --change-name=2:'Linux filesystem' \
   --new 3::-0 --typecode=3:8200 --change-name=3:'Linux Swap' \
   1GB_GPT.img
6) Lets check how our image was build by doing a list command.

Code: Select all

gdisk -l 1GB_GPT.img
NOTE: I build GPT image with minimum declared partition, just 'EFI System' type ef00. If you are one that believes you need to add more EFI partitions, feel free to add as many as you want. Yes we all know MBR should be protective.

7) The techy stuff.
For me grub4dos is glrdr+menu.lst. But in order for grub4dos to execute some method need to be added in the chainload sequence of the bootloading mechanism. In my personal choice I want this to be NONE UEFI. Making sure MBR Legacy safegard all GPT boot blocks. This is NOT a magic trick. This is in fact one of the many reasons why MBR is defined as PROTECTIVE by GPT.
I will manually copy glrdr + menu.lst to 'Linux filesystem' partition to ensure I do not touch any of the UEFI stuff, well in my sample UEFI='EFI System' and for the moment is EMPTY. Now to add glrdr I need to mount it! To mount it I need loop! Then we need to format our partitions. Finally copy files needed.
To add stuff to a image of an HDD we need to use loop. Why, I guess is the old way, I do not know at the moment it is over my head. We will just used it.
Lets print our system blocks before we do anything. Just to familiarize with what we have:

Code: Select all

lsblk
Mine show my REAL hardisk sda & sdb, CDROM sr0 & SDCARD mmcblk0. And depending on your Puppy you have loop0-loopn. In my case last one is loob12 witch is my 2GB Puppy save. So we can expect that our image disk will show in my case at next loop or loop13.

Next part be posted soon:

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#32 Post by enrique »

Lets Mount our 1GB_GPT.img to add our files using loop. losetup is the command to use, and it will respond with the device loop selected. So wee need to catch that answer. For this I will be using Bash Variables. LOOPDEV will contain the loop device.
8 ) Lets start my making sure we are in the correct directory =>testdir/grub4dos-0.4.6a-2020-02-29.7z.extracted/grub4dos-0.4.6a

Code: Select all

cd testdir/grub4dos-0.4.6a-2020-02-29.7z.extracted/grub4dos-0.4.6a
9) Lets mount the 1GB_GPT.img

Code: Select all

LOOPDEV="$(losetup -Pf --show 1GB_GPT.img)"
echo "LOOPDEV=${LOOPDEV}"
partprobe ${LOOPDEV}
lsblk
Mine show:
LOOPDEV=/dev/loop13
loop13 7:13 0 1G 0 loop
├─loop13p1 259:0 0 255M 0 part
├─loop13p2 259:1 0 512M 0 part
└─loop13p3 259:2 0 256M 0 part
10) WARNING be sure LOOPDEV point to a new and unused device! If you continue and format what it is not you will loose that partition!!! ASK, ASK & ASK. Yes not for the one with weak hart!
11) Lest format our partitions

Code: Select all

mkfs.fat -F32 ${LOOPDEV}p1
mkfs.ext3 -F ${LOOPDEV}p2
mkswap ${LOOPDEV}p3
12) Now lest see how our new part show up

Code: Select all

blkid
Mine show
/dev/loop13: PTUUID="117e97d9-a3a1-405d-b9b0-e0995636f800" PTTYPE="gpt"
/dev/loop13p1: UUID="D03D-C16F" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="8c103bba-d9c0-4fca-a7fd-f7417bea6787"
/dev/loop13p2: UUID="57095ff1-ee49-44e2-a884-74c249be423c" SEC_TYPE="ext2" TYPE="ext3" PARTLABEL="Linux filesystem" PARTUUID="9c4a1ec6-3abc-49f1-b3dd-265cbb119e25"
/dev/loop13p3: UUID="a8932b78-7d26-4322-b53b-7c652ad99c79" TYPE="swap" PARTLABEL="Linux Swap" PARTUUID="07b63ff4-0fe4-47ba-b7e4-038c29d5a000"
Wait for part3

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#33 Post by enrique »

Part 3. Yes the part you will be waiting. Where we install grub4dos. Lets start my making sure we are in the correct directory =>testdir/grub4dos-0.4.6a-2020-02-29.7z.extracted/grub4dos-0.4.6a

Code: Select all

cd testdir/grub4dos-0.4.6a-2020-02-29.7z.extracted/grub4dos-0.4.6a

NOTE: if for any reason you got lost from part 2 to part3 . Just reboot, so that all loop dev get deleted. Then after reboot just do step 9. This will set up your loop device again. PLEASE note that this is only if any one lost its values. You do not need to do step 9 twice.

Just for remind mine looks like this after only step 9:
LOOPDEV=/dev/loop13
loop13 7:13 0 1G 0 loop
├─loop13p1 259:0 0 255M 0 part
├─loop13p2 259:1 0 512M 0 part
└─loop13p3 259:2 0 256M 0 part
13)Up to here we have set the loop devices and formatted the whole drive. And we need now mount and add our missing files. Just in case I will create another Bash Variable for temporary mounting; MOUNTDIR="mnt". Then create the directory to mount our 2nd partition ‘Linux filesystem’ where our Puppy should be store with grub4dos files.

Code: Select all

MOUNTDIR="mnt"
mkdir -p ${MOUNTDIR}
mount ${LOOPDEV}p2 ${MOUNTDIR}
14) For the sake of having a minimal Puppy, lest just copy our current kernel. This assume you are running a Puppy.

Code: Select all

. /etc/rc.d/PUPSTATE
cp /mnt/home/${PSUBDIR}/vmlinuz mnt/vmlinuz
cp /mnt/home/${PSUBDIR}/initrd.gz mnt/initrd.gz
15) Now lest copy grub4dos boot manager files

Code: Select all

cp grldr mnt/grldr
cat > mnt/menu.lst << EOL 
color white/blue black/cyan white/black cyan/black
timeout 5
default 0 
title Puppy kernel prompt
  find --set-root --ignore-floppies --ignore-cd /vmlinuz
  kernel /vmlinuz pdrv=sda2 pmedia=atahd pfix=ram,rdsh
  initrd /initrd.gz
EOL
umount ${MOUNTDIR}
16) Lets install MBR code on Protective MBR

Code: Select all

./bootlace.com --gpt ${LOOPDEV}
17)Lets exit loop devices

Code: Select all

sync ${LOOPDEV} 
losetup -d ${LOOPDEV}
18 ) We can check now that in fact there is no more loopdev showing up

Code: Select all

lsblk
And out last loop device should not print this time.
19) To test using qemu copy your qemu files from the gru4dos_gpt.tar.xz.tar or from QuemuPuppy
So 1rst copy the 2 qemu

Code: Select all

allinoneqemu_linux
puppy.sh
To execute qemu with our image

Code: Select all

./puppy.sh
qemu will show grub4dos run and it try to boot kernel. Sadly after a while kernel will stop. I think it has to do with the fact that qemu provide hda2 and Puppy expect sda2 as partition. This is a none related problem. You can see that grub4dos do function in GPT disk.

Hope it helps anyone.
Last edited by enrique on Fri 26 Jun 2020, 08:18, edited 1 time in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#34 Post by wiak »

nice work enrique and well explained. I'm sure what you write will be interesting and useful for many. Take it easy.

wiak

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#35 Post by enrique »

I decided to investigate why kernel panic. As I said this is of no importance to Grub4dos/GPT. But it is nice to know why did happened.

EDIT:
I was incorrect. Still kernel panic with "allinoneqemu_linux" . I do not get kernel panic if use a more recent qemu such as "qemu-system-x86_64". Sorry for misleading.

You could install all your Puppy sfs if you like, as sda2 is 500MB.

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#36 Post by enrique »

I decided to investigate on the previous errors on

Code: Select all

wee 0> find --set-root /grldr (0x80,0)
wee 0> /grldr
wee 13> 
Clearly we will never see "wee". But does new grub4dos manage 64bit ext3/4?

I did some test and seems new grub4dos do not have problems with 64 bit ext3/4.

To test your self you can just do the previous procedure, but for step 11) INSTEAD of doing "mkfs.ext3 -F ${LOOPDEV}p2" do instead
mkfs.ext4 -F ${LOOPDEV}p2 -O 64bit
This will enable 64 bit in partition 2. Then test with qemu. As you will notice new grub4dos do in fact boot without any error.

I want to make a note: I am not endorsing or promoting the use of new grub4dos. Nor I do not know the integrity/security of new grub4dos. Nor I know my self the authors of new commits/patch. I am only reporting my findings.

Post Reply