How to install Ubuntu on a USB drive with two partitions?

I have a 32GB USB drive with 2 partitions:

Partition 1: FAT32 used as storage, since Windows only sees the 1st partition of a USB drive

Partition 2: ext4 intended to be a bootable live Ubuntu 15.04.

How can I install the Ubuntu ISO file to the ext4 partition on the USB drive and make it bootable?

I have access to a second 512MB USB drive in order to run e.g. DamnSmallLinux, GParted or some other small Linux distro that could fit in. I'm running Windows7 with Cygwin on desktop PC and OS X Yosemite on laptop.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Just install it the same way as you would to an internal disk. During the installation process you can select where you want to install the OS to, and also where to install the boot loader. Just make sure you select the correct disk and partitions there. I'd also recommend having a small swap partition on your stick.
PanadroidAuthor Commented:
I might have not said it clearly enough. What I intend to do is create an Ubuntu USB installer drive by installing the ISO file to the 2nd partition of the USB drive with something like
dd if=/path/to/ubuntu.iso of=/dev/xxx

Open in new window

For the installer I'd do it totally differently. You can have the complete USB stick in FAT32. Then use something like Unetbootin To put Ubuntu on that stick. OReven better than unetbootin id WinSetupFromUSB, which contrary to what it's name might suggest, isn't just for Windows but works with many Linux Distro's. It's advantage is that you can have more than one Linux or Windows installer or LiveDVD on it. It uses the iso file and you have a menu when booting up from which you select the OS you want:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

PanadroidAuthor Commented:
I already used Unetbootin to put Ubuntu on the stick, and then I booted from it to create a partition on the unallocated free space with GParted but I get the message
The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes
and then I choose ignore to go on but then I get
it is not possible to create more than 1 primary partition
See attached screenshot or this link to see my GParted screen.
As I mentioned, with unetbootin you can only have one iso on a stick. With the other tool you can have several, as much many as there is room on the stick. Once you have the distro on the stick, you don't need to do anything else, you just boot from the stick and are in the LiveCD or DVD, from which you could install the OS to some other disk.

You don't have to install anything to the same stick again.
PanadroidAuthor Commented:
I intend to use the remaining space of the USB stick as storage, I'm not interested in having more than one distro on this stick. I don't see the use of WinSetupFromUSB in my case, unless this software creates a second partition on the stick and I'd be able to use it as storage.
You can use the rest of the space for whatever you want. You don't need another partition to store data on it. Just create a new directory so it looks more logical. The stick is already in fat32, so Windows can see it.
PanadroidAuthor Commented:
Sometimes the simplest answer is the right one. That would obviously do the job. I was thinking complicated.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.