Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 01 Jul 2015, 00:54
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Bootable USB using GRUB and Puppy 5.2
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 18 Oct 2010
Posts: 19
Location: Quesnel, BC, Canada

PostPosted: Mon 07 Feb 2011, 19:15    Post_subject:  Bootable USB using GRUB and Puppy 5.2
Sub_title: Yet another way to make a bootable usb key with Puppy 5.2

There are a number of ways to create a bootable USB key for Puppy 5.2. I will document a way that works for me.

If you have trouble using GParted on your USB (exits immediately)
start by wiping the partition table (assuming your USB is sdc) at a
console prompt type (back up any files you wish to keep from the
USB first):
dd if=/dev/zero of=/dev/sdc bs=512 count=1

You can wipe your entire key (if you wish) with the command
dd if=/dev/zero of=/dev/sdc
Provided your key is seen as sdc. Careful with this command it will wipe any
drive that is recognized as sdc. You can cancel out of this dd process part
way through by hitting CTRL and C together. Canceling out does not mean
any damage done so far is reversed or undone however.

Using GParted access the USB device. You will first need to create
a partition table (if you wiped it as shown above),
Device menu -> Create Partition Table, click Apply. A
MS-DOS partition table is the one you want (it is the default).

Partition the USB key as fat32 (so Windows can also see it). Click Apply.
Right click on the new partition and select Manage Flags from the shortcut
menu. Select (check) boot so the partition is marked as bootable. Quit

Then create a /boot directory and a /puppy52usb directory at the root of the

Then create a /boot/grub directory on the USB key.

Then copy the files stage1, stage2, and fat_stage1_5, and put them
into the /boot/grub directory on the USB flash memory key. These files
are located in /usr/lib/grub/i386-pc in a puppy installation.

cp /usr/lib/grub/i386-pc/stage1 /mnt/sdc1/boot/grub
cp /usr/lib/grub/i386-pc/stage2 /mnt/sdc1/boot/grub
cp /usr/lib/grub/i386-pc/fat_stage1_5 /mnt/sdc1/boot/grub

Copy the puppy boot files over to /puppy52usb/ on the USB key. These
files include initrd.gz, lupu_520.sfs, vmlinuz and any puppy save files
or SFS (squash file system) files you wish to prime the USB with.

After the files are copied over, it's time to install GRUB to the
Master Boot Record (MBR) of the USB flash memory key.

# grub
grub> find /puppy52usb/vmlinuz

This indicates what drive to use for the following commands. Ensure we don't
have this same folder file structure on any other disk or we may be confused.

grub> root (hd2,0)

# Make sure you use the drive indication not including the partition
# for the following setup command or it will fail.

grub> setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... yes
Running "embed /boot/grub/fat_stage1_5 (hd2)"... 15 sectors are embedded.
Running "install /boot/grub/stage1 (hd2) (hd2)1+15 p (hd2,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
grub> quit

Edit (create) the /boot/grub/menu.lst file to look something like this.
# GRUB configuration file '/boot/grub/menu.lst'.
# Start GRUB global section
default 0
timeout 5
color light-gray/blue black/light-gray
# End GRUB global section
# Linux bootable partition config begins
title Puppy Linux 5.2 (usb as hd0,0)
root (hd0,0)
kernel /puppy52usb/vmlinuz pmedia=usbflash psubdir=puppy52usb
initrd /puppy52usb/initrd.gz
# Linux bootable partition config ends
# Linux bootable partition config begins
title Puppy Linux 5.2 pfix=ram (no pupsave file loaded, usb as hd0,0)
root (hd0,0)
kernel /puppy52usb/vmlinuz pmedia=usbflash pfix=ram psubdir=puppy52usb
initrd /puppy52usb/initrd.gz
# Linux bootable partition config ends
#title Install GRUB to floppy disk (on /dev/fd0)
#pause Insert a formatted floppy disk and press enter.
#root (hd0,0)
#setup (fd0)
#pause Press enter to continue.
#title Install GRUB to Linux partition (on /dev/sda1)
#root (hd0,0)
#setup (hd0,0)
#pause Press enter to continue.
title - ===============================================================
root (hd0)
title - For help press 'c', then type: 'help'
root (hd0)
title - For usage examples press c then type: 'cat /boot/grub/usage.txt'
root (hd0)
title - For robs notes press c then type: 'cat /boot/grub/robsnotes.txt'
root (hd0)
title - The interactive grub prompt supports TAB commandline completion
root (hd0)
title - ===============================================================
root (hd0)

The contents of the /boot/grub/robsnotes.txt file looks like this...
This file is some of my notes concerning boot problems specifically
with regards to the USB.

The usage.txt file has more general information
type: 'cat /boot/grub/usage.txt' to see that file.

