Yesterday I was searching a way to create and use img files using linux, and found a few simple commands that do the job.
Create a disk image from the phisical drive:
cat /dev/fd0 > imagefile.img
Copy image to the phisical drive:
cat imagefile.img > /dev/fd0
Simple isn’t it? And now the fun part :P
If we need it we can create an empty image and mount it using linux’s loop devices.
Creating the image:
$ dd bs=512 count=2880 if=/dev/zero of=imagefile.img
$ mkfs.msdos imagefile.img
Mounting it:
$ sudo mkdir /media/floppy1/
$ sudo mount -o loop floppy.img /media/floppy1/
Alternatively with a path as suggested by Anders Lennqvist in a comment to this post
Create a disk image from a physical diskette:
cat /dev/fd0 > /path/imagefile.img
Copy the image to a diskette:
cat /path/imagefile.img > /dev/fd0
There’s an even easier way to do this using mkfs.msdos, skipping the need for the dd command. Also, on my system, mkfs.msdos is in the /sbin directory, which is not usually in a user’s path. So, the new command is
Create an empty floppy image of 1.44 MB:
$ /sbin/mkfs.msdos -C /path/imagefile.img 1440
Simple isn’t it? And now the fun part :P
If we need it we can create an empty image-file and mount it using linux’s loop devices.
Creating an empty floppy image: (here 1.44MB)
$ dd bs=512 count=2880 if=/dev/zero of= /path/imagefile.img
Format it:
$ mkfs.msdos /path/imagefile.img
Mounting it:
$ sudo mkdir /media/floppy1/
$ sudo mount -o loop /path/imagefile.img /media/floppy1/
Thank you Anders!
Salena Vorik pointed out here a disk image can be created in an easier way:
There’s an even easier way to do this using mkfs.msdos, skipping the need for the dd command. Also, on my system, mkfs.msdos is in the /sbin directory, which is not usually in a user’s path. So, the new command is
Create an empty floppy image of 1.44 MB:
$ /sbin/mkfs.msdos -C /path/imagefile.img 1440
Thank you Salena!
Hello
Thank you for your little howto! It was a great help for me when I needed to create a virtual diskette while installing Win98 in virtual box under Ubuntu 7.10, gutsy gibbon. While using it I saved it to disk and made some modifications to make it more readable. Here is my version, you are welcome to use it if you like.
And again, thank you.
Create, mount and copy floppy disk images..
Create a disk image from a physical diskette:
cat /dev/fd0 > /path/imagefile.img
Copy the image to a diskette:
cat /path/imagefile.img > /dev/fd0
Simple isn’t it? And now the fun part :P
If we need it we can create an empty image-file and mount it using linux’s loop devices.
Creating an empty floppy image: (here 1.44MB)
$ dd bs=512 count=2880 if=/dev/zero of= /path/imagefile.img
Format it:
$ mkfs.msdos /path/imagefile.img
Mounting it:
$ sudo mkdir /media/floppy1/
$ sudo mount -o loop /path/imagefile.img /media/floppy1/
i’ll update post though thank you very much ;)
There’s an even easier way to do this using mkfs.msdos, skipping the need for the dd command. Also, on my system, mkfs.msdos is in the /sbin directory, which is not usually in a user’s path. So, the new command is
Create an empty floppy image of 1.44 MB:
$ /sbin/mkfs.msdos -C /path/imagefile.img 1440
i’ve added this to the post
thank you!
If you mount image file with following option
$ sudo mkdir /media/floppy1/
$ sudo mount -o loop /path/imagefile.img /media/floppy1/
normal user can’t create/move/copy/delete files on it.
If you let create/move/copy/delete to normal user then you mount it with
$ sudo mkdir /media/floppy1/
$ sudo mount -o loop,umask=0 /path/imagefile.img /media/floppy1/
I don’t know if it depends on linux distro (i use upensuse)
Thanks for suggestions
yes maybe some different ways of handling mount by the distro.
thank you very much i’ll add it to the post.
This post was very helpful to me, thank you!
Neither of the listed commands purported to work on Ubuntu 7.10 seem to work (see below). What am I missing?
foo@box:~$ cat /media/disk > winBootDisk.img
cat: /media/disk: Is a directory
foo@box:~$ /sbin/mkfs.msdos -C winBootDisk.img 1440
mkfs.msdos 2.11 (12 Mar 2005)
foo@box:~$
Ubuntu doesnt fail, you most likely have to use the block device and not the mountpoint when trying to
“cat /dev/fd0 /path/imagefile.img”. if you are unsure what your block device is, insert a floppy disk and at the command line use the “df” command
[…] https://untitledfinale.wordpress.com/2007/10/09/create-mount-and-copy-floppy-disks-images-under-linux… Author: bayu Categories: Uncategorized Tags: linux, os Comments (0) Trackbacks (0) Leave […]
> foo@box:~$ cat /media/disk > winBootDisk.img
> cat: /media/disk: Is a directory
replace the mount point you give by the device file and it will work.
i.e. $ cat /dev/fd0 > winBootDisk.img
Thank you! It’s really hope to save my old pc!:)
[…] https://untitledfinale.wordpress.com/2007/10/09/create-mount-and-copy-floppy-disks-images-under-linux… Categories: ubuntu Tags: Comments (0) Trackbacks (0) Leave a comment Trackback […]
[…] منبع راهنما: a fork in the road […]
[…] just drivers. You need to create image by yourself. It can be easily done in linux(check this howto) or you can download it from here. Tagged as: driver, SAS6/iR Leave a comment Comments (0) […]
Today I read a post on Howtogeek.com (http://www.howtogeek.com/howto/41244/this-week-in-geek-history-wikipedia-opens-doors-apple-iie-released-edison-lights-first-town/) about the Apple IIe introduced back in 1983. The Apple IIe was the second computer for our family. I started remembering about some of the games I use to play including the Ultima Series 1-5. SO I found on another website one of the Ultima games to download.
In order to run the game, I had to create a VM of MSDOS 6.22. Once I got the VM running, I had to figure out how to get these files into an *.IMG format. Your blog helped solve my problem. Tonight I got to play a game from 1988 and it was fun. I know my brothers will remember all the fun we had with it. My children will think it is neat.
Thanks again!
http://en.wikipedia.org/wiki/Ultima_V:_Warriors_of_Destiny
[…] Remember this is MSDOS6.22 without any network support, just a base OS. A little more research brought me to a blog on WordPress which explained to me how to create a .IMG file. The part of that post which helped was was Creating the image:. Now I have a .IMG file of Ultima […]
Linux Mint, and other Ubuntu based (sudo) users might have to issue a “sudo su”; before doing the write back, to Floppy, “cat imagefile.img > /dev/fd0”.
Just adding sudo before it, will not work. Sudo doesn’t work for everything. That’s one of them.
BTW, I was making a PLOP, boot-floppy copy, and that allows me to boot USB drives (with “MULTISYSTEM”) on USB 2.0 computers; that can’t otherwise boot USB, on their own. You just boot, and hit “u”. You can burn the CD image of PLOP, too. On a CD, you might as well get PLOP Linux, because it fits, and has the PLOP boot-loader included. By using a floppy disk, I don’t have to waste a CD (or DVD), as I don’t use disc’s, much, anymore. USB’s are faster than discs. Whether it’s a stick, a camera card with (fast USB)adapter, MP3 drive, or just an old drive hard drive (PATA or SATA), with a cheap USB adapter. The faster media is better, of course. Some are faster than others.