Boot ISO from USB Stick

Many Linux distribution builders like Devuan and Debian produce hybrid ISO image that work on discs and USB sticks. You can make bootable USB sticks by simply copying the image to the USB device with this command

dd if=isoimage of=/dev/sdX bs=10240

You can find the device name (X) by looking into dmesg oder lsscsi, and looking for newly plugged scsi/block devices.

But some companies still don’t know about hybrid images and provide ISO images the need to be on disk. (like samsung SSD updater).

Workarround: You can use SysLinux to make an USB stick that can boot an ISO image

Install SysLinux using standard procedures, in my case: aptitude install syslinux (currently 3:6.03-dfsg-5-deb8u1)

Do the following steps:

  1. (optional) wipe the USB stick:  dd if=/dev/zero of=/dev/sdX
  2. make a bootable vfat partition: eg with fdisk /dev/sdX  (“n”), set the partition type to VFAT (“t” “c”) and make it active (“a”)
  3. format the partition to vfat: mkfs.vfat /dev/sdX1
  4. install SysLinux on it: syslinux /dev/sdX1
  5. mount the newly created partition: mount /dev/sdX1 /mnt/usb
  6. copy the memdisk feature to syslinux: cp /usr/lib/syslinux/memdisk /mnt/usb/
  7. make a syslinux.cfg file on the USB stick: vi /mnt/usb/syslinux.cfg
    LABEL iso
        LINUX memdisk
        INITRD image.iso
        APPEND iso
  8. copy the iso image to the usbstick: cp isoimage.iso /mnt/usb/image.iso
  9. unmount the USB strick: umount /mnt/usb

You can even put different ISO images to one stick by copying multiple ISO images and making multiple entries in syslinux.cfg.

USB SCSI Disconnects when Idle

Problem: An external USB harddrive disconnects and immediately reconnects with different device name. You find log entries like these:

Jan 17 00:46:52 workstation kernel: [212306.086568] sd 33:0:0:0: [sdj] Attached SCSI disk
Jan 17 01:51:14 workstation kernel: [216168.064075] usb 2-4: USB disconnect, device number 11
Jan 17 01:51:15 workstation kernel: [216168.596514] usb 2-4: new SuperSpeed USB device number 12 using xhci_hcd
Jan 17 01:51:16 workstation kernel: [216169.613657] sd 34:0:0:0: Attached scsi generic sg7 type 0
Jan 17 01:51:51 workstation kernel: [216169.616792] sd 34:0:0:0: [sdg] Spinning up disk........
Jan 17 01:51:52 workstation kernel: [216205.941531] sd 34:0:0:0: [sdg] Attached SCSI disk

This happens especially when the drive is idle.

Solution: This seems to be related to the SCSI standby feature which is enabled on new drives per default. You can disable this “feature” with:

sdparm -S -c STANDBY /dev/sdg

“-c STANDBY” clear STANDBY flag.
“-S” save for next power cycle
“/dev/sdg” device name of the usb harddrive

Tested with: Debian 7.0, WD Elements USB 3.0 harddisk.