Set Pen drive Bootable for Linux [via Commands]

1. Create a partition in Pen Drive (at least 3.5 – 4 GB)

2. Must Ensure partition is of Type FAT (if not change it to FAT)

3. Replug the pendrive and check the name of Ur Partition in Pen Drive by
# fdisk -l

Eg. it may give /dev/sdb1

4. Format this partition ( /dev/sdb1 ) by :-
# mkdosfs /dev/sdb1

5. Mount this partition to /mnt directory
# mount /dev/sdb1 /mnt

6. Copy ur RedHat/Fedora Bootable DVD into /mnt directory

7. Go into /mnt directory
# cd /mnt
You will get complete DVD content into it, check by:-
# ls
8. Copy /mnt/isolinux folder into /mnt folder
# cp -v /mnt/isolinux/* /mnt
and remove some file from /mnt folder

# rm /mnt/boot.cat /mnt/isolinux.bin /mnt/TRANS.TBL
and rename one file in /mnt folder

# mv /mnt/isolinux.cfg /mnt/syslinux.cfg
and copy initrd.img image from DVD to /mnt from
/images/pxeboot/initrd.img ->(this is in DVD) to /mnt

9. Now eject or umount ur pen drive
# umount /dev/sdb1

10. Install “syslinux” software or rpm, to create bootable pendrive
# yum install syslinux

or (if yum is not configure, install manually by graphical- double click on software through DVD -> (Packages folder in DVD))
11. Finally, create boot loader or make bootable, ur pen drive
# syslinux /dev/sdb1

12. Again mount
# mount /dev/sdb1 /mnt

13. Install Grub

Type the following command to install GRUB on the USB device:
# grub-install –root-directory=/mnt /dev/sdb

Create grub.conf:
# cd /mnt
# mkdir -p boot/grub

Edit the grub.conf file
by
# vim grub.conf

default=0
timeout=50
root (hd1,0)
title RedhAt Linux
kernel /vmlinuz
initrd /initrd.img

save the above file

Finally, unmount the USB pen drive, enter:
# umount /dev/sdb1

Your USB pen is ready and should be bootable from the USB device. This can be used to install Fedora or CentOS or RHEL.

 

Categories: Linux

1 Comment

Leave a Reply