Can I install Puppy on HDD but boot from USB thumbdrive?

Booting, installing, newbie
Post Reply
Message
Author
mwnorman
Posts: 2
Joined: Sat 21 Aug 2010, 09:29

Can I install Puppy on HDD but boot from USB thumbdrive?

#1 Post by mwnorman »

In the 'Beginners Guide to Installing Puppy Linux', the various combinations
are described. One (older) option is to boot from floppy but have everything
else on a hard drive partition.

Is it possible to update that option to:
- boot from a USB thumbdrive
- have everything else on a hard drive partition
(not just User data, but the actual distribution ...)


Any advice would be welcome

Mike

noryb009
Posts: 634
Joined: Sat 20 Mar 2010, 22:28

#2 Post by noryb009 »

Greek: I'm pretty sure you can put GRUB on the USB, then route the boot to the partition.

English: Just google "install GRUB on USB", then open gParted (in the menu). Select your USB, right click it, and select "flags". Make sure the "boot" flag is checked and click OK. Once you are done, post a reply to this.
Last edited by noryb009 on Sat 21 Aug 2010, 18:22, edited 1 time in total.

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#3 Post by rjbrewer »

If you install puppy to a partition using the universal installer,
one of the boot options is "usb". This is nice, as you wouldn't
have to use or modify a bootloader on a drive.
Floppy, zip, etc. will work too, depending on the computer.

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

mwnorman
Posts: 2
Joined: Sat 21 Aug 2010, 09:29

thanks, will give it a try ...

#4 Post by mwnorman »

Thank you rjbrewer and noryb009 - I will give the 'usb' boot option a try

Mike

User avatar
DanYHKim
Posts: 103
Joined: Mon 15 Sep 2008, 01:51

Boot USB to HDD system

#5 Post by DanYHKim »

Boot from USB to HDD System

You can boot up your computer from a USB Flash drive containing Grub with the OS on a hard drive. This is useful for creating a secret installation that is normally un-bootable.

Summary:
Put the files to load your OS onto the hard drive. For a Puppy Linux frugal installation, this would be vmlinuz and initrd.gz. This doesn't seem to work from a NTFS-formatted disk, but will work from a FAT32 or ext2 or ext3 partition. Install Grub to a USB Flash drive that has been formatted ext2 and made bootable. The menu.lst file will need to be adjusted.

Steps:
  1. Boot your computer to Puppy
  2. Create a hard disk partition formatted FAT32, ext2 or ext3 to hold your system files.
  3. If the boot partition of the drive is NTFS, and normally loads Windows, you can put your Linux files into a non-boot ext2 partition. Windows will not mount or display the ext2 partition, except in the Disk Management utility, so it is essentially hidden.
  4. Copy your Linux system onto the new partition by copying vmlinuz, initrd.gz and pupsave.2fs (if it exists) from the Puppy CD or other medium onto the new partition.
  5. Insert a USB Flash drive and format it ext2 using Gparted. Flag as bootable.
  6. Install Grub to the Master Boot Record of the USB drive, using the installer in Puppy.
  7. Edit the Grub menu.lst file
The Grub installer seems to detect all available partitions and creates a section in the menu.lst file to boot to them. It conveniently adds the correct commands, but the drive designations may be wrong. This is because the USB drive you are using will be the primary boot disk when you boot to it later, but is not the primary boot disk while Grub is being set up.

Edit the /boot/grub/menu.lst file in the USB drive:

If you have a Puppy system on the USB drive itself, and want the option to boot to this system, remember that the Flash drive will be the primary boot device. It will need be designated as (hd0,0), but menu.lst probably calls it (hd1,0) now, so change the root (hd1,0) line to root (hd0,0).

Grub doesn't automatically call the initrd.gz file, so add the line:
initrd /initrd.gz (assuming the initrd.gz is in root of this drive)

Similarly, adjust the path for the kernel, which Grub usually assumes is in /boot/vmlinuz, but I have it in /vmlinuz.

