How to multi-boot Puppy and other Linuxes on same USB

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
trueriver
Posts: 30
Joined: Thu 07 Feb 2013, 15:29
Location: Manchester, England

How to multi-boot Puppy and other Linuxes on same USB

#1 Post by trueriver »

The resulting usb stick will boot into one version of Puppy for normal working. It will also do a live boot of any number of other Linux distros just by including their .iso files. That is right, just drop in the iso and it will run!

This is not the only way to do this: Scooby gives a couple of alternative methods in this thread, and he is also working on further automation. My work here extends his idea, which in turn extend the work of the Easy2boot and Grub4dos projects. Thanks to them all for preparing the way for me.

Comparing my HowTo with Scooby's

Either method has the potential for considerable extension because both are based on Easy2boot.

I am fond of typing stuff at the command line (sad but true), so I am not automating anything for you. Scooby writes scripts to help you along.

Any number of non-puppy isos can be booted in Live mode under either system.

Any number of Puppyies can be booted under either system, but in mine one is a frugal install (allowing changes to persist) and the others can only be booted in live mode.

In Scooby's version, the .iso files are tweaked at install time so that any of them can be run and changes will persist. However Scooby's tweaked .iso files are probably no longer suitable for burning to a real CD.

The frugal install in my system will run slightly faster than the .iso - but not as fast as a fully installed Puppy would.

My method will take more work than Scooby's. That will take up more of your time (boo) but you might end up knowing more about how it all works (hooray)

OK: It is obvious that both systems have relative advantages and disadvantages.

Preparation

I have tried to give the commands in sufficient detail for someone fairly new to the command line to follow what is going on. Do please let me know if I have left anything unclear.

I tested this from an Ubuntu system installed on a hard disk, and used the command line at every step. It worked for me: let me know if it does not work for you. My intention is that it will work on any Linux system with a bash shell.

You will need a working Linux of some sort, and need to know how to run a terminal window or console. This might be an installed distro, or a live USB or live CD from any recent distro.

You also need to know how to run as root. (Not an issue on Puppy, as you are always root unless you are fido)

If your distro does not allow you to log in as root, then the first command in the terminal window or console will be

Code: Select all

sudo -i
or maybe

Code: Select all

su --
You can tell if you are running as root: the last character of the prompt will be a #

If you are logged in as a normal user, the last character will be $.

Warning about using root when tweaking usb sticks. You can easily tweak the wrong one by mistake. Do back up every bit of data on any disk attached to the computer before doing any of this.

Downloads.

(i) You will need one .iso for the version of Puppy you want to for the frugal install.

(ii) Optional: You may want further Linux .iso files (could be more versions of Puppy or another distro).

Suggestion: If you want to try another distro but are stuck for which one, try WattOS - it lies somewhere between Ubuntu and Puppy in terms of size, speed, and suitability for older hardware. http://www.planetwatt.com/pages/downloads

(iii) You will need the easy2boot-grub4dos zipfile

Visit https://sites.google.com/a/rmprepusb.co ... o-maintain
Scroll down to the "Downloads" section at the foot of the page, and choose the latest version. At the time of writing this was v0.05

(iv) Check to see if you have the bootlace.com command: (As far as I know, Puppy is the only distro that includes this as standard, and maybe only some versions of Puppy)

At the command line type

Code: Select all

whereis bootlace.com
and if it tells you where it is, you have it and you can skip this download. If it just gives the name on an empty line, you don't have it and need to fetch it - you can download grub4dos-0.4.4.zip from http://sourceforge.net/projects/grub4do ... t/download to get the version that Puppy usually uses. (Note: there is a later version of the grub4dos files at

(v) Optional: download menu.lst.gz from the foot of this post (the alternative is to cut and paste in the code which is also given below)

OK, that is all the downloading you need to do and the rest can be done offline

This is what you do.

1. Plug in the target usb. As many versions of Linux will auto-mount it, you need to unmount it.

Code: Select all

umount /dev/sdx1
where sdx is the relevant drive (probably sdb1 or sdc1), and 1 is the partition number (for the first or only partition). If it complains that it was already unmounted, just check you did get the one you meant: but otherwise no worries as we wanted it to be unmounted eh?

