How to install Puppy/Dog distros on a GPT hard drive system.
As the Linux world moves ahead with GPT partitioning and GRUB2, Puppy/Dog people continue to use Grub4Dos and MBR drives with extended partitions. But there was a recent report from a multi-boot user where an Ubuntu upgrade corrupted an extended partition, leaving the other OS's unbootable.
The following instructions describe a hybrid system where your hard drive is structured as GPT. You can have many "primary" partitions without resorting to an extended partition. But it boots with legacy GRUB (not Grub4Dos) so you can continue to use your favourite menu.lst syntax. On large modern drives, the bootable partitions may need to be in the first 2TB. The rest of the drive could be used for data.
1. Since you are building your hard drive from scratch, you will need a Stretch/Buster Starter Kit bootable flash drive. Make it with the stretch-live-frugal-install tool. A Puppy bootable flash drive should also work. Install the PET version of Legacy GRUB into its setup.
2. Download the Legacy GRUB squashfs module from
here. Drop it into the "live" folder on your flash drive.
3. Boot off the flash drive. Find
Legacy GRUB Config 2019 in the System menu. Don't run it yet!
4a. Run Gparted and select the hard drive.
4b. Open the Device tab and create a new partition table. Select GPT.
5. Create your new partition structure. Partition #1 should be a small ext3 "boot" partition. It will have the GRUB Stage1 boot code on the MBR (GPT systems allow this because they don't use the first sector of the drive), a /boot/grub folder and the main menu.lst file. It can launch other OS's with the usual GRUB syntax or by chainloading.
Note: Legacy GRUB also works with ext4. But be aware of the "64bit ext4" issue created by other OS's that Legacy GRUB cannot handle. Gparted in the Starter Kit makes ext4 partitions with the "not 64bit" setting, so they are safe to use with Legacy GRUB.
If necessary, reboot off the flash drive so it is aware of the changes to the hard drive.
6. Run Legacy GRUB Config 2019 and set up your boot partition. Select GRUB Stage1 on the MBR (hd0) and Stage2 on sda1.
Note: In Legacy GRUB, drive and partition numbers both start at 0. So the Stage2 files on sda1 will have GRUB target (hd0,0).
Be aware that legacy GRUB Stage1 hard-codes the location of its Stage2 file. If you restructure your partition table, you may need to reinstall GRUB.
7. Install some Puppy/Dogs into other partitions. The Stretch-Live Frugal Install tool works for both. Paste the GRUB menu code that it generates into your menu.lst file in the boot partition.
8. Reboot off the hard drive and cross your fingers. Don't worry if you make a mistake - you can always erase the drive and start over. Or revert the drive back to an MS-DOS partition table.
9. Here is a variation. Assign a partition to hold a collection of Pup/Dog frugal installs. Collect the individual GRUB menu entries into one "combo" file and put it at the root of the partition. Boot it from sda1 using the "configfile" command:
Code: Select all
title Various Pup/Dogs on sda5
root (hd0,4)
configfile /combo-grubmenu.txt
Now your Puppy/Dog partition is self-contained.
10. But what about the big-boy Linuxes like Ubuntu? Their installers should let you put their GRUB2 bootloader on the installation's partition boot sector, where it won't interfere with your Legacy GRUB. Format the target partition as ext3 to avoid the potential "64bit ext4" issue. Set the mount point as "/". Then boot it from your primary GRUB menu by chainloading.
Code: Select all
title Ubuntu on sda7
root (hd0,6)
chainloader +1
11. If a big-boy Linux insists on booting off the MBR, you can use its 40_custom GRUB2 setup file to run your own Pup/Dogs.
Read
here for details.
Code: Select all
menuentry "Various Pup/Dogs on sda5"{
set root=(hd0,5)
legacy_configfile /combo-grubmenu.txt
}
Or better yet, put Legacy GRUB Stage1 on the Partition Boot Sector of the Pup/Dog partition using the GRUB target (hd0,x).
Boot it from GRUB2 with:
Code: Select all
menuentry "Various Pup/Dogs on sda5"{
set root=(hd0,5)
chainloader +1
}
12. Regarding Windows: If you have a pre-Win8 machine or a Win8+ machine in legacy mode, you can probably multi-boot it with Legacy GRUB. Put GRUB on the MBR and boot Windows from Linux with:
Code: Select all
title Windows
root (hd0,0)
chainloader +1
Or you can leave the DOS/Win MBR in place, flag a Linux partition as bootable and put GRUB stage1 on that partition's PBS.
Hint: To restore the original Windows MBR, use:
Code: Select all
apt-get install ms-sys
ms-sys -7 -w /dev/sda
---------------