If you have a Puppy system on the local HDD, and want to load it, you will need to know if it is on the first, second or other partition on the drive. Make a "Linux bootable partition config" section to designate

If you have other partitions with installed OS, Grub will have also added "Other bootable partition config" sections. In menu.lst that points to root as (hd1,0). Since the HDD is not the primary boot device, it won't be (hd0,0). If Puppy lives on the second partition, then set root as (hd1,1) and so on.

If you have partitions with a version of Windows installed, they can be launched by making an "Other bootable partition config" section that uses "rootnoverify (hd1,0)" etc to load it. You can probably just alter the "Other bootable partition config" sections that already exist in your menu.lst file.

Sometimes, the Windows boot.ini file doesn't like this, if the Windows installation is not on the first HDD partition. You may need to change the partition number in the boot.ini to get this to work.

So, now you can have OS installations on non-booting HDD partitions, and load them using the Grub bootloader. You can configure a PC to launch Windows from its own bootable HDD partition in a normal way, but boot to other OS installations with your USB Flash drive's bootloader. It's like being a secret agent!

Take a look at the attached menu.lst file. It may explain things better than my description.

User avatar
DanYHKim
Posts: 103
Joined: Mon 15 Sep 2008, 01:51

Boot from USB Flash Grub bootloader using HDD system

#6 Post by DanYHKim »

OK, I don't know how to correctly attach a file, so I'll list its contents here. I hope that's OK

Code: Select all

# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'.  Mon Aug 23 15:39:11 2010
#
# The backup copy of the MBR for drive '/dev/sdb' is
# here '/boot/grub/mbr.sdb.22256'.  You can restore it like this.
# dd if=/boot/grub/mbr.sdb.22256 of=/dev/sdb bs=512 count=1
#
# Start GRUB global section
timeout 10
color light-gray/blue black/light-gray
# End GRUB global section

# Other bootable partition config begins
  title Windows on First HDD Partition (on /dev/sdb1)
  rootnoverify (hd1,0)
  makeactive
  chainloader +1
# Other bootable partition config ends

# Other bootable partition config begins
  title Windows on Second HDD Partition (on /dev/sdb2)
  map (hd1,0) (hd1,1)
  map (hd1,1) (hd1,0)
  rootnoverify (hd1,1)
  makeactive
  chainloader +1
# Other bootable partition config ends

# Linux bootable partition config begins
  title Lucid Pup 5.0.1 (on this USB drive)
  root (hd0,0)
  kernel /vmlinuz
  initrd /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 (hd1,0)
setup (fd0)
pause Press enter to continue.
title Install GRUB to Linux partition (on /dev/sdb1)
root (hd1,0)
setup (hd1,0)
pause Press enter to continue.
title -     For help press 'c', then type: 'help'
root (hd0)
title -     For usage examples, type: 'cat /boot/grub/usage.txt'
root (hd0)

Newcrest
Posts: 199
Joined: Sun 04 Mar 2007, 03:19

Re: Boot USB to HDD system

#7 Post by Newcrest »

DanYHKim wrote: Put the files to load your OS onto the hard drive. For a Puppy Linux frugal installation, this would be vmlinuz and initrd.gz. This doesn't seem to work from a NTFS-formatted disk, but will work from a FAT32 or ext2 or ext3 partition.
Nice post! I'd just like to add that it works for NTFS-formatted partitions as long as they are not badly fragmented. If you make sure that the Puppy sfs files are contiguous then there are no problems.

User avatar
DanYHKim
Posts: 103
Joined: Mon 15 Sep 2008, 01:51

Maybe a problem with Windows

#8 Post by DanYHKim »

I just tried this out on a machine for which I had made drive image files using Driveimage XML

I imposed a Windows XP and a Windows 7 image onto two different partitions on this machine, and tried to get them to boot from a Grub-bootable USB drive. I had errors related to missing "NTLDR" and "NTDETECT.COM" files for Windows XP and missing "BOOTLDR" in Windows 7. In addition, I forgot that the BOOT.INI file refers to partition numbers starting with "1" instead of "0", so I messed up the alterations to BOOT.INI.

