creating floppy images from directory
i am trying to create floppy images from a given directory. like e.g. the slackware rootdisk images. how do i do it?
i found a lot of stuff about making images from a floppy disk. or copying an image to a floppy disk but nothing about creating floppy images from directories. is it the same as with cd images. what's the fs type? thx vadkutya |
You create a floppy image by copying a floppy using dd:
dd if=/dev/fd0 of=/tmp/floppy.image If your data is currently in a file in a directory then copy the file to a clean floppy using the cp command and then use the dd command to copy the floppy to a floppy image file. You can also make a floppy image directly from a data file without using a floppy intermediate. Mount a file on a loopback device and then use mkfs and dd to create a floppy partition on the loopback device. Then copy the data file to the loopback device. Using a floppy intermediate is easier. --------------------- Steve Stites |
thx jailbait,
the floppy intermediate solution is quite obviouse. no wonder it didn't come to my mind ;). the second solution though would be more interesting. i know how to mount iso as loop device but the rest is beyond me? care to enlight me? vadkutya |
Quote:
1.- create a file full of zeroes which is exactly the same size of a floppy, you use dd for this (man dd). Tip: use /dev/zero as input source. 2.- format the file with the relevant filesystem. This can be any filesystem of your choice. It depends on what you are doing to do with the floppy. If you are going to create a linux disk, you probably want mkfs.ext2 or mkfs.ext3. If you want to use it in windows or dos, then you have many options, like mkfs.vfat or mkfs.msdos 3.- mount -o loop it. 4.- put anything you want into it. 5.- dump the image (with dd again) into the relevant device if you want. |
thank you very much :)
vadkutya |
i spoke to soon. i have problems with point 2 "format the file with the relevant filesystem". ok, first i created a file full of zeros with:
Code:
dd if=/dev/zero ibs=10 count=144 of=~/a0_bin.img Code:
ls -l a0_bin.img Code:
# mke2fs -c -v a0_bin.img vadkutya |
Quote:
You need to do the first step this way to get a bigger file: Code:
dd if=/dev/zero ibs=1024 count=1440 of=~/a0_bin.img |
thanks a lot, man. all steps work flawlessly. i am most greatful
vadkutya |
i thought i write the whole procedure down with all the commands involved just in case i forget them ;):
1. creating a file of 1.44 MB full of zeros which will later serve as image file: Code:
$ dd if=/dev/zero ibs=1024 count=1440 of=$IMGFILE Code:
# mke2fs $IMGFILE Code:
# mount -o loop -t ext2 $IMGFILE /mnt 5. unmount the file: Code:
# umount /mnt vadkutya |
All times are GMT -5. The time now is 02:06 PM. |