36

split from here

I have a 16gb flash drive, which I want a live ISO to boot from (via unetbootin or something similar). It'll be some 32bit distro that I can plug-in and boot on whatever computer I need to. Since it will be a live ISO, I'll need somewhere to save data. I want the USB drive to have about 1gb for the distro, and the other 15gb for data storage.

I made two FAT partitions, the first called 'bootable' and the second 'storage'. The storage works fine in Linux, but Windows only sees the bootable partition. The storage isn't accessible.

How can I make the data accessible on Windows, and still have a bootable distribution? If the answer is how to partition it, please include the order and type of each partition. Do I need swap space for this, or is this handled differently?

  • Latest unetbootin has an option to create a compatible data storage partition. There is an input field where you can set the size of the data partition in MB. – ccpizza Sep 20 '17 at 22:20
21

I would do it like this (assuming that sdb is your stick):

Delete any previous partition table:

# dd if=/dev/zero of=/dev/sdb bs=512 count=1

Create the new ones:

# fdisk /dev/sdb
> n
> p
> 1
(+1GB)
> a
> 1
(toggles boot flag)
> t
> c
(filesystem type)
> n
> p
> 2
(defaults)
> t
(specify 2nd partition)
> c
(filesystem type)
> p
(prints current configuration)
> w
(write the new table and quit)

Create the filesystems:

# mkfs.vfat /dev/sdb1
# mkfs.vfat /dev/sdb2
  • Thanks, I'll try this out when I get home. How does this differ from what I have now, though? Will it change how Windows mounts the partitions? – Brigand Jan 30 '12 at 12:55
  • 1
    I tried it, and it partitions everything. I did have to change the order though. It appears Windows only sees the first partition on the disk. When I try to boot from the second I get to the UNetbootin screen, but I can't get past. The only option is Default. Pressing ENTER or waiting the 10 seconds both restart the counter almost immediately. Is it having trouble reading something? Is the problem that the second partition is bootable? What's going wrong, and how do I fix it? – Brigand Jan 30 '12 at 22:37
  • 2
    @maxschlepzig: no, from the little I found out, Windows has braindead limitations regarding the fact USB removable disks are seen as something different from a regular disk. I even found out a post somewhere suggesting hacking the device driver identification so that windows detects the USB device as a proper disk and recognizes all partitions. But that does not suit the OP, as it would request admin access to the computers. – njsg Feb 3 '12 at 21:28
  • 2
    let's just agree to say windows has limitations. – Aki Feb 3 '12 at 21:32
  • 1
    @userunknown, it is needed to delete any previous partition table, MBR etc. Thus you get a clean start before doing any partition and/or boot device experiments. Alternatively you would have to delete/modify existing partitions from inside your partition tool (e.g. fdisk). There is a slight chance that an existing partition table could influence the partition tool in its behaviour (think switch on compatibility mode or something like that). – maxschlepzig Feb 6 '12 at 19:13
14

Using a graphical partition editor (Like Disk Utility on a Mac or GParted) simply make two FAT32 partitions and use the first one as your Windows-readable partition (as Windows only reads the first partition on a disk) and then use the second partition as your bootable startup disk (as the BIOS recognizes both partitions and knows which to boot from).

Then, when you insert the disk into a Mac or Linux PC you'll still see two partitions, but the one you need is always available within Windows.

  • After all my Googling and looking at the different StackExchange sites, this was the most help post. I simply have a MS DOS free space partition as the first partition and a bootable partition on the second partition. Thank you. – Jared Burrows Feb 10 '14 at 20:41
  • A better answer is here: askubuntu.com/questions/423300/… – Gabriel Staples May 23 '16 at 3:41
8

The absolutely easiest way I found using Linux was the following:

1) Partition the drive (I used GParted) in 2 partitions with the SECOND partition being large enough to hold your operating system. My drive was a 2gb Flash Drive so I created a 500Mb Partition 1 and the remainder as Partition2.

2) I installed the latest version of UNetbootin on my Linux Computer.

3) I opened UNetbootin and installed Ubuntu Mate on the 2nd Partition. In my case that was /sdb2.

When UNetbootin finished I tested the flash drive in a different computer and it worked!

Thank you UNetbootin!!!

  • 1
    Best answer! Finally got it working after over 2 hrs of trying out other solutions. – kchomski Dec 19 '18 at 0:00
0

Create First partition for Data storage with file system as NTFS because FAT32 does not support individual file not more than 4GB. Second partition as FAT32 and make it bootable. Windows always recognizes first partition, so it can read contents from first partition and boots from 2nd partition.

0

I have made an instruction on how to do this without the shell on my blog, and combine it with a full disk encrypted install.

The partition scheme we get there looks like this:

1st - storage -  FAT32, not bootable
no mount point

This can be as small or large as you want, this is just for the unencrypted storage.

2nd - boot - EXT4 unencrypted, bootable
used as Ext4 journaling file system
mount point: /boot

This only has to be a few hundred MB, the default for kali is just over 100MB, so 2-300 will do fine. This contains some static files to get the FDE'd Linux up and running.
Seeing as GRUB supports some encryption, you could include this, but we'll be keeping it simple today.

3rd- crypt - Logical volume group, not bootable
used as: physical volume for encryption.
mount point: /

At least 4GB. This will contain 2 'virtual' partitions, one for the root mount point, the other for swap space.
0

Untried, But it might worked.

DummyDisk or DiskMod to recognise as Fixed Disk then Partition the "USB Drive" and Format the partition with the Bootable ISO and the other partitions are reserved as storage. (That's what I think anyway.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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