06 December 2009

Installing Fedora 11, 10 or 9 From USB Stick

To install Fedora 11, please follow the instructions given for Fedora 10 below but make sure the bootable partition is slightly bigger because the net install iso on Fedora 11 is bigger than the one in Fedora 10. I gave the bootable partition 512 megs and it worked perfectly.

The aim of this post is to explain how to install Fedora directly from a USB stick containing the Fedora*-DVD.iso image. For those impatient, just go to the Instructions section.

It’s been almost 2 years since I said goodbye to Windows and moved my work laptop to Fedora, and I couldn’t be happier with the move. If you wanna find out why I’m happier with Fedora, just carry on reading my blog over the coming months. For the moment, I’ll be focusing on the Fedora installation process. One of the best things about Fedora is that it gets released twice a year so you keep upgrading your machine to the get the latest features, latest bugs…etc. This means that you end up downloading and burning a Fedora ISO into a brand new DVD every 6 months. As you can imagine, I was quickly piling up DVDs that were useless soon after. So, after having looking around in electronic shops, I realised that USB keys had gone down in price and that you could get an 8GB USB stick for little money. This happened at the same time that I was getting a new laptop at work, so I wondered, what about I get myself one of those sticks, put the latest Fedora image on it and install it from there rather than burning yet another DVD? For sure, installing from an USB key was always going to be faster than from a DVD, so that was a plus as well.

For some reason, maybe because people haven’t tried this that much, it took me a while to find some decent instructions on how to do this. Eventually, this came from Michale Hartley’s comment on Haral Hoyer’s blog entry on “Fedora 8 on a USB stick”. However, I had some issues with these instructions, specially when trying to create the bootable partition in the USB stick, so I ended up writing my own set of instructions for Fedora 9:

Installing Fedora 9 from USB stick :
  1. Download Fedora-9-i386-DVD.iso
  2. Download Fedora-9-i386-netinst.iso
  3. Create 2 ext3 partitions in USB stick (Hint: GParted is a wicked graphical tool to create partitions): A 200 MB bootable partition and another partition with the rest of space.
  4. Copy Fedora-9-i386-netinst.iso to 1st partition:
    # livecd-iso-to-disk Fedora-9-i386-netinst.iso /dev/sdb1
  5. Copy DVD iso image to 2nd partition:
    # mount /dev/sdb2 mnt-sdb2/
    # cp Fedora-9-i386-DVD.iso mnt-sdb2/
    # umount mnt-sdb2/
  6. Reboot with USB key inserted.
  7. Select install from Hard Drive and select /dev/sdb2
When Fedora 10 was released, I followed the same steps to install as I did for Fedora 9 but I kept getting an error saying that no image could be found in /dev/sdb2 even though the Fedora 10 DVD iso image was there and had passed the SHA1SUM test successfully. After exchanging some emails within Red Hat I was pointed to the Installation from a Hard Drive section of the Fedora 10 documentation, which mentioned that install.img had to be present under the images/ directory in the partition from where Fedora 10 had to be installed.

On my 2nd attempt, I extracted the entire DVD iso and put it in the USB stick so that images/install.img would be found but doing only that didn’t work. In the 2nd phase of the installation, I was told that an image was missing. I just couldn’t understand what the hell was going on, so eventually, after a few further email exchanges, I worked out what needed doing: First, images/install.img had to be in the USB stick and next to the images/ folder, you needed to have Fedora-10-i386-DVD.iso. So, here’re the instructions to install Fedora 10 from USB stick:

Installing Fedora 10 from USB stick
  1. Download Fedora-10-i386-DVD.iso
  2. Download Fedora-10-i386-netinst.iso
  3. Create 2 ext3 partitions in USB stick (Hint: GParted is a wicked graphical tool to create partitions): A 200 MB bootable partition and another partition with the rest of space.
  4. Copy Fedora-10-i386-netinst.iso to 1st partition:
    # livecd-iso-to-disk Fedora-10-i386-netinst.iso /dev/sdb1
  5. Extract images/ folder from Fedora-9-i386-DVD.iso and copy to 2nd partition:
    # mount -t iso9660 Fedora-10-i386-DVD.iso mnt-dvd/ -o loop
    # mount /dev/sdb2 mnt-sdb2/
    # cp -rp mnt-dvd/images mnt-sdb2/
    # umount mnt-dvd/

    Note: If you do a ‘cp -a’ as recommended in the Installing from Hard Drive section, you’ll get an error like this, so just use ‘cp -rp’ instead:

    SELinux is preventing cp from creating a file with a context of iso9660_t on a filesystem. Usually this happens when you ask the cp command to maintain the context of a file when copying between file systems, “cp -a” for example. Not all file contexts should be maintained between the file systems. For example, a read-only file type like iso9660_t should not be placed on a r/w system. “cp -P” might be a better solution, as this will adopt the default file context for the destination.

  6. Copy DVD iso image to 2nd partition:
    # cp Fedora-10-i386-DVD.iso mnt-sdb2/
    # umount mnt-sdb2/
  7. Reboot with USB key inserted.
  8. Select install from Hard Drive and select /dev/sdb2
And that’s it. I’m fully aware that these instructions could be simplified/reduced but can’t be bothered to do that right now. It’s not something that I’m doing on a daily basis and it works, so I’m happy to leave them as they are for the time being. If anyone has any suggestions, please feel free to comment.

See :
http://galder.zamarreno.com/

No comments:

Post a Comment