Create a bootable virtual floppy disk image on linux, from a binary file

0

I am trying to create a bootable floppy disk image (.img) for a very old version of Debian. I hope to run it on virtual-box. i have succeeded in creating a .img and mounting it on /media/floppy as a loop. debian consists of 3 files: bootdisk, basedsk1, and basedsk2. bootdisk file type is; Binary (application/octet-stream). i have tried to use dd but it always fails to open /media/floppy.

debians instructions are as follows;

"The bootdisk and basedisk images may be found in the directory `base'. Installation of the basedisks is required. Simply download the three disk images, use gunzip to decompress them and then dd or rawrite the images to floppy disk. Boot the system with the bootdisk and follow the instructions to install the base system.

Debian Linux packages may be found in the directory packages'. Installation of these packages is completely optional. Install only the packages that you need or want with thedpkg' utility; printable ASCII and PostScript copies of the dpkg man page can be found in the top-level `doc' directory."

I sincerely apolagize if none of this makes any sense. I have confused myself. if any more info is needed just ask.

user951628

Posted 2018-10-07T19:41:53.133

Reputation:

Answers

1

First of all: dd does not care about directories. It is not an archive tool and doesn't extract any files from the image. What it is is essentially a glorified cat program, which takes exactly one file as its input and one file as the output.

The "file" may be a file-like /dev node, usually corresponding to a disk. For example, if you wanted to write an image to a physical floppy drive, you'd use dd if=bootdisk.img of=/dev/fd0 (which is not very different from cat bootdisk.img > /dev/fd0).

Note that this is done without mounting the device anywhere. The image contains the device's whole contents – bootsector, partition table, filesystem, etc.


But right now, dd is completely unnecessary.

According to the Debian instructions, the source images don't need to be created – they are already available for download. And according to your post, the destination is not a physical disk – it's an image file for VirtualBox.

So just use the downloaded image directly with VirtualBox. Nothing else (except ungzipping it) needs to be done.

(Well, sure, there is no harm in creating a blank image, attaching a loop device with losetup, and then using dd if=bootdisk of=/dev/loop0. But that is completely useless – in the end, you would be just copying from file A to file B.)

user1686

Posted 2018-10-07T19:41:53.133

Reputation: 283 655