Page 1 of 1

Navigating Multiboot GRUB2 menu entries successfully.

Posted: 20 May 2013, 22:56
by surio
I am creating a multiboot external HDD out of an old IDE->USB disk. Made separate ext4 partitions on this and "installed porteus to HDD" by running my USB porteus 2.0 32 and 64 bit sessions. I am assuming that by doing this, I will have an exact replica of my customised USB porteus into the partitions specified. Indeed, all my modules have been copied over, as well as the container dat files that were used in the USB for saving and restoring previous sessions in the USB.

So, for example, porteus 32 is located in /dev/sdX8 as follows: /boot and /porteus directly in the / on /dev/sdX8. The dat file is located in /porteus/optional for the 32-bit version. For the 64 bit, I had created the dat file in a separate dir called /savefile in / of the USB drive. The same setup is replicated for the 64 bit partition also:


My custom grub entries are like this:

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/ ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit"   {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/ ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
With this entry, I have successfully booted into the 32 bit porteus so far. But, it appears that I am in the always Fresh mode, every time. During the boot itself I get a message saying my from was not understood, and that all devices will be scanned. Every time I reboot into porteus, the wifi password is not remembered. That (sort of) confirms my suspicions that my settings are not being looked up. Also, my GUI customisation is also not being reflected.

Ideally, I would like the Porteus menu to pop up after I select the Porteus 32 in the menu entry. I suspect that would allow me to choose the correct menu options, thereby passing the right cheatcodes and get back my custom setup.

So,
  1. Is there a way for me to invoke the Porteus menu when I choose the above menu entry? If so, what is the command? (This is the best option for me, I would like to use one of the 4 options at any given time)
  2. Assuming the above scenario is impossible (I doubt it), what is the correct invocation for the "from" cheatcode, in order for it to correctly pull up the other params?
  3. Given that only 2) is feasible, how do I explicitly specify it to pull up the info from the .dat file.
  4. Also given that the partitions containing 32 and 64 bit are actually ext4 now, how do I instruct Porteus to roll over from the .dat file to directly storing data in the filesystem itself.

Many thanks in advance.
Surio. :)

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 01:26
by neko
I think that Porteus is booted with .dat by the menu

menuentry "Porteus 2.0 -- 64 bit" {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw from=/dev/sdX7 changes=/dev/sdX7/porteus/optional/port64sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit" {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/dev/sdX8 changes=/dev/sdX8/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 05:23
by surio
@neko,
Thanks for the reply.
Regarding your suggestion on the menu entries, I am making those changes to my menu (will reboot later and test), but I made a small change. This is how I wrote it:

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/dev/disk/by-label/port64 ##changes=/savefile/port2-64b.dat
initrd /boot/syslinux/initrd.xz	
}

menuentry "Porteus 2.0 -- 32 bit"   {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32 ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
EDIT:
No, that did not work. Unfortunately I got this error:

Code: Select all

rmdir /mnt//dev/sdb2 could not mount 
incorrect from= code. Press RETURN to try all possible devices
Output of my /proc/cmdline

Code: Select all

quiet BOOT_IMAGE=/boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32
END of EDIT


So, @all,

Since it is accessing the same partition, but with something more permanent than disk letters that might change, it should be okay? Secondly, I also realise that my porteus.cfg file needs some changing. This is my menu entry from porteus.cfg:

Code: Select all

APPEND initrd=initrd.xz changes=/mnt/sdb/porteus/optional/port32sav.dat 
TEXT HELP
    Run Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
Note the "changes=" parameter. The device name is hard-coded, and shouldn't be that way! Just realised that in the case of porteus.cfg above, disk/dat file recognition has been successful because I have not introduced too many edge cases by plugging yet another USB/disk at boot time :oops: .

What is a good way to rewrite that param, given that I have moved the configuration into a separate ex4 partition. Or going one step further, how to do away with the dat file and make it persistent on the filesystem?

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 05:41
by surio
No, the above change did not work. I am posting this from a "Fresh" porteus session :(
EDIT:
No, that did not work. Unfortunately I got this error:

Code: Select all

rmdir /mnt//dev/sdb2 could not mount 
incorrect from= code. Press RETURN to try all possible devices
Output of my /proc/cmdline

Code: Select all

quiet BOOT_IMAGE=/boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32
END of EDIT

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 07:44
by neko
You wrote that
> Since it is accessing the same partition,
> but with something more permanent than disk letters that might change,

So, you specified the partition by "/dev/disk/by-label/port64" instead of "/dev/sdX7".

I think that Porteus has 4 notations for specifing a partition.
ex.
1)"/dev/sda1"
2)"/mnt/sda1"
3)"LABEL:LabelName"
4)"UUID:1234567890abcdef"


