How to partition a USB flash stick, add GRUB?

Booting, installing, newbie
Post Reply
Message
Author
User avatar
fjd
Posts: 57
Joined: Wed 04 Mar 2020, 00:27
Location: Sydney, Australia

How to partition a USB flash stick, add GRUB?

#1 Post by fjd »

Hiyall,
USB sticks are continually getting bigger for what I believe is no apparent reason. I think this is what progress means. 32Gb seems to be the current norm.
Furthermore the amount of OSs in the 'tiny' area is bewildering.
I would like to keep many on a USB stick partitioned to say; 32x 1Gb.
To do so I need to add GRUB2 to a stick.
How?
2011 ASUS Eee PC, 1011PX, 32-bit, Atom N455, 1667MHz, 2Gb RAM, 240Gb SSD - [color=red] BionicPup 32-bit [/color] frugal + USB stick install

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

#2 Post by bigpup »

What specific operating systems do you want to put on this USB stick?

If it is a bunch of different Puppy versions.
That is easy.

For other Linux OS's, maybe, maybe not, so easy.
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)

User avatar
fjd
Posts: 57
Joined: Wed 04 Mar 2020, 00:27
Location: Sydney, Australia

#3 Post by fjd »

If my choice is: only Puppies, then sobeit. However if I have a choice, I'd prefer to have all sorts of Linux (only) OSs.
2011 ASUS Eee PC, 1011PX, 32-bit, Atom N455, 1667MHz, 2Gb RAM, 240Gb SSD - [color=red] BionicPup 32-bit [/color] frugal + USB stick install

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

#4 Post by bigpup »

Google search:
multiple linux usb
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)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Hello fjd.

To boot a Puppy Linux from a USB disk, you must first
specify this USB disk as your 1st boot device in your BIOS.

Second, you need to partition the USB disk. To partition it,
you need to use GParted or GParted-shell on the
unmounted USB disk.

My suggestions at this point would be :
-- one Puppy per USB stick. If more, it gets confusing, and files
of the 2nd Puppy may squish files from the 1st Puppy.

Label the USB stick with a little piece of paper and Scotch tape,
so you'll know which USB stick has what on it.

-- two partitions only on the USB stick:
the Puppy OS in the first partition (maybe 1.5 Gb)
the rest as a data or general files partition.
Both partitions formatted in ext2 format (better, less wear, IMO).

Now you would copy the contents of the Puppy ISO to your stick.
All Puppies I believe come with a native grub configuration.
So grub will already be there after copy

You may wish to try booting your new Pup-on-a-stick at this point.

~~~~~~~~~~
If it does not work, install grub "manually" to the first partition. There
should be something called "Grub4DosConfig" in your menu. Click on
that, read the Help (important), and then follow the prompts.

Be careful not to affect any hard drive: check which "sd" your USB disk is on.
(Something like "sdf1" or "sdg1", perhaps.) Then have the Grub4DosConfig
script write grub to that.

If unsure, come back to ask your questions here!

IHTH

~~~~~~~~~~~~~~~~
P.S.
Bigpup is too modest to tell you, but he produced in collaboration a Puppy installer
a few years back. I saw recently that he wanted help in updating it for the new
UEFI-booting Pups. So maybe ask him where it's at?

If his installer got an update, the simplest thing would be to use it.

BFN.
Last edited by musher0 on Fri 17 Apr 2020, 06:42, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Geek3579
Posts: 36
Joined: Sat 19 Aug 2017, 03:17

#6 Post by Geek3579 »

Hi fjd,

A long answer cut short. From my limited experience it is difficult to install more than one fully fledged OS on a usb, as the USB can only boot from one partition if there are several.

I install MX-Linux on the USB which creates the EFI FAT32 boot partition, plus a fully installed MX-Linux OS into an ext4 partition, with ability to save changes.

One can add* other OS into the ext4 partition, and add scripts to load them into to the GRUB menu via a custom.cfg file in the /boot/grub folder in the installed MX-Linux partition.

* One can have as many Frugal Puppy OS as space will allow, each with its own savefile/folder, and script in the custom.cfg file.

