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:
- Create floppy image with
qemu-img create
- Format floppy image with
mkdosfs
- Mount floppy image with
mount -t fat /tmp/floppy.img /media/floppy
- Populate floppy image with
cp -r /tmp/configs/ /media/floppy/
- Unmount floppy image with
umount /media/floppy
- 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?
Answer
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 itdd 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.
No comments:
Post a Comment