Making a raw disk file under Linux In this example, I'll use 16MB... old bios paramters according to the smartmedia format document are: 500 cylinders, 4 heads, 16 sectors/track 32000 logical sectors (768 sectors are reserved to fix bad-sectors) We're going to make two partitions :) first, partition a disk file... (you might need to create it first) sfdisk -uS -C 500 -H 4 -S 16 test.raw lets define these partitions... 1: start=41 end=15999 size=15959 type=01 (FAT12) active 2: start=16000 end=31999 size=16000 type=83 (linux) I didn't define a swap partition, but it might not be needed if using a ramdisk. To define the partitions, type these lines: 41 15959 1 * 16000 16000 83 0 0 0 0 next, write the file and you can mount it using the looback device... you must specify a byte-offset. for the FAT12 partition it is 41*512=20992 and for the linux partition it is 16000*512=8192000 # if you can't mkfs a fat partition, format it using windows #losetup /dev/loop0 test.raw -o 20992 #mkfs -t vfat -b block_size /dev/loop0 number_of_blocks #mount -t vfat /dev/loop0 /mnt #umount /mnt #losetup -d /dev/loop0 losetup /dev/loop0 test.raw -o 8192000 mkfs -t ext2 -b 1024 /dev/loop0 8000 # the size must be correct mount -t ext2 /dev/loop0 /mnt umount /mnt losetup -d /dev/loop0 I tried this under freebsd too, but had troubles with labeling the virtual node device :/