I would like to be able to create 2 partitions on my USB pen drive: 1 readonly (cdrom) partition, and 1 writable partition (FAT32).
What I have tried so far with no success:
Using
/sbin/gpartedon Linux, I created two FAT32 partitions on the pen drive.Next, I created a small iso image (~300KB in size) , like so:
$ genisoimage -V myLabel -rJ -o /tmp/my.iso /path/to/dataNext, I
dd'ed this iso to the first FAT32 partition, like so:$ dd if=/tmp/my.iso of=/dev/sdb1 bs=1M conv=notrunc $ sync(Here,
/dev/sdbcorresponds to my pen drive.)
Results:
The Nautilus file manager can see both the CDROM and the FAT32 partitions just fine. But
gpartedshows the overwritten (CDROM) partition's file-system type as 'unknown'!Just like
gparted, Windows 7 is unable to recognize the file-system on the first (CDROM) partition (that Windows is hardwired to see anyway), and so prompts me to format it!
I'm unable to understand why Nautilus can show my partitions just fine but not gparted and Windows.
0x0b(FAT32) each. After my edit, I re-verified that the new partition-type values were0x96and0x0brespectively, as you suggested. But the same old behavior:gpartedshowing file-system type as 'unknown'. – Harry Oct 03 '13 at 13:54gpartedand Windows both expect the partition extents to be consistent with the file-system sitting between those extents. My original sdb1 size was 33 MiB, but my.iso is only 330KB withnotruncoption being used. So the extends in the 1st partition entry are not consistent with the contents as a result. Is this worth trying? – Harry Oct 03 '13 at 13:55Possibly relevant information can be found here, here and here.
– Hennes Oct 03 '13 at 14:15file -s /dev/sdb1from Linux, see if if reports the correct filesystem. You could also try filling sdb1 with zeros before writing the image, in case any leftover data at the end of the partition confuses Windows or gparted. – Aleix Mercader Oct 03 '13 at 14:16file -s ...gives:/dev/sdb1: # ISO 9660 CD-ROM filesystem data 'mycd. (Note: The label I had actually specified in thegenisoimagecommand was: 'mycd'. The trailing quote in the label outputted byfileis missing - I hope something weird is not going on there.) I'll try zeroing out sdb1 next. But, are you sure, I don't have to mess with partition extents in the partition entry for sdb1? – Harry Oct 03 '13 at 14:26