While Pup/Dog people continue to use Grub4Dos and MBR drives, the mainstream Linux world has moved ahead with GPT partitioning and GRUB2.
The following instructions describe a system where your hard drive is structured as GPT. You can have many "primary" partitions without resorting to an extended partition. The bootloader is GRUB2, which gives you the most flexibility.
Note: This discussion only applies to regular BIOS-based machines. It does NOT apply to Win8+ UEFI-based machines. Linux on UEFI uses the GRUB2 bootloader as part of its EFI package and the hard drive will probably be GPT. See the discussion below.
1. Because the Starter Kit ISO does not contain GRUB2, you will need to get it separately. You can download a squashfs module from here or build your own module from the Debian package "grub2" using apt2sfs.
2. Since you are building the target hard drive from scratch (and erasing all old content), you will need a bootable flash drive. Copy the GRUB2 module and the Deblive Multi Installer onto the drive.
3. Boot the target system off the flash drive.
4a. Run Gparted and select the hard drive.
4b. Open the Device tab and create a new partition table. Select GPT.
4c. If necessary, reboot now off the flash drive so your system is aware of the changes to the hard drive.
5a. Create your new partition structure. Partition #1 should be a small (2GB) 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) and a /boot/grub folder with the Stage2 content. Your grub.cfg file will eventually go here.
5b. Create more partitions to hold your OS installs and other data. You don't need to completely partition the drive now - you can leave empty space on the drive and partition it in the future as needed.
6a. Right-click on the GRUB2 squashfs module and activate it.
6b. Run the Multi Installer and open the GRUB2 section. Select the Stage1 target as "sda" and the Stage2 partition as "sda1".
6c. Click Install.
7. Install some Dogs/Pups into other partitions - the Installer works for both. Paste the grubmenu.txt boot code it into the grub.cfg file in /boot/grub.
8. Reboot off the hard drive.
9. Here is a variation. Assign a partition to hold a collection of Pup/Dog installs. Collect the individual GRUB2 menu entries into one "combo" file and put it at the root of the partition. Boot it from sda1 using the "configfile" command. Note that in GRUB2, partitions are numbered starting at 1. For example:
Code: Select all
menuentry "Various installs on sda5" {
set root=(hd0,5)
configfile /combo-grub.cfg
}
Now your Pup/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 own 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
menuentry "Ubuntu on sda7" {
set root=(hd0,7)
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 using the method from Step 9 above. Read here for details.
Update: Instead of using the internal 40_custom GRUB file, you may be able to use the external file /boot/grub/custom.cfg
12. If a big-boy Linux blows away your own GRUB, you can sometimes take back control by booting off a flash drive and reinstalling GRUB. Then boot the big-boy Linux with a menu entry like:
Code: Select all
menuentry "Mint 19 on sda3" {
set root=(hd0,3)
linux /vmlinuz root=/dev/sda3
initrd /initrd.img
}
or
Code: Select all
menuentry "MX on sda6" {
set root=(hd0,6)
configfile /boot/grub/grub.cfg
}
or the "traditional" full-install syntax:
Code: Select all
menuentry "Salix on sda5" {
set root=(hd0,5)
linux /boot/vmlinuz root=/dev/sda5 ro vga=normal
}
13. Regarding Windows: If you have a pre-Win8 machine or a Win8+ machine in legacy mode, you can probably multi-boot it with GRUB2. The safest way is to leave the DOS/Win MBR in place, flag a Linux partition as bootable in Gparted and put GRUB2 on that partition's PBS. Make the Stage1 target "sdax" and the Stage2 partition "sdax". Then boot Windows from the GRUB2 menu by chainloading. Adjust the partition number as required:
Code: Select all
menuentry "Windows" {
set root=(hd0,1)
chainloader +1
}
Hint: If necessary, you can restore a Windows MBR with:
Code: Select all
apt-get install ms-sys
ms-sys -7 -w /dev/sda
---------------