I had to copy NTLDR and NTDETECT.COM from another Windows XP machine. Eventually, I got the Windows XP part to work. I'll see if I can get the Windows 7 system to load tomorrow.

User avatar
DanYHKim
Posts: 103
Joined: Mon 15 Sep 2008, 01:51

It just keeps getting worse

#9 Post by DanYHKim »

OK, it's simple if all I want to do is run Puppy from somewhere on a machine that is otherwise using Windows. Without the Flash drive, the HDD bootloader will go and boot up Windows.

My problems with this were probably a result of dropping a Driveimage XML disk image into a blank partition that was not the first one, and then trying to run it. As reported before, I had to copy NTLDR and NTDETECT.COM to the drive partition with Windows XP and also mess with BOOT.INI

Worse problems with Windows 7, which was also restored from a Driveimage XML image. Windows 7 has, instead of a plain text BOOT.INI file, some other thing called BCD. This is a binary file, and so must be edited using the MS commandline utility bcdedit.exe, which is a pain.

Oh! There's a free program called EasyBCD that will do this. It's a 32-bit Windows program, and it can be run from a Windows XP environment, it turns out. I installed this to a USB drive and then ran it from within the XP bootup, then had it pull up the BCD from the partition running Windows 7.

Then changed the default boot drive designated by the BCD to D:, which is where Win7 lives.

OK, now I can boot the PC using a GRUB-loaded USB drive and choose Windows 7 from the menu.lst menu, and it goes.

More trouble when I try making it a member of a domain, though

Ach!

Well, as I said, I am making more trouble for myself by having this setup:

Boot to HDD using GRUB in a small ext2 boot partition (hd0,0)
Grub then launches Windows XP on the next NTFS partition (hd0,1)
If I boot to a bootable ext2 USB drive with GRUB, I can have the option to boot up:

- Puppy on the USB drive
- Windows XP on the second HDD partition (NTFS)
- Windows 7 on the fourth HDD partition (NTFS)

Both of the Windows installs were done previously and then saved as images, then restored to their respective non-first-partition locations afterwards, necessitating restoration of NTLDR and NTDETECT.COM and editing BOOT.INI or BCD in Windows 7

So, I am doing this the REALLY, REALLY HARD WAY

Still, it's fun, and I've learned a lot. If only I could remember all the steps . . . .

Extra-special tip: When I put the Windows system on a domain, it's OK, but booting to the other Windows system won't work on the same domain:

Yes, that's another headache. I think it's because both systems have the same network name, and so one is invalidated when the other is added.

So, I am naming the two Windows systems differently, and then registering them to the domain server. This might work.

=== OK, it doesn't work. I'm giving up on this, and just having the XP system on the domain. The Windows 7 system can fend for itself.

ALSO: The whole idea was to have the Windows 7 setup as a "secret" boot option only available when I use a USB Flash GRUB-loading drive on boot. So, I don't want the HDD-booting Windows XP system to be able to access the partition hosting the Windows 7 system. It turns out, the Windows XP Disk Manager can be told to remove the drive letter designation from a partition. When this is done, it won't show up in Windows Explorer, etc.

OK, most of this is probably not interesting to anyone else here, but I hope some of it comes in handy.

User avatar
DanYHKim
Posts: 103
Joined: Mon 15 Sep 2008, 01:51

Spoke too soon. I'm good for domains

#10 Post by DanYHKim »

Forget what I said about not being able to register both systems on our domain. It turns out that I lost count of how many times I rebooted to which login, or something.

So, the machine will allow a domain login for both Windows systems with booting from either the HDD (for Windows XP) or the USB Flash drive with Grub to start up the Windows 7 system living on a partition on the HDD.

This took forever to figure out. I hope it works twice.

I'll have to look over my notes and my posts to this thread and make up a more coherent description, for my own reference at least.

Thanks for your patience.

Post Reply