TCH (statz) | #1, Főfasz (10443) |
1751 | #4851 | ^ | Idézet | Tue, 03 Jul 2018 19:38:56 +02 |
178.164.*.* | *.pool.digikabel.hu |
Na, összeraktam a kis Linuxos környezetet Virtual(sux)Boxban, viszont ki kéne írni USB-re, de ahhoz ki kell szednem a VDI-ből. Csak éppen kevés a hely már a HDD-n. Magyarul, kell egy kis script, ami kiszedi nekünk és rögvest be is tömöríti... Előfeltétel:apt-get install qemu-utilsA script: #!/bin/sh # check if nbd is loaded NBD_LOADED=`lsmod | grep nbd` # load nbd if it is not loaded if [ "$NBD_LOADED" = "" ]; then modprobe nbd fi # connect VDI file given in arg1 to /dev/nbd0 qemu-nbd -c /dev/nbd0 "$1" # dd the surface, compress it and store to output file given in arg2 dd if=/dev/nbd0 bs=16MiB | xz -3 --stdout > "$2" # disconnect VDI file qemu-nbd -d /dev/nbd0 # unload nbd if it was not loaded at start if [ "$NBD_LOADED" = "" ]; then modprobe -r nbd fiHasználat: vdi2rawxz /path/to/input/file.vdi /path/to/output/file.raw.xz Sz*rk, közben leesett, hogy közvetlenül az USB-re is tudok dd-zni... :P Úgyhogy, másik script: #!/bin/sh # check if nbd is loaded NBD_LOADED=`lsmod | grep nbd` # load nbd if it is not loaded if [ "$NBD_LOADED" = "" ]; then modprobe nbd fi # connect VDI file given in arg1 to /dev/nbd0 qemu-nbd -c /dev/nbd0 "$1" # dd the surface to output file given in arg2 dd if=/dev/nbd0 of="$2" bs=16MiB # disconnect VDI file qemu-nbd -d /dev/nbd0 # unload nbd if it was not loaded at start if [ "$NBD_LOADED" = "" ]; then modprobe -r nbd fiHasználat: vdi2file /path/to/input/file.vdi /dev/usb_device_name |