Wednesday 20 March 2013

Live Once!

It used to be pain to create bootable media (CD and USB) that would contain a standalone OS. Whilst this is somewhat (very) old news here's a quick primer for creating a Fedora bootable USB stick.

Fedora provides a tutorial that goes into the details but the headline items are:
  • grab a Fedora live desktop image

    you may want to grab a i686 image (something like a Fedora 15 i686 image) over the new x64 images to increase the chances that you may use the same USB media to boot all x86 machines you encounter

  • grab a (1GB minimum) USB stick

    if you attend any conferences for work there's almost always someone handing out USB sticks

  • run liveusb-creator --reset-mbr

    select the desktop image to use and wait. Notice that without the additional flags some BIOS/USB devices freeze on boot with "invalid system disk" or something similar

The one thing that changed from the past is that the Live Fedora image is simply written to the USB disk's same partition (most USB media only has one partition) and you may continue to use the USB disk for storage.

An entirely command line interface is provided by the Fedora livecd-tools package:
# find the USB device name
$ lsblk | less +/disk
sda                  8:0    0   149G  0 disk 
├─sda1               8:1    0  94.1M  0 part 
├─sda2               8:2    0   9.8G  0 part 
└─sda3               8:3    0 139.1G  0 part 
sdb                  8:16   0   1.4T  0 disk 
├─sdb1               8:17   0     1K  0 part 
├─sdb7               8:23   0 964.8M  0 part /boot
├─sdb8               8:24   0   128M  0 part 
└─sdb9               8:25   0 185.2G  0 part 
  ├─vg-lv_root     253:0    0     1G  0 lvm  /
  ├─vg-lv-swap     253:1    0     1G  0 lvm  [SWAP]
  ├─vg-lv_usr      253:2    0    24G  0 lvm  /usr
  ├─vg-lv_export   253:3    0 148.3G  0 lvm  /export
  ├─vg-lv_tmp      253:4    0     1G  0 lvm  /tmp
  └─vg-lv_var      253:5    0     2G  0 lvm  /var
sdd                  8:48   1   1.9G  0 disk 
└─sdd1               8:49   1   1.9G  0 part /run/media/ray/LIVE
sr0                 11:0    1  1024M  0 rom

# unmount the USB device and write image
$ umount /dev/sdd1
$ livecd-iso-to-disk --reset-mbr  \
    /var/tmp/Fedora-Live-Desktop-x86_64-24-1.iso \
    /dev/sdd1
And the old fashioned way:
$ umount /dev/sdd1
$ dd if=/var/tmp/Fedora-Live-Desktop-x86_64-24-1.iso \
    of=/dev/sdd1 \
    bs=8M \
    status=progress \
    oflag=direct

Fedora's Howto link

No comments:

Post a Comment