Home Wiki > SDB:Live USB stick
Sign up | Login

SDB:Live USB stick

tagline: From openSUSE

This page explains how to create a bootable USB stick from a LiveDVD image file in a Linux system.

There are dedicated articles about how to Create a Live USB stick using Microsoft Windows™ and Create a Live USB stick using Mac OS X

Version: 12.2+This applies to openSUSE 12.2 and later.
Warning The instructions on this page will destroy all data currently on the USB stick being used. Please be certain it does not contain important information.
Warning Do not try to apply procedures found in internet for other distributions to convert the images into bootable sticks (unetbootin). Doing that will break the images. The openSUSE images are already prepared for being used directly on usb sticks, no further steps are needed.

Using SUSE Studio Image Writer

Download LiveCD ISO

Download the installation image of your choice from http://software.opensuse.org/.

Install ImageWriter

Install the SUSE Studio Image Writer by 1-Click Install

Write ISO to USB

Studioimagewriter root.png
  • Start SUSE Studio Imagewriter from the start menu.
  • The image writer needs root permissions. So enter the password for root when prompted.


Studioimgwriter 1.png
  • Open a file manager application.
  • Navigate in the file manager to the downloaded ISO file.


Studioimgwriter 2.png
  • Drag&Drop it to the Imagewriter


Studioimgwriter 3.png
  • Plug your USB memory device in your computer.
  • Select it from the dropdown menu at the bottom corner of Imagewriter.


Studioimgwriter 4.png Confirm overwriting your data on the USB device by clicking OK.


Studioimgwriter 5.png Writing the data takes a few minutes. After that your openSUSE bootable USB device is ready!

Using commandline tools

Download LiveCD ISO

Download the installation image of your choice from http://software.opensuse.org/.

Verify a download integrity:

~> gpg --recv-keys 9C800ACA
~> wget http://download.opensuse.org/distribution/12.2/iso/openSUSE-12.2-KDE-LiveCD-x86_64.iso.asc
~> gpg -a openSUSE-12.2-KDE-LiveCD-x86_64.iso.asc

Find Block Device

After inserting your USB stick, you can find out what device it is

~> su
# grep -Ff <(hwinfo --disk --short) <(hwinfo --usb --short)

Write ISO to USB

Finally, once you've found your block device, write the image to it. Point 'dd' to the full path such as '/home/user/Downloads/openSUSE-12.2-KDE-LiveCD-x86_64.iso' or change directory (example: cd ./Downloads) to where the image is contained.

# umount /dev/sdX
# dd if=/path/to/downloaded.iso of=/dev/sdX bs=4M

Optional steps

Live USB stick with persistent file system

To create a persistent file system on the usb stick give at the initial boot prompt the extra command:

kiwi_hybridpersistent=yes

Now an extra file system will be created so that data can be stored on the stick in a persistent way.

Note that this only makes sense if your USB stick is larger than 1 GB.

Put ISO on vfat partitioned USB stick or hard disk(Command line or GUI way)

If you'd rather not reformat the USB device and keep the ability of putting files on it and accessible by other operating systems, you have the option of using the live-fat-stick script from command line or live-usb-gui point and click graphical interface.

On openSUSE you can install the packages via 1-click from here live-fat-stick and live-usb-gui, if you are running any other distribution, get the script from here and make it executable(as root, with chmod +x /usr/bin/live-fat-stick) after copying it to /usr/bin/, make sure you have syslinux and gpart installed before running it.

Run the following as root (with su -, not using sudo) in terminal:

# live-fat-stick -l

to get the USB device path

# live-fat-stick --suse /path/to/openSUSE-filename.iso /dev/sdXY

to copy iso to USB device and make it bootable

# live-fat-stick -h

it shows help.

Multiple iso images from multiple distributions can be added to the USB device, boot menu will offer a choice of distribution to boot from. Scripts does not format or remove data from the device.

How to recover the USB stick for "normal" use again

After system installation, you may want to reuse the stick as you would normally to write things on it. In that case you have to reformat it. Often people complain that Windows fails to do it.

If you look at the 12.3 DVD image on a USB stick wit fdisk, you would see something like this (notice the GPT warning):

Telcontar:~ # fdisk -l /dev/sdf
·
WARNING: GPT (GUID Partition Table) detected on '/dev/sdf'! The util fdisk doesn't support GPT. Use GNU Parted.
·
·
Disk /dev/sdf: 7742 MB, 7742685184 bytes
64 heads, 32 sectors/track, 7384 cylinders, total 15122432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1bf0d4df
·
   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1            4248       12439        4096   ef  EFI (FAT-12/16/32)
/dev/sdf2   *       12440     9162751     4575156   17  Hidden HPFS/NTFS
Telcontar:~ # 


So, before reformatting, you have to repartition it again. And sometimes, if this fails, you may need an extra step - because software thinks the stick is a CD and thus not writeable:

Notice: all these intructions assume the stick device is /dev/sdX. You have to find which is yours (see “Find Block Device” section above). An error here will destroy some other disk in your system.

  # umount /dev/sdX
  # dd if=/dev/zero of=/dev/sdX count=100

That destroys the boot sector, partition table, and initial structures. Any operating system should be happy to reformat it again.

But typically, you would simply start fdisk:

  # fdisk /dev/sdX

and select:

  o   create a new empty DOS partition table

and then:

  n   add a new partition

(primary, number 1, default size to use the entire device)

  t   change a partition's system id

Use type 6, FAT16

  w   write table to disk and exit

Finally:

  # mkfs.msdos -n SOME_NAME /dev/sdX1

And done. Or, you could use gparted for partitioning and formatting.

You could, if you prefer, make a backup image of the stick prior to using it for installation, with dd, and recover it after the installation.

Troubleshooting

How to make a USB drive bootable

This situation would happen very rarely, but in the even that your computer doesn't boot from the LiveUSB/DVD from the steps above, you might try the following procedure.

Linux fdisk

Open a console and do the following as root

# umount /dev/sdX
# fdisk /dev/sdX
: p   «--- print partition table
: a   «--- activate partition (bootable)
: 1   «--- apply to partition 1
: w   «--- write changes and exit

See also

External links