1
2
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?
You certainly could write a short shell script to do it. Any reason that doesn't work in your case? – a CVn – 2013-11-11T14:39:59.793
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 – 2013-11-11T15:05:52.460
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.) – a CVn – 2013-11-11T16:35:12.750