* or you can chainload into many Linux ISO with a suitable script in the custom.cfg file. But it is difficult to save changes to the OS via persistence in this setting.

It all depends on WHY you want many Linux OS, and on the one USB. If it is just to try out various Linux OS, why not install VirtualBox in a single Linux OS and go from there??

User avatar
fjd
Posts: 57
Joined: Wed 04 Mar 2020, 00:27
Location: Sydney, Australia

#7 Post by fjd »

You've both convinced me! It's just not reward for effort. My new strategy is to leave the .isos on the computer's HDD and transfer them to a USB as required. One less thing to learn!
2011 ASUS Eee PC, 1011PX, 32-bit, Atom N455, 1667MHz, 2Gb RAM, 240Gb SSD - [color=red] BionicPup 32-bit [/color] frugal + USB stick install

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#8 Post by Burn_IT »

1) Not all USB sticks support a partitioning file system.
2) Not all USB sticks support booting from them.
3) Not all machines support booting from a USB stick - the BIOS has to have the code to support USB

Even if you get a make of stick that does support it, not all sizes of that stick consistently support it.
There is no standard for USB boot support.
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Re: How to partition a USB flash stick, add GRUB?

#9 Post by Moose On The Loose »

fjd wrote:Hiyall,
USB sticks are continually getting bigger for what I believe is no apparent reason. I think this is what progress means. 32Gb seems to be the current norm.
Furthermore the amount of OSs in the 'tiny' area is bewildering.
I would like to keep many on a USB stick partitioned to say; 32x 1Gb.
To do so I need to add GRUB2 to a stick.
How?
I have done this or a thing very like it.
I used gparted to make partitions on the USB stick.
The first one I made as a VFAT.
This works to make any Windows users who happen to plug in the stick happier.
Making it a 2G seems big enough

With a DOS partition table you can only have 4 real partitions on a device.
This means that you may have to get a bit more creative than I did.

My second partition was where I put the first puppy linux
A 3rd partition had a different puppy linux
The GRUB or Grub4Dos goes into the root partition of the whole device using the syslinux thing.
The menu.lst ends up on the VFAT partition

There was an era of PC where this worked on practically every single one. PCs before that could not boot from USB and ones after that just refused to do so.
Generally you have to pound away on the F12 key as the machine wakes up and then tell it to boot from the USB. On many BIOSes, the next time you boot the USB shows up as a different thing so any setting to make the machine boot from the USB stick is effectively lost. The fact that it will offer to the legacy style boot is remembered so it is partially good.

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

#10 Post by bigpup »

If this is an old computer that does not have UEFI bios.

Multiple Puppy versions as frugal installs.

The Yapi installer (link in my signature) is a good installer to use.

Running from a Puppy version, booting from a live CD/DVD or USB stick, or even after you get one installed and running.

Simply do a frugal install of a Puppy version.
Close the installer program you used to do the frugal install.

Run Grub4dos Bootloader config program.
Usually found in menu->Setup
Select the drive with the frugal installs as device to install on.
Select search only within this device.
Change no other settings. Just use default settings.
OK.
OK.
OK.
Done.

Grub4dos boot loader will be installed with boot menu entries for every Puppy version it finds installed.

If you add a Puppy version install.

Rerun Grub4dos Config to update the boot menu.


Note:
Drive has to be using msdos partition table.

An internal hard drive or SSD is OK to just have
one partition. Make sure to flag it boot.

On a USB stick.
Better to have two partitions.
First one small 500MB, formatted fat32, flagged boot. This holds the boot loader files.
2nd partition, rest of drive. Formatted ext2, 3, or 4.
Install all Puppy versions frugal installs to the 2nd partition.
Grub4dos boot loader will install on the first partition.
It will automatically install to first partition.

Warning:
If the computer has UEFI bios.
That can be a completely other process to get working.
Some times in UEFI bios, disable secure boot or enable legacy boot. Grub4dos boot loader will still work.
Some you have to do other stuff.
UEFI bios does want to see the boot loader on a small first partition, formatted fat32, flagged boot.
So, setup drive with two partitions minimum.(as shown for USB sticks)
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)

Post Reply