Partitioning a USB-stick?

tinkeng

Junior Member
Feb 28, 2010
15
0
0
This question could go in a number of categories. It's got a little Linux, a litte software, a little hardware in it.

I'm one of the guys who very soon needs to install a new OS because I'm using Win7 RC1. I have bought Win7 Home Premium but before installing it I'm planning to completely remove the old system, system files and all. Some of the system files, for some reason, are on a different drive than the OS itself, including the bootmgr files, so I can't access them from Windows and I won't be able to delete them from the Windows installation either because the drive they're on is my media storage drive and I want to keep that.

My plan is to access the files from a Live USB Ubuntu stick. Ubuntu needs 2-4GB on a stick, and I found a really cheap 16GB USB stick. My question then is, is it possible to split a USB stick into a 4GB Linux boot parition, and a 12GB Fat32 storage partition that can be accessed from both Windows and Linux?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The problem will be Windows, AFAIK it will only ever touch the first partition on a flash drive. So while you can partition it all you like, you probably won't get Windows to see anything but the first partition.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,579
10,215
126
The problem will be Windows, AFAIK it will only ever touch the first partition on a flash drive. So while you can partition it all you like, you probably won't get Windows to see anything but the first partition.

Why would you say that? Aren't a USB flash drive, and an external USB HD, both USB Mass Storage controllers? IOW, I'm not sure how Windows would even tell the difference, and it sure would be strange behavior to only recognize the first partition on one of those, and multiple partitions on the other.

I would have to try it to make sure, but offhand, I cannot think of any reason why it wouldn't work.

Only problem is, the only tool I know of to make bootable partitions is the HP USB format tool, and it does only create a single partition.

There is a way to create a bootable USB stick using diskpart.exe manually from the command-line, so perhaps you can create multiple partitions that way.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
The problem comes from the USB Mass Storage Controller implementation. It wasn't created for flash drives but cdrom and hard drives , there is no classification for flash drives in the specification only cdrom, scsi, hard drives. To make it work , the controller chip on the flash drive converts the flash memory to something that the host can understand, emulating a physical device, but only part way.

The controller chip is the one in charge of how the drive can be set up.

If the controller does not emulate a hard drive 100% then partitioning will not work. The reason that is required is because partitions on hard drives are always recorded at specific sectors and a host cannot do a specific sector read through the mass storage driver class unless that function is available in the controller chip. It is much cheaper not to have that feature of emulating a hard drive down to the lower level of sector per sector transfers so it is often left out.

Making a USB drive bootable works by recognizing ,through querying the device, that it is not a hard drive but is a flash drive and writing the first blocks of the flash so they are bootable by reading in the first blocks to determine where the flash controller looks first for data when powered ( this can be anywhere on the drive) , then adding the boot code and then writing back the blocks. You can't just write the boot information to a sector like on a hard drive on most USB flash, you have to write the entire block that contains the boot code. That is why you cannot just tell windows to make a USB drive bootable, windows has no way of knowing where the boot sector of the device is and worst it cannot directly access it because of drive and controller limitations.