Using gparted to Prepare a USB-Key for Puppy

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 2821
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 852 times

Using gparted to Prepare a USB-Key for Puppy

Post by mikeslr »

Preparing a USB-Key is NOT NECESSARY if you use either of the following two companion applications which are available with FrugalPup, viewtopic.php?f=105&t=337. Those applications are:
StickPup, the simplest and most restricted installer, that formats and installs a single Puppy to a usb stick, in a single fat32 partition.
f2StickPup, Formats and installs a single Puppy to a usb stick, in a small fat32 partition and a large Linux f2fs partition.
However, I have no experience with f2fs formatting and don't recall (m)any posts by those employing it. There being several advantages in not running Puppies from a fat32, so caution suggests that Linux formatting be used. And for that you have to format the USB-Key.

If I've gotten it right (frugalpup-installer is still new to me) it is generally recommended that you initiate Menu>Setup>FrugalPup - Puppy frugal installer, then click the "Puppy" Button. This module does not perform any formatting. Consequently, the following information remains useful. See in particular Step 9.

Most of the following information about gparted will also be applicable to restructuring hard-drives. A word of caution about hard-drives. All the computers which came with Windows 7 or above that I've worked with employed msdos partitioning which only permits 4 primary partitions; and Windows, itself, uses 3: a small boot partition; a Recovery Partition of about 10 Gbs, and the balance of the drive -- now usually 500 Gbs or greater-- holding the operating system, applications and space for your datafiles. That large partition may either be the 2nd or 3rd. To create a Linux partition for your Puppy [or any Linux OS] you will want to resize the large partition, shrinking it so that you have "unallocated space". Use the applications built-into Windows to do that. You may want to defrag before resizing. Before allowing gparted to reformat the now "unallocated" space, make certain it is the "unallocated" space. That operating is not reversible.

Once you have one functioning Puppy it is easy to create a Frugal Install of any Puppy on a USB-Key. Don’t be put off by the length of this post and the short posts whose links are at the bottom. Doing it takes less than 15 Easy Steps and less than 5 minutes (not counting the time gparted takes to format partitions while you 'twiddle-your-thumbs' :lol: ].

The first of the two linked posts is about placing your choice of Puppy on the USB-Key; the second installing a bootloader.

This post, the longest, explains the choices you can --but may not have to-- make in structuring the Key and how to use gparted.

The first things you may be doing is re-structuring the Key. ‘Factory-Fresh’, it probably has only ONE partition which has been formatted Fat32. As-Is, that is OK provided that you do not intend to use a SaveFolder to preserve changes. SaveFolders are recommended as they have no fixed size. They will expand to the available space on their partition as and when you install applications or place datafiles in them. But SaveFolders require Linux Formatted partitions. A SaveFile can do the same things as a SaveFolder, and can happily exist on a Fat32 (even an NTFS) partition. But having a fixed size you have to estimate* how large you want to make it. It can later be increased, but not decreased. Increasing requires a reboot. A Linux formatted partition is also generally required if you plan to compile applications or engage in some other uniquely ‘Linux stuff’. These can be done in RAM; but you’ll then need a lot of RAM.

On the other hand, UEFI computers require that bootloaders be on a Fat32 partition and that partition be the first. Windows can not natively read Linux partitions. There are program you can install which will enable Windows to. But Puppies run without anti-malware and I don’t want Windows accessing Linux partitions for that and another reason: Windows, 10 especially, is known for automatically ‘fixing’ partitions it doesn’t entirely like. I don’t mind Windows doing a malware scan on a 2nd Fat32 partition. If it can’t read the first partition, Windows will offer to format it. After the 1st, if Windows sees a Partition it can’t read, it stops looking. So, you can’t place a Fat32 partition after a Linux partition. That’ OK by me.

You can probably ‘have your cake and eat it, too’ with only two partitions: (1) a first Fat32 large enough for a bootloader and (if you want) to hold files being transferred to a Windows computer; and (2) the rest a Linux partition. But I opt for three: (1) a first Fat32 partition of about 75 Mbs to hold bootloader(s); (2) a Second Fat32 partition large enough to hold any files I may later want to transfer, between 1 to 2 Gbs; and (3) the rest, the 3rd, formatted as Linux. That arrangement means that I won’t accidentally screw-up the 1st =boot partition. Once it’s been written, it’s left alone.

Which Linux? Linux Ext2, Ext3 or Ext4? See https://www.thegeekstuff.com/2011/05/ext2-ext3-ext4/ for their primary differences. Ext2 uses the least resources. Although some Puppy fans have reported that they have never had a problem with Ext2, others have suggested that files, including SaveFiles, are more likely to become corrupted (as examples, during a power-surge or outage while Saving or trying to save a file larger than the available space) when Linux Ext2 format rather than Ext3 or 4 was used. Journaling reduces that possibility but requires more writes. It was estimated that USB-Keys would be corrupted by 100,000 writes. This may seem a large number [especially because you can setup Puppy to NEVER write] but if you do configure an application to write directly to the Key some, such as word-processors, will generate a Write whenever you save changes to a datafile, and others will write to the Key automatically whenever you press a key on your keyboard. That estimate, however, was made with early versions of USB-Keys. They have since improved considerably. Still, journaling itself writes to the media and Ext4, in layman’s terms, writes 2 journals whereas Ext3 writes only one. For Hard-drives I use Ext4; but for USB-Keys Ext3. Others may differ. But my guess is that using Ext3 I’m more likely to loose the Key than have it become corrupted.