2. If you know you want to reformat the partition (delete all the existing files) skip to step 3. If there are files on the usb stick that you want to keep, check that the first or only partition is FAT32. GPARTED or the disk utility will tell you the partition type. FAT32 or FAT16 are ok; FAT32 is preferred.

To check from the command line

Code: Select all

fdisk -l /dev/sdx
and it should show the partition as being W95 FAT32 LBA.

Usually there will be just the one partition. If it shows several partitions, that is OK, so long as there is no partition 4 defined. (Partition numbers above or below 4 are fine). This is because Easy2boot relies on faking a partition no 4. Expert note: this means if you want more than 3 partitions, you create one or two primary partitions, then create an extended partition to hold all the other partitions you need. These so called "logical" partitions will be numbered from 5 upwards.

If all is OK with this skip forward to step 4.

Otherwise you will need to copy the files to somewhere safe, and proceed to reformat the partition in step 3. At the end of the process you can copy the files back.

3. Start fdisk

Code: Select all

fdisk /dev/sdx
Use "d" to delete each partition in turn. Use "p" to print the remaining table.

Once the table is empty, use "u" (size units in sectors) and "c" (DOS compatibility not set)

"n" for a new partition, "p" for primary
1 for partition number
accept default values for start and end of the partition

When it has created the partition, it will be flagged as for Linux. "t" changes partition type, when asked for a hex code enter "c"

"p" will print the new partition table - it should show a partition of type W95 FAT32 LBA

"w" to write the new partition table and exit.

Note: while you are in fdisk, "m" will give you brief help (m for manual)

Now, make a FAT32 filesystem in that partition:

Code: Select all

mkdosfs -F32 -n mongrel-pup /dev/sdx1
You can use any short label instead of mongrel-pup (max, 11 letters). This name will show if you mount the drive in windows, or in many flavours of Linux (but is not shown by Puppy).

4. Use bootlace to make the drive bootable

If you had the command properly installed use

Code: Select all

bootlace.com  --time-out=0 --no-backup-mbr /dev/sdx
Note: we leave out the partition number here: we want to make the drive bootable, not just the partition.

If you did not already have the command, extract bootlace.com from grub4dos as follows

Code: Select all

unzip /path/to/grub4dos-0.4.4.zip grub4dos-0.4.4/bootlace.com
replacing /path/to with the actual location of the zip file.

This will place the command in a new folder grub4dos-0.4.4 under the current working directory.

Make bootlace executable and run it

Code: Select all

cd grub4dos-0.4.4
chmod u+x bootlace.com
./bootlace.com --time-out=0 --no-backup-mbr /dev/sdx
cd ..
Notice that the bootlace command does not have the partition number at the end of the drive name.

In case you are wondering, the flags avoid an unnecessary question on every reboot.

If you want to know what all the possible bootlace options are, visit http://diddy.boot-land.net/grub4dos/files/bootlace.htm

5. Mount the new partition from the command line: create an empty directory and use it as a "mount point".

Code: Select all

mkdir /mnt/mp
mount /dev/sdx1 /mnt/mp
6. Extract all the files from the easy2boot-grub4dos zip into the new drive. You can do this graphically or with the following command

Code: Select all

unzip -d /mnt/mp /path/to/easy2boot-grub4dosxxxx.zip
Note: it may seem perverse, but yes we give the destination directory first.

7. Create the directory that will keep the "installed" puppy files separate from any easy2boot files

Code: Select all

mkdir /mnt/mp/installed
8. Copy puppy files from inside the iso to the new directory. Mount the .iso

Code: Select all

mkdir /mnt/iso
mount -t iso9660 -o loop /path/to/puppyxxxx.iso /mnt/iso
and copy the required files

Code: Select all