The menu for notation 3) is

=====================================
menuentry "Porteus 2.0 -- 64 bit" {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw from=LABEL:port64 changes=LABEL:port64/porteus/optional/port64sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit" {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=LABEL:port32 changes=LABEL:port32/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
=====================================

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 11:07
by surio
@neko,
That command variant worked. It pulled all my customisations from the dat file, and connected to the Net on logging in :) ! So, my earlier attempt was basically "foiled by bad syntax" :(

Thanks.

Now, there are some broader questions from me regarding multi-boot:
  1. What abour porteus.cfg ? How do I include the dat file in the changes= param (Snippet included above).
  2. As a next step, if I want the Porteus boot menu to come up when I select the "Porteus" option from the main boot menu, what is the command to invoke? Any ideas?
  3. Since I have moved to an ext4 partition now from the FAT32 USB, I want to eliminate the .dat and start storing changes locally. How does one do that?



On a semi-serious note: Coming next to the forums after this show,
multibooting porteus along with other distros using syslinux !
:D

@Ahau,
Want me to collate all of these and contribute to your tutorial on multiboot, after I complete them ? ;) :)

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 18:13
by hypomania
I do not use Grub , but try to use Lilo ,
put 32bit in folder 32bit, and 64bit in folder 64bit, then type these option in 'porteus.cfg'

Code: Select all

LABEL 32bit
MENU LABEL Graphics mode (32bit)
KERNEL vmlinuz
APPEND initrd=initrd.xz from=/32bit changes=/dev/sdX7/porteus/optional/port32sav.dat
TEXT HELP
    Run Porteus in 32bit.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
 =======================
LABEL 64bit
MENU LABEL Graphics mode (64bit)
KERNEL vmlinuz
APPEND initrd=initrd.xz from=/64bit changes=/dev/sdX8/porteus/optional/port64sav.dat
TEXT HELP
    Run Porteus in 64bit.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT




Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 21 May 2013, 18:50
by surio
@arabic_world,

Thanks for adding your thoughts. But,
  1. I already have hardcoded device letters in my original cfg (you can see the snippet above), and I want to move away from them. Your solution also uses hard coded letters like mine.
  2. I want grub to take me to the menu (independently).
  3. Also, I do not want a combined 32 + 64 bit menu, although it can be a different fun :)
  4. Lastly I want to get rid of the container file (if possible), now that I have moved from a FAT32 to a ext34 partition.
I hope some others also have some ideas around these points :)

But, thank you for adding your thoughts.

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 22 May 2013, 19:26
by fanthom
will reply to the questions which i know the answer:
1. I already have hardcoded device letters in my original cfg (you can see the snippet above), and I want to move away from them.
use LABEL or UUID as described by neko, check /boot/docs/cheatcodes.txt if need more info.

sample before conversion:
from=/mnt/sda4/port32

after conversion:
from=UUID:ac8d44b2-3518-4bab-b56c-d98d98816f1d/port32
(/mnt/sda4 gets replaced by unique partition UUID)
4. Lastly I want to get rid of the container file (if possible), now that I have moved from a FAT32 to a ext34 partition.
create a directory named 'changes' under /porteus, then run:

Code: Select all

mloop /path_to/save.dat && cp -af /mnt/loop/. /mnt/sda3/porteus/changes/.
now you can boot with standard 'changes=/porteus' cheatcode.

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 23 May 2013, 06:28
by surio
Hi fanthom,
Thanks for taking some time and replying.

I have this other question, for which I am sure you will have some insight.

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/dev/disk/by-label/port64 ##changes=/savefile/port2-64b.dat
initrd /boot/syslinux/initrd.xz   
}
linux and initrd takes me directly to porteus session. Instead, if all I wanted was to access the Porteus/syslinux menu, and choose what to do from there..... In other words, from the GRUB2 bootloader menu, I want to load the syslinux/porteus.cfg menu items, and chose my next course of action.

.............. how to go about it ?


Thanks.

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 23 May 2013, 07:35
by fanthom
i'm sorry but i have no experience with creating multiboot entries.

