There is a lot of solutions ou thtere for installing a linux distro into a pendrive, flashdrive, whatever...
I'd like to boot a machine via usb and install a distro to the harddrive. First, I tried copy the ISO image to the flashdrive using dd, like that:
dd if=./centos.iso of=/dev/sdb1, where sdb1 it's the first partition in the flashdrive.
Although the files were copied sucessfully to the flashdrive, it was not bootable.
Googling I finally found an app called
UnetBootIn that is designated to copy an ISO file to the pendrive and make it bootable.
So, I decided to use UnetBootIn to copy the whole dvd image to the flashdrive. This time I got lucky I was able to boot via pendrive, BUT, the installation process requires the ISO image. My options were Local CDROM, HTTP server, FTP Server or Hard Drive. Selecting Hard Drive allowed me to select the flashdrive partition. However, the installation process didn't accept that.
The final solution was create two partitions in the flashdrive. A really small one like 15Mb and another one filling all the rest. Both formatted as fat32.
I downloaded the centOs netinstall iso(really small, 8Mb). Then, I used the UnetBootIn to copy this netinstall image to the small partition. And the second, and biggest, partition contains the CentOS DVD ISO.
Now, I was able to boot using the pendrive and when comes the time I need to select where the ISO is, I select Hard Drive and the second partition in the flashdrive.
Voilá!!