cp /mnt/iso/{vmlinuz,initrd.gz} /mnt/mp/installed
cp /mnt/iso/*.sfs /mnt/mp/installed
9. Rename the easy2boot main menu for later use as a submenu.

I'm going to give you two ways to do this at the command line. The obvious way is

Code: Select all

mv /mnt/mp/grub/menu.lst /mnt/mp/grub/easy2boot.lst
but it is faster to use the "curly bracket trick" like this:

Code: Select all

mv /mnt/mp/grub/{menu,easy2boot}.lst
which means the same thing. Can you see why it does? Use whichever version of the command you are happier with.

10. Create a new file with the following lines in it. You can cut and paste from the following code box, or if you downloaded the gzip unzip it directly to where it belongs like this:

Code: Select all

gunzip -c menu.lst.gz >/mnt/mp/grub/menu.lst
If you are installing to a usb hard drive, edit the text to use use usbhd instead of usbflash in both the "kernel" lines

If you want puppy to run in ram, use pfix=ram in the first kernel line, and pfix=nox,ram in the second.

Leave out the windows stanzas if you are sure you won't want them: but it is rather cool to be able to rescue a windows system with a broken MBR (whether it was you who broke it or not).

Here is the code, in case you didn't download the gzip earlier:

Code: Select all

default 0
timeout 20

title Puppy Linux
root (hd0,0)
kernel /installed/vmlinuz pmedia=usbflash
initrd /installed/initrd.gz

title Puppy command line
root (hd0,0)
kernel /installed/vmlinuz pmedia=usbflash pfix=nox
initrd /installed/initrd.gz

title Easy2boot options
configfile /grub/easy2boot.lst

title Windows NT/2000/XP
find --set-root --ignore-floppies /NTLDR
chainloader /NTLDR

title Windows Vista / 7 / 8
find --set-root --ignore-floppies /bootmgr
chainloader /bootmgr

title Windows 95 / 98 / ME
find --set-root --ignore-floppies /io.sys
chainloader /io.sys

title reboot
reboot

Save it as /mnt/mp/grub/menu.lst

11. (optional - this step can also be done later on, after the first boot)

Copy any other .iso files from prep step (ii) into the directory /mnt/mp/_ISO/Linux/AUTO

12. Unmount and remove mount points

Code: Select all

umount /mnt/iso
rmdir /mnt/iso
umount /mnt/mp
rmdir /mnt/mp
13. Shut the computer down. Reboot with the new USB stick, and you can boot into Puppy. When you shutdown the first time you run, choose where to put the save file. My suggestion is to put it in /installed along with the other files for the main installed Puppy.

14. Now, when you want to test a different Linux (maybe a different Puppy, or maybe an entirely different distro), just drop the .iso into the AUTO directory on the usb drive. Reboot, choose easy2boot options, then look for the option to boot your .iso in that menu

You can stop here if you are content with that. But there are at least two ways of taking this further (without my help, I'm afraid).

15. If you wanted to install some non-Linux .isos, the time to do that is after you are sure Puppy is working, and at least one non-Puppy Linux. Once you have got them running, refer to these web pages here and here for further details.

Please do *not* ask for help of more details here - that would be off topic for these forums and certainly beyond my ability to help. I am sure people on either website would be able and willing to help you take it further.

16. Another development would be to make the usb stick into several partitions. Do a full Puppy install there, which should run faster than the frugal install (but take more space). Or install a different distro, keeping Puppy as a backup.

17. And you can do it all again on a hard drive (just tweak the pmedia= line appropriately)

Enjoy!

edit: typos
edit: corrected my misunderstanding of Scooby's method
edit: added download for menu.lst and adjusted method to suit
edit: added --time-out flag to the first bootlace command
edit: corrected W95 FAT32 (fdisk type "b") to W95 FAT32 LBA (type "c")
Attachments
menu.lst.gz
New menu.lst file: this adds options to Easy2boot and assumes the original menu.lst has been moved to easy2boot.lst
(292 Bytes) Downloaded 492 times
Last edited by trueriver on Mon 11 Feb 2013, 20:25, edited 6 times in total.

Scooby
Posts: 599
Joined: Sat 03 Mar 2012, 09:04

Re: How to multi-boot Puppy and other Linuxes on same USB

#2 Post by Scooby »

trueriver wrote:
I started out wanting to boot a diversity of .iso files, including other flavours of Linux. Scooby started out wanting mainly to boot multiple Puppies (I think?). Having said that, either method has the potential for considerable extension because both are based on Easy2boot.
Wrong, Scooby boots diferent ISO's. 90% archpup 5% other puppies 4%Linuxes 1%windows

trueriver wrote: but it is faster to use the "curly bracket trick" like this:

Code: Select all

mv /mnt/mp/grub/{menu,easy2boot}.lst
which means the same thing. Can you see why it does?
I cannot see why but I like it. Learned something new
trueriver wrote:

Code: Select all

default 0
timeout 20

title Puppy Linux
root (hd0,0)
kernel /installed/vmlinuz pmedia=usbflash
initrd /installed/initrd.gz

title Puppy command line
root (hd0,0)
kernel /installed/vmlinuz pmedia=usbflash pfix=nox
initrd /installed/initrd.gz

title Easy2boot options
configfile /grub/easy2boot.lst

title Windows NT/2000/XP
find --set-root --ignore-floppies /NTLDR
chainloader /NTLDR

title Windows Vista / 7 / 8
find --set-root --ignore-floppies /bootmgr
chainloader /bootmgr

title Windows 95 / 98 / ME
find --set-root --ignore-floppies /io.sys
chainloader /io.sys

title reboot
reboot

it is possible for Easy2boot with the .mnu approach to do both
windows and installed puppies.


You know about .mnu?



I will see if I can use any of it, thanks for presenting your version

trueriver
Posts: 30
Joined: Thu 07 Feb 2013, 15:29
Location: Manchester, England

Re: How to multi-boot Puppy and other Linuxes on same USB

#3 Post by trueriver »

Scooby wrote:
trueriver wrote:
I started out wanting to boot a diversity of .iso files, including other flavours of Linux. Scooby started out wanting mainly to boot multiple Puppies (I think?). Having said that, either method has the potential for considerable extension because both are based on Easy2boot.
Wrong, Scooby boots diferent ISO's. 90% archpup 5% other puppies 4%Linuxes 1%windows
OK, will edit original post to correct that.
trueriver wrote: but it is faster to use the "curly bracket trick" like this:

Code: Select all

mv /mnt/mp/grub/{menu,easy2boot}.lst
which means the same thing. Can you see why it does?
I cannot see why but I like it. Learned something new
OK. Try these commands and work out why you get the output you do

Code: Select all

echo {clever-,eager-,bowwow}dog
echo amaz{ed,ing}
echo sd{a,b,c,d}{1,2,3,4}
echo pa{s,,rro}t
echo {,banan,t}a
(yes the double comma is correct, not a typo)

By the way, this is my favourite bash trick of all... to use it you kind of have to think ahead: bash pre-processes the line before it passes it to the command so you have to know what you want the command to see,and then work out how to get it there.

Sometimes the full command is typed before the brain works out the shortcut; sometimes the brain gets there first and saves the fingers some work.

R~~

trueriver
Posts: 30
Joined: Thu 07 Feb 2013, 15:29
Location: Manchester, England

Re: How to multi-boot Puppy and other Linuxes on same USB

#4 Post by trueriver »

Scooby wrote:it is possible for Easy2boot with the .mnu approach to do both
windows and installed puppies.
Yes. The point of doing it this way is that the added flexiblity of the easy2boot layer comes at the expense of a small delay in the boot while the software figures out what it has got to offer. Grub4dos on its own is a lot faster. As I am used to using that, the extra delay was annoying me.

This hybrid boot stick will boot all the items in the main menu as fast as grub4dos would.

But when you want the added flexibility of easy2boot, it is just a menu option away. Seems to me like the best of both systems. Try it and see what I mean.
You know about .mnu?
Only recently, a few minutes before I registered here.

To be honest, my preferentce is not only about the speed difference, it is also about it being easier to code things the way I have done it before than to take on something new.

To someone who came to easy2boot at the same time as grub4dos, the familiarity effect may well work the other way round.

Regards
River~~

edit: typos

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#5 Post by nooby »

Much appreciated you told me about Watts that one worked good
booting it using rcrsn51\s method. I write from within it now.
Adobe Falsh works on Youtube and local tv and I can edit files
so that is what I want. boots fast too.

older text

Don't get me wrong now. Much appreciated all the work
you have put into this. I've tested Scooby's approach
twice and me not computer savvy enough so I tested
rcrsn51 and that one worked for me after rcrsn51
helped me out to get the details. Much appreciated .

his approach has also learned from Scooby so I love
that all three has decided to find solutions to this need.

Could you maybe include rcrsn51's approach too
in the comparing and tell how that one are different?

I have told what iso I tested. Link to his is here

How to Make a Bootable Flash Drive using GRUB2
http://murga-linux.com/puppy/viewtopic.php?t=67235

title is a bit misleading due to I only refer to his Isobooter
which is a new approach. Isobooter is grub4Dos
based on ideas from Scooby but rcrsn51 has made it more
simple to use as I get it.
Last edited by nooby on Mon 11 Feb 2013, 22:13, edited 1 time in total.
I use Google Search on Puppy Forum
not an ideal solution though

trueriver
Posts: 30
Joined: Thu 07 Feb 2013, 15:29
Location: Manchester, England

#6 Post by trueriver »

nooby wrote:...
Could you maybe include rcrsn51's approach too
in the comparing and tell how that one are different?
...
Sorry, I don't know enough about rcrsn51's approach to give a fair comparision -- this may be my loss of course because it may be lots and lots better for all I know., but there is so much info on the web we all have to make those snap decisions.

If someone else tries my approach and already knows rcrsn's, they are very welcome to post a comparison in this thread. I'd like to read that too

I did have a quick look at the thread you linked, and will maybe make a quick post or two over there, but I have already decided I do not have the time to work through the method the way I have with Scooby's. So I can't really write a fair comparison.

I discovered scooby's thread from a Google search. Alternative 2 in his thread seemed to be the missing piece of my jigsaw. So I had the incentive to work through his "alternative 2" was the best way to learn what I needed.

I do not have the same incentive to do the same with another method.

Thanks for your friendly words. I am glad my posts are useful.

River~~
Last edited by trueriver on Mon 11 Feb 2013, 20:46, edited 1 time in total.

trueriver
Posts: 30
Joined: Thu 07 Feb 2013, 15:29
Location: Manchester, England

Re: How to multi-boot Puppy and other Linuxes on same USB

#7 Post by trueriver »

Sorry there was a bug in the original post. I will correct it, but if you looked at it before I posted this, please make the necessary correction

When using fdisk, this is wrong
...
When it has created the partition, it will be flagged as for Linux. "t" changes partition type, when asked for a hex code enter "b"
...
and should have read
...
When it has created the partition, it will be flagged as for Linux. "t" changes partition type, when asked for a hex code enter "c"
...
and when you print the partition table, the partition should be shown as W95 FAT32 LBA.

If you have already done it and it works, don't worry. But if it did not work, this may be why...

River~~

gcmartin

#8 Post by gcmartin »

@Nooby has shared that @Rcrsn51 has created a thread where he offers a utility that he's built for use to boot ISOs. There are current instruction on his thread. Also, there is the beginning makings of a guide to simply show how easy this is to do.

As a courtesy, would anyone care to comment on this "ISObooter Utility Guide" for simple running. Your comments are most welcome in an effort to make it easy to boot ISOs.

I have given this some careful thought. I'm betting that someone with some programming skills will make a single screen for accomplishing initial setup and loading ISOs to an HDD/USB. "Just betting ..."

Thanks in advance

User avatar
Mike7
Posts: 400
Joined: Tue 19 Feb 2013, 00:31

#9 Post by Mike7 »

Hi, GCMartin.

I can't get your "Isobooter Utility Guide" to load into my browser. Is there a URL for downloading the file?

Thanks!

Mike

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#10 Post by CatDude »

Hello Mike7
Mike7 wrote:...Is there a URL for downloading the file?
Here you go. Hope this helps
CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#11 Post by cthisbear »

Something I just spotted and must try for all my
multiboot Pups.

thanks >>> BobSongs .

" I installed Lxpup Precise 12.12 to my thumbdrive. However, the USB boot from the thumbdrive didn't give me the CD's start up options.

To restore those options to your USB thumbdrive (RAM drive), copy these files from the Lxpup CD to your USB stick "

Rest here

http://murga-linux.com/puppy/viewtopic. ... &start=570

Chris.

User avatar
Mike7
Posts: 400
Joined: Tue 19 Feb 2013, 00:31

#12 Post by Mike7 »

Thank you very much, CatDude!

hamoudoudou

isobooter explained by esmourguit

#13 Post by hamoudoudou »

isobooter explained by esmourguit for people not speaking english
Cette procédure prend à peine plus de temps que vous en avez pris à lire ce tutoriel. cliquez pour le détail
Attachments
ubututrlututu.jpg
Ubuntu Live-CD and Xenialpup
(50.95 KiB) Downloaded 1153 times
castor.jpg
USB 8GB babybelle
(92.64 KiB) Downloaded 1137 times

Post Reply