i'm sure ther are some tutorials on the net, maybe try here:
http://www.dedoimedo.com/computers/linu ... -boot.html

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 24 May 2013, 01:40
by neko
An example of multi boot/ISOs for ext2/3/4 FS & GRUB2

1. USB is formated.
# blkid

Code: Select all

/dev/sdc1: LABEL="U32" UUID="dc948f7b-77a6-44cd-b270-8c851c0488e9" TYPE="ext4" 
/dev/sdc2: LABEL="U64" UUID="04296081-cac2-4326-be5c-efca24f088e8" TYPE="ext4" 

2. MBM is set on the MBR of the USB /dev/sdc.
3. GRUB2s are set on the PBRs of /dev/sdc1 & /dev/sdc2.
4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.

# ls -R /mnt/sdc1

Code: Select all

/mnt/sdc1:
boot/  live/  lost+found/  porteus/

/mnt/sdc1/boot/grub:
Backgrounds/  grub.cfg  i386-pc/
fonts/        grubenv   locale/   porteus.cfg

/mnt/sdc1/live/porteus:
Porteus-v2.0-i486.iso  porteus.cfg
# ls -R /mnt/sdc2

Code: Select all

/mnt/sdc2:
boot/  live/  lost+found/  porteus/

/mnt/sdc2/boot:
grub/  grub2.txt

/mnt/sdc2/boot/grub:
Backgrounds/  grub.cfg  i386-pc/
fonts/        grubenv   locale/   porteus.cfg

/mnt/sdc2/live/porteus:
Porteus-v2.0-x86_64.iso  porteus.cfg
# cat /mnt/sdc1/boot/grub/porteus.cfg

Code: Select all

submenu "#==============< PORTEUS >===============#" {
menuentry "Graphics mode (Razor)" {
search --no-floppy --fs-uuid --set=root dc948f7b-77a6-44cd-b270-8c851c0488e9
set iso="/live/porteus/Porteus-v2.0-i486.iso"
loopback loop $iso
linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/porteus" \
 from=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/live/porteus/Porteus-v2.0-i486.iso
initrd (loop)/boot/syslinux/initrd.xz
}
......
}
# cat /mnt/sdc2/boot/grub/porteus.cfg

Code: Select all

submenu "#==============< PORTEUS >===============#" {
menuentry "Graphics mode (KDE)" {
search --no-floppy --fs-uuid --set=root 04296081-cac2-4326-be5c-efca24f088e8
set iso="/live/porteus/Porteus-v2.0-x86_64.iso"
loopback loop $iso
linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:04296081-cac2-4326-be5c-efca24f088e8/porteus" \
 from=UUID:04296081-cac2-4326-be5c-efca24f088e8/live/porteus/Porteus-v2.0-x86_64.iso
initrd (loop)/boot/syslinux/initrd.xz
}
......
}
# diff /mnt/sdc1/live/porteus/porteus.cfg /mnt/sdc1/boot/grub/porteus.cfg

Code: Select all

6c6
< linux (loop)/boot/syslinux/vmlinuz  "changes=/porteus" \
---
> linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/porteus" \
5. Tools/Commands are used.
(1) 'gparted' --> [1. USB is formated.]
(2) 'setlive' --> [2. MBM is set on the MBR of the USB.]
(3) 'setlive' --> [3. GRUB2s are set on the PBRs of /dev/sdc1 & /dev/sdc2.]
(4) 'setlive' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]
(5) 'mkdir' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]
(6) 'leafpad' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]

6. Tool 'setlive'
is included in en4.iso* (http://www.mediafire.com/?e60ddi77psfsn1o)
-> [application menu] -> [System Tools] -> [setlive]

Tool 'setlive' componentes are
@/porteus/modules/BASE-boot.xzm,
@/porteus/modules/BASE-boot_en.xzm, and
@/porteus/modules/BASE-inst.xzm
extracted from en4.iso

*refer
"32bit Porteus v2.0 + FVWM(Austrumi like) and minimized"
http://forum.porteus.org/viewtopic.php?f=75&t=2000

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 24 May 2013, 11:13
by Hamza
Please use CODE Tag.

Re: Navigating Multiboot GRUB2 menu entries successfully.

Posted: 25 May 2013, 03:16
by neko
Hamza, thank you for your kindness!!

I never used HTML expressions on this site.
Next time, I will try to use the HTML expression.