When setting up the grub boot the indicated drives and partitions
are not the same as when actually booting from the USB key.

For example the drive sdc was indicated as (hd2) and the partition
sdc1 was indicated as (hd2,0) when we installed grub. But When actually
booting from the USB, the BIOS remaps it to be (hd0) as if it was
the first hard disk. I alter the menu.lst text file to use (hd0,0)
as the boot partition and it works. After booting the drives are
switched around and then the hard disk in grub is once again assigned
(hd0) and the USB (hd2).

This may not be true for all computers. So if you are unable to
boot this puppy USB it could be you need to edit the entry to use
(hd2) again. One way to know what you have to use is to press c this
will put you into the Grub interactive mode. Then type find
/puppy52usb/vmlinuz (or a file you know should be on the USB).
Grub will indicate which drive it finds the file on (one reason
why I changed the puppy folder to say puppy52usb).

Press the [Esc] key to return to the GRUB menu. Then press e to
edit the entry for booting puppy. Highlight the (hd0,0) line and press
e again. Change the line to be (hd2,0) or whatever drive it should be
and then press b to boot.

Hope this helps. Rtaylor.

If the /boot/grub/usage.txt file does not exist it looks like this..
This is an example of how to use the GRUB edit function.

Highlight the menu entry you want to edit, then press 'e', then
highlight the line you want to edit and press 'e'. Add what
you want to the line 'hdd=scsi' etc. and press enter, then
'b' to boot.

Examples of the difference between Linux and GRUB device names.

/dev/hda1 (hd0,0) /dev/sda1 (hd0,0)
/dev/hda2 (hd0,1) /dev/sda2 (hd0,1)
/dev/hda3 (hd0,2) /dev/sda1 (hd0,2)
/dev/hda4 (hd0,3) /dev/sda2 (hd0,3)
/dev/hdb1 (hd1,0) /dev/sdb1 (hd1,0)
/dev/hdb2 (hd1,1) /dev/sdb2 (hd1,1)
/dev/hdb3 (hd1,2) /dev/sdb1 (hd1,2)
/dev/hdb4 (hd1,3) /dev/sdb2 (hd1,3)

These are some examples of how to use GRUB from the command prompt.

Press the 'c' key for the command prompt.

If you want to boot a Linux system on a partition, using it's kernel
/boot/vmlinuz etc., do this.

grub> root (hd0,1)
grub> kernel /boot/vmlinuz root=/dev/hda2 ro
grub> boot

You could do this to find what partition the kernel is on.
For example, show me what partitions have a /boot/vmlinuz.

grub> find /boot/vmlinuz

If you want to boot a Dos/Win partition, do this.

For example, boot partition on /dev/hda1.

grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot

If you want to boot a FreeBSD partition using /boot/loader.

For example, boot freebsd partition on /dev/hda4.

grub> root (hd0,3,a)
grub> kernel /boot/loader
grub> boot

If that doesn't work, try this instead.

grub> rootnoverify (hd0,3,a)
grub> chainloader +1
grub> boot

Press the [Esc] key to return to the GRUB menu.

That's it for the instructions now for the novel (story) part of the document. I have 5 machines to test boot keys on and I have a variety of keys ranging from 128 Megabytes to over 4 Gigabytes.

When I first started with Puppy I used the Puppy Universal Installer and some of my smaller keys. The installation and operation of the USB keys seemed to go very well and I was able to boot the keys on several of my PCs with little difficulty.

As I grew in my Puppy knowledge and learned to create and use sfs files for my applications (saving on pupsave file space) my needs for more space on the USB keys grew. I started using more of my keys and ran into some difficulties.

I have one key in particular that is actually 4.17 Gb in size which I could never manage to make bootable. I tried everything I could using the "Puppy Universal Installer", "Using the BootFLASH install Puppy to USB" and using dd to put different MBRs over to the USB.

Then I have another key which is actually 3.79 GB in size which I managed to get to be bootable on one PC using the "Puppy Universal Installer" but which would not boot on several other PCs.

I searched for tools and howtos in Google and tried and failed at a number of efforts. Often I would end up with the key no longer able to be accessed by GParted. GParted would just immediately exit when trying to read the partition table.

Finally I managed to put together this method (documented above) by extracting details from a few different howtos I found. The exciting part is now my 4.17 GB key will boot properly (never booted before) and my 3.79 GB key boots on every PC I've tried it on.

I have gone on to develop a similar howto for creating a DOS bootable USB key using Puppy 5.2 and Grub. Here is a link to that post:
Back to top
View user's profile Send_private_message 

Joined: 13 Dec 2008
Posts: 116
Location: Oregon & Washington

