Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my freelance job as "the dude that fixes your computer" I have an extremely handy tool, a bootable USB stick with Ubuntu LiveCD that allows me to recover and investigate in a known, working environment.

Now, I want to reformat this USB stick and reinstall with Casper-RW persistance. I did this a few times before with a FAT-formatted USB stick. It was a horror. The USB drive corrupted constantly, by people accidently removing the USB stick, the computer not properly shutting down, ETC.

Now what I want to create a multi-partition USB stick so I can put Ubuntu on a ext partition, but still be able to store some Windows stuff in it, by having a secondary FAT partition.

However I read somewhere that Windows will only check the first partition on USB sticks, giving a problem with the first bootable linux partition.

Is this possible on some way?

EDIT

Perhaps it wasn't clear what the problem is. The problem is that I read somewhere that Windows will only recognize the first partition on a USB stick. But I want two partitions, a ext partition and a FAT partition. No issues so far, but in order to be bootable the ext partition must be the first one!

share|improve this question
    
Can you just skirt the issue altogether by getting a separate USB stick for carrying around Windows stuff? That's what I do... –  Kromey Apr 13 '11 at 20:24
    
Yeah I could, but it would be nice to get them on one USB stick, even if it's only because I can :) (chances are I can not though) –  nightcracker Apr 13 '11 at 20:26
    
I can't say for sure (hence why I haven't posted an answer), but I suspect the answer is that you can't, or if you can it requires some super-awesome third-party driver that won't be installed on the systems you're working on anyway. –  Kromey Apr 13 '11 at 20:28
    
Yeah, that's what I thought too, but I asked anyway because perhaps someone has that little bit of trivia knowledge that makes this possible. Gotta <3 Windows supporting only it's own crappy FS. –  nightcracker Apr 13 '11 at 20:31
    
Who said that the bootable partition must be the first one? –  Skaperen Feb 19 '13 at 6:28
add comment

4 Answers

You can do what you want very easily.

Assumming only a two partition setup, you have to make the FAT partition your first primary partition (it has to be in the same order in the partition table and on the disk, it's usually the case, but strange things happen in Windows if you don't).

On your EXT partition install Ubuntu.

On the MBR install grub as following (I assume you already have a linux machine and grub2 working on it and that your pendrive is detected as /dev/sdb):

mount -t ext2 /dev/sdb2 /mnt
grub-install  --no-floppy --root-directory=/mnt/ /dev/sdb

This will setup grub on mbr and install all necessary files on your ubuntu partition. Next you need to setup your grub.cfg with a menuentry as follows (read grub2 documentation or the grub.cfg on your linux pc to build a full grub.cfg):

menuentry 'Ubuntu, con Linux 3.2.0-39-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos2)'
        search --no-floppy --fs-uuid --set=root UBUNTU_PARTITION_UUID
        linux   /boot/vmlinuz-3.2.0-39-generic-pae root=UBUNTU_PARTITION_UUID ro   quiet nosplash
        initrd  /boot/initrd.img-3.2.0-39-generic-pae
}

You need your partition UUID for this to work on computer with more than one disk:

# blkid /dev/sdb2
/dev/sdb2: LABEL="GPART" UUID="75cdfe28-0ad8-4f0a-8c1d-9af6b2a5ba88" TYPE="ext2"

I'll leave it up to you to find out how to add a second entry for memtest86+, which is perfect for this kind of rescue flash drive.

share|improve this answer
add comment

There is no such problems, at least with current on the market USB sticks.

In most cases, the USB stick is like a mini hard drive, so as such it contains a partition table, like any HD. And you can repartition it like any HD.

If you want to repartition it under Windows, try to right-clicking "My Computer", selecting "Administration", then going to "Disk Manager" and find your USB stick here.

Here, it will show you both parttions - the FAT one, and the "unknown" one - the ext* one. From here you can also repartition it.

This method won't allow you to resize partitions and create ext* partitions. For this cases, use Linux.

share|improve this answer
    
Once again, the problem is not the partitioning process (I can easily do that under linux), the problem is getting the disk bootable under linux on an ext partition and getting Windows to recognize the FAT partition. Windows looks no further then the first partition in the partition table with USB sticks. –  nightcracker Apr 13 '11 at 20:45
    
I never had such a problem under windows, but try to see what the "Disk Manager" is showing you. –  Evengard Apr 13 '11 at 20:46
add comment

Windows will not let you partition a removable drive like that, but it will happily read one that has been partitioned that way under Linux. It is a while ago now, but I've done it before and I'm pretty sure there were no hoops to jump through other than letting Linux do the partitioning.

Edit (new info)

My mixed disk wasn't bootable so I can't help you there, but the Windows partition was the first half so that my explain it working despite any "first partition only" problem as mentioned in your other comments.

share|improve this answer
    
The problem is not the partitioning process (I can easily do that under linux), the problem is getting the disk bootable under linux on an ext partition and getting Windows to recognize the FAT partition. –  nightcracker Apr 13 '11 at 20:34
add comment

In order to make the disk bootable under linux, you need to make the ext partition bootable. You can easiely do it using the disk management tool of ubuntu. And in my case the windows partition was a ntfs partition at the beggining of the disk, and windows 8 was able to detect and use this partition without any issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.