LINUX


Tuesday 7 July 2015

How to install Fedora from a usb stick (or any other hard disk)

The following steps suppose that your pc can boot on a usb device:
  1. Insert the usb stick and note which device is used:
    # df Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/VolGroup01-LogVol00
                          11062528   9284412   1778116  84% /
    /dev/mapper/VolGroup01-LogVol01
                         101000512  79661560  16125564  84% /home
    /dev/sda2               505636     30011    449520   7% /boot
    tmpfs                  1036992       420   1036572   1% /dev/shm
    /dev/sdb1              4032804     11896   4020908   1% /media/disk

    In this case /dev/sdb1 contains Fedora DVD iso. Note this down as you need it later.
  2. Copy the Fedora DVD iso to directory /media/disk.
    # cp Fedora-9-i386-DVD.iso /media/disk
  3. Unmont the /media/disk directory:
    # umount /media/disk
  4. Use the iso image of Fedora 9 i386 (DVD) to make a bootable usb stick (more details here):
    livecd-iso-to-disk --noverify Fedora-9-i386-DVD.iso /dev/sdb1
  5. Remove the usb stick and re-insert it to check its content.
    Step 3 has  created 2 directories, LiveOS and syslinux

    # ls /media/disk/*
    /media/disk/LiveOS:

    /media/disk/syslinux:
    boot.cat  boot.msg  general.msg  grub.conf  initrd.img  isolinux.bin  ldlinux.sys  memtest  options.msg  param.msg  rescue.msg  splash.jpg  syslinux.cfg  trans.tbl  vesamenu.c32  vmlinuz

  6. Reboot
    Reboot your system and boot on the usb device.
  7. Install from hard disk
    While in installation wizard, select "Hard drive" as installation method and choose /dev/sdb1 as it contains the Fedora DVD iso. And rest is damn easy.

If your pc cannot boot on a usb device, there is another way. Replace steps 2, 3, 4 with the following:
  1. Mount Fedora DVD iso on /mnt/
    # mount Fedora-9-i386-DVD.iso /mnt/ -ro loop
  2. Copy the initrd.img and vmlinuz to /boot/ partition
    # cd /mnt/isolinux/
    # cp initrd.img vmlinuz /boot/

  3. Create grub entry for booting into Fedora 9
    Add these lines at the end of your /etc/grub.conf file.

    title Fedora 9 (New installation)
          kernel /vmlinuz
          initrd /initrd.img

No comments:

Post a Comment