PostPosted: Mon 28 Feb 2011, 14:47    Post_subject: Adding a PNG file that shows using ROX Filer to copy files  

Hello Adding a PNG picture that has me using the ROX Filer to copy files to USB Flash Disk Drive. It clears up where to find the source files.
Thanks for this excellant tutorial that makes good sense!
I can confirm that a 128MByte Flash Disk Drive is just a little bit small for Lupu 5.20 Puppy Linux.. One needs a minimum 256Mbyte Flash drive for Lupu 5.20 installation.

I booted from Lupu 5.20 CD rom. I clicked on the sr0 icon on the desktop and clicked on the sdb1 icon for the USB Flash disk drive.
cp /mnt/sr0/vmlinux /mnt/sdb1/puppy52usb
cp /mnt/sr0/initrd.gz /mnt/sdb1/puppy52usb
cp /mnt/sr0/lupu_520.sfs /mnt/sdb1/puppy52usb

Are any of the other files listed in /mnt/sr0 needed to be copied onto the USB Flash drive like: logo.16 boot.msg help.msg help2.msg ??
Description  Use ROX Filer to copy files graphically to USb Flash Disk or use the command line from the Menu --> Utility --> Urxvt Terminal Emulator.
cp /mnt/sr0/initrd.gz /mnt/sdb1/puppy52usb

Filename  copy_boot_files_to_usb_drive.png 
Filesize  136.87 KB 
Downloaded  362 Time(s) 
Back to top
View user's profile Send_private_message 

Joined: 13 Dec 2008
Posts: 116
Location: Oregon & Washington

PostPosted: Mon 28 Feb 2011, 17:42    Post_subject: Additional Help files in making a bootable USB Flash Disk.  

refer to this post that has links to read up on Grub Usage on the web.

Command line useage
Menu --> Utility --> Urxvt terminal Emulator

fdisk -l /dev/sdb Fdisk command can edit the partition from the command line the same as Gparted can do from a graphical screen. You can start gparted from the command line as below.

gparted /dev/sdb Working with Gparted to partition the USB Flash Disk device. Set the type to "FAT32" or "FAT16" for smaller flash disks. Edit the label name. Set the "Boot" flag.

df /dev/sdb1 how much disk free space exists on the sdb1 device.

mount The command by itself will list what devices are already mounted.

mount /dev/sdb1 /mnt/sdb1
mount /dev/sr0 /mnt/sr0
ls /mnt/sdb1 list the files in the root directory on the sdb1
df /mnt/sdb1 check the sdb1 disk free space
mkdir /mnt/sdb1/boot
mkdir /mnt/sdb1/boot/grub
mkdir /mnt/sdb1/puppy52usb
ls /mnt/sr0 list the files in the root directory on the CDROM
ls /usr/lib/grub/i386-pc listed the file in the mounted grub directory


[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub> find /puppy52usb/vmlinuz

grub> root (hd1,0)

grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... yes
Running "embed /boot/grub/fat_stage1_5 (hd1)"... 16 sectors are embedded.
Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded


when finished using the USB Flash disk drive (sdb1) and the CDROM (sr0) unmount them from the filesystem with the "umount" command.
umount /mnt/sdb1
umount /mnt/sr0

Hope this documentation is complete, not confusing, and helpful to you.
I welcome your posts to make it better. Fred Finster
Description  Sample files for Lupu 5.20 menu.lst, usage.txt robsnotes.txt

Filename  menu.lst.tar.gz 
Filesize  1.8 KB 
Downloaded  325 Time(s) 
Back to top
View user's profile Send_private_message 

Joined: 07 Aug 2005
Posts: 4575
Location: Southeast Georgia, USA

PostPosted: Fri 24 Jun 2011, 17:07    Post_subject:
Sub_title: Terminal Emulation & Serial Port

Fred -

We should take this to a new thread - but I am using this because I did not see the usual links for E-mail associated with your avatar.

I am trying to access an Alinco DR-135TP from my old Panasonic CF-29 laptop - which has a serial port - now cabled to the rig.

I opened the Urxvt Terminal Emulator and power-cycled the rig - which should bring up ...

AX.25 Level 2 Version 2.0
Release 9/15/99 2Chip ver 2.00
Checksum $CF

... but nothing happens.

It has been years since I used a terminal emulator for BBS's and Packet so I have completely forgotten everything.

What, please, is the command to query the serial port?

I am guessing there may be a BIOS or cable problem causing the initial communications failure.

Thanks! & 73, doc KD4E

Thanks! David
Home page: http://nevils-station.com
Don't google Search! http://duckduckgo.com
Puppy Carolina 1.3 & Lighthouse64-b602
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0859s ][ Queries: 12 (0.0034s) ][ GZIP on ]