Stefan Sonnenberg-Carstens
2002-Jul-25 09:17 UTC
[syslinux] memdisk and harddisk image creation under Linux
I read the following about memdisk : .... For any other size, the image is assumed to be a hard disk image, and should typically have an MBR and a partition table. The disk C/H/S geometry is determined by examining the partition table, so the entire image should be partitioned for proper operation. .... I'd like to create a bootable cd, wich boots a linux and some other tools. While el-torito limits the space to 2,88MByte, I would apreciate to use memdisk. The point is : How do I create a harddiskimage from scratch in a file, with MBR, partition table, filesystem on it etc. without using dd ? I tried with loopback, ramdisk etc. I was able to create a MBR and such things in a regular file, also a primary partition. But, as expected a mke2fs /filename1 dows not work, clearly, because it is not a special device. Anyone out there to help me ?
christian Marg
2002-Jul-25 23:21 UTC
[syslinux] memdisk and harddisk image creation under Linux
Hello... Stefan Sonnenberg-Carstens schrieb:> I'd like to create a bootable cd, wich boots a linux and some other tools. > While el-torito limits the space to 2,88MByte, I would apreciate to use > memdisk.Why not using an initrd? 2.88 Mbyte should be big enough to mount a cdrom as readonly root or fitting somethings to a Ramdrive. That might be an easier approach... If you create an image, you limit yourself again. If you use a Initramdisk, you are only limited by either CD-Size or RAM size. And of course, it could be loading faster... (if you use the CDrom as Readonly mounted Root...) because you don't have to load an Image at first.> The point is : How do I create a harddiskimage from scratch in a file, with > MBR, partition table, filesystem on it etc. without using dd ?Why not use dd for creating a file of the right size (fitting to CHS boundaries) filled with zeros ? I did this once and had much "fun" figuring the right CHS values for the filesize I wanted. I finally ended up with 501/14/63 to have an image about 225Mb in size. I had to use my Calculator for some time to produce the values... I used an Image of a Win98 ERD and DOSemu to finish the partition I wanted, but you want linux. That should be easier to accomplish...> I tried with loopback, ramdisk etc.Well, try harder :) There is a tool named losetup that is used to setup a loop device for pointing to a file. Tadaa - you have your special device...> But, as expected a mke2fs /filename1 dows not work, clearly, because it is > not a special device.bye Christian -- HiWi PC-Administration Rechenzentrum TU-Clausthal mailto:christian.marg at tu-clausthal.de