If you’ve decided to live without any Linux partitions, you can skip this section which deals with:

Using Gparted to partition your USB-Key:

Boot into your running Puppy. Puppy using JWM and some other Window Managers will display desktop-drive icons which were assigned labels. Puppy assigns labels sequentially. If before plugging in the Key your desktop-drive icon were all sdaXs (where Xs are numbers beginning with the number 1), the Key you plug in will be labeled sdb1. If you started with 2 hard-drives, or one hard-drive and an already plugged in USB-Key, there would have been both sdaXs and sdbXs and the New Key would be assigned sdc1. For this illustration, we’ll assume Puppy assigned the Key you want to partition the label sdd1 and that you want the USB-Key to have three partitions: an initial small Fat32 partition to hold boot-loaders and their associated files; a 2nd Fat32 partition to use for transferring files to & from a Windows Computer; and the rest of the USB-Key formatted as Linux Ext3.

[If your Window-manager does not display desktop-drive icons, you could run Menu>filesystem>pmount or partview or even Menu>System>gparted twice (once before plugging in the new Key) to be certain that the device you alter is the device you want to alter].

Step 1: Plug in the USB-Key you intend to re-partition and note the label of the desktop-drive icon(s) which have been added. If it is mounted, Right-Click it and select Unmount. Gparted can not work with mounted drives.

Step 2: Open Menu>System>Gparted Partition Manager. Select the USB-Key by the label noted in Step 1, here assumed to be sdd.

[Note. I wanted to use “Resize”; but gparted would only allow “shrinking” to several hundred Mbs if I would accept Fat16 formatting. I wouldn’t so] I

Step 3: Left-Clicked Device>Create Partition Table>msdos and Clicked Apply. A Warning that this will erase all data on the Disk appeared and I, again, clicked Apply. When gparted finished this operation all the space on my entire USB-Key was UNALLOCATED. A line in the Middle-Panel showed that condition.

Image

Step 4. Right-Clicking that Line, I selected New, and in the GUI which appeared, gave it the following settings: Primary Partiiton, New Size 75 Mbs, File system fat32, Label Boot; then clicked Add. [Before configuring the other patitions, having had the size problem mentioned in Step 2, I clicked Apply in the Tool-bar near the Top of the GUI to make certain it would ‘take’].
Image
Step 5. When gparted finished it displayed two lines, a First fat32 partition labeled “Boot” using 75 Mbs and, below that, the balance of the drive space Unallocated.
Image
Step 6: Right-Click the Unallocated space, and repeat the process in Step 4, except that I now gave it the following settings: Primary Partition, New Size 1500 Mbs, File system fat32, Label Transfer.
Image
Step 7. Repeat Step 4, using the entire Unallocated space remaining, which I now gave the following Settings: Primary Partition, File system Ext3, Label Linux. Only after completing these settings did I Click Apply in the Tool-bar near the Top of the GUI.
Image
Step 8. RIGHT-Click the 1st Line, now labeled Boot, and from the popup-menu selected Manage Flags. In the GUI which opened, placed a check-mark in the ‘boot’ box. Then exited gparted.
Image
Puppy’s JWM window-manager re-read the structure of sdd, and displayed three desktop-drive icons, sdd1, sdd2 and sdd3, one for each of the partitions.
Step 9: (Optional - Recommended) Puppy's System files can be located either at the root of a partition or in a folder one-level-deep. Placing them in a folder is recommended: makes it easier to keep track of what's going on and makes it much easier to add additional Puppies. Grub4dos will not create that folder. Some FrugalPup modules may offer to create a folder if one isn't present but will enable you to select it if it already exists. I prefer the latter, maybe because if I create one using rox I can see it and (a) I know it's there; and (b) I know that I actually typed the name I wanted correctly. So, once gparted has exited and Puppy has displayed the USB-Key with its new partitions, I
Left-Clicked sdd3 -- to mount/open it.
Right-Clicked an Empty space, and from the Pop-up Menu, Selected New>Directory and typed in the name I wanted. Before Left-Clicking the partition again (to unmount it) I double-Check that the desired name was spelled correctly.

FYI: msdos was selected for the Table structure, I can only support 4 primary partitions. This is not the place to discuss the pros and cons of using Extended and Logical paritions.
Not all bootloaders and operating systems require that the Boot partition be 'flagged' boot. But enough do that it's just easier to always set the 'boot flag' than try to memorize which do and which don't.

Link to "Manually Installing Puppy" viewtopic.php?p=1788#p1788
Link to "Installing Bootloader" to be added

-=-==-=-=-=-=-=--
Estimating the size for a SaveFile: There'll be a post about 'How to Keep your Save File Small & Secure'. In the meantime, as a Newbie, I'd suggest 1 Gb.
Post Reply

Return to “Beginners Help”