1

I'm using Vyatta routers with KVM and want to attach a floppy drive with a config file for Vyatta when I boot the image. I'll be doing this over and over again, and as such am looking for an automated way of creating the floppy images.

Right now, I'm doing the following:

  1. Create floppy image with qemu-img create
  2. Format floppy image with mkdosfs
  3. Mount floppy image with mount -t fat /tmp/floppy.img /media/floppy
  4. Populate floppy image with cp -r /tmp/configs/ /media/floppy/
  5. Unmount floppy image with umount /media/floppy
  6. Save floppy image with mv /tmp/floppy.img ~/floppies/

Any chance there's an easier way to do this?! Perhaps a shortcut application that I can give a directory to and it will do all this for me w/out having to mount the image?

3
  • You certainly could write a short shell script to do it. Any reason that doesn't work in your case?
    – user
    Commented Nov 11, 2013 at 14:39
  • Understood... and essentially that's what I have now. I guess what I'm asking is if there's an application that creates image files from directories w/out having to do all the mounting and such. I'm assuming that formatting and mounting/unmounting is going to be the only option... just checking to make sure first.
    – Bryan
    Commented Nov 11, 2013 at 15:05
  • Generally The Unix Way is to have one tool do one and only one thing, and then string together tools doing different things for more complex operations. I'm not saying such a tool doesn't exist, but somehow I doubt it. (You also may have better luck on Unix & Linux. You can flag your post for moderator attention if you want it migrated; please don't simply repost it on another site in the Stack Exchange network.)
    – user
    Commented Nov 11, 2013 at 16:35

1 Answer 1

1

If they are all identical, I would use dd in this case.
Make one floppy, use this command to make an image of the floppy once you've created it
dd if=/dev/fd0 of=floppy.img

Then, when you need a floppy generated, you can write the image to a floppy dd if=floppy.img of=/dev/fd0
Replacing the /dev/fd0 with the floppy disk device of course.

If they configurations are different, then perhaps a script which automates your current process would be better.

1
  • Not all the floppy images are identical, but the suggestion of developing a script is the route I went so I'll mark this as accepted. Thanks!
    – Bryan
    Commented Aug 6, 2014 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .