[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian images and USB sticks



On Wed 04 May 2016 at 23:56:56 -0300, Renato Bispo wrote:

> Very interesting, Thomas. I'm writing this e-mail from the Debian system
> I've installed using the method you described in detail. The only
> difference is that I used cp instead of dd. My USB stick has now 3
> partitions, two of them reserved for images and the other one for regular
> use. I included a README in the stick that describes in a very general way
> the steps taken to make it work, for future reference in the case I need
> it. I will include it here, for it might be useful to someone else:
> 
> Preparing a USB stick to boot Debian: *
> 
> 1. lsblk to find out device number.
> > 2. Unmount device.
> > 3. Wipe filesystem signatures if there was an image written to the stick.
> > 4. Partition USB stick with parted (don't forget the boot flag).
> > 5. Create the filesystems.
> > 6. Download .iso.
> > 7. Copy .iso (to preserve the original one).
> > 8. isohybrid --partok copied .iso.
> > 9. As root, cp "partoked".iso /dev/sdXY && sync.
> > 10. Reboot and select the USB stick to boot.
> 
> * Under BIOS at least

An interesting technique. Without parted and --partok an alternative is:

   1. lsblk to find device number.

   2. Unmount device if mounted.

   3. Wipe filesystem signatures if there was an image written to the
      stick:

	dd if=/dev/zero of=/dev/sdX count=10000

   4. Partition USB stick with fdisk/cfdisk. (Boot flag not needed). One
      partiton big enough for GRUB's files; one big enough to hold the
      ISO.

   5. Create a filesystem on the first partition.

   6. Mount the first partition:

	pmount sdX1

   6. Install GRUB to the MBR of the stick:

	grub-install --boot-directory=/media/sdX1 /dev/sdX

   7. Write a grub.cfg in /media/sdX1/grub:

	menuentry "Debian 8.0.0 i386 netinst with firmware" {
	search --label --set=root "Debian 8.0.0 i386 1"
	linux /install.386/vmlinuz
	initrd /install.386/initrd.gz
	}

   8. Put ISO on second partition;

	cat ISO > /dev/sdX2

   9. Create more partitions for more ISOs.   

  10. Reboot and select ISO to boot.

Steps 3, 4, 5, 6 and 8 would require root on Jessie. The ISOs do not
have to be isohybrids.

I would see neither technique as superior or easier than the way
recommended in the manual for booting a Debian ISO, but both do allow
multiple Debian (or other) ISOs on a single USB stick. A disadvantage is
the possible juggling with partition space when one ISO needs to be
replaced with a more recent one.

Regards,

Brian.


Reply to: