Twitter Updates

    follow me on Twitter

    G-AVLN in front of her home

    G-AVLN in front of her home

    Mostly Unix and Linux topics. But flying might get a mention too.

    Tuesday, June 04, 2013

    Using CentOS to create a bootable USB with persistent storage


    Using the good old and trusted dd tool we can easily create a simple bootable USB pen drive. Such a device would be perfectly adequate for an ad hoc work. However, this method doesn't allow to save any data or persistently modify configuration of the operating system.

    To save changes, we need to create a bootable disk, but also create and configure alongside it a partition that is writeable. In the past that required laborious and long-winded process - massive essays have been written explaining the procedure. No need for that complexity now - a program to do the heavy duty work for us has now been available for a while.

    This write up shows how to use such a tool in RHEL 6.2, or any of its derivatives (CentOS or Scientific Linux). It should also work in Fedora, although I haven't tested it there...

    First, we need to download (or otherwise obtain) two bits of software:

    (a) an up to date EPEL(*) package; go to: http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html and download: epel-release-6-8.noarch.rpm (or whichever is the latest version).

    Then install it:
    # rpm -ihV epel-release-6-8.noarch.rpm

    (b) a distribution ISO file; mine is called CentOS-6.2-i386-LiveCD.iso

    Now install tools for creating a bootable pendrive (it will use the EPEL repository):
    # yum install livecd-tools syslinux

    Prepare the USB pendrive: insert, identify partition then un-mount it:
    # df
    # umount /dev/sdX1

    Mark partition as bootable:
    # parted /dev/sdX
    [parted] toggle 1 boot
    [parted] quit

    Finally, run the install script:
    # livecd-iso-to-disk --home-size-mb 500 CentOS-6.2-i386-LiveCD.iso /dev/sdX1

    (*) EPEL package gives access to programs not directly supported by Red Hat (or its derivatives). Even if you already have EPEL package installed, before you start, update it (to avoid potential conflicts with older versions). If later on you get error messages “Requires: python(abi) = 2.4 Installed: python-2.6.6-29.el6.i686 “ it means you are using a wrong EPEL version.

    No comments:

    Blog Archive