LINUX.ORG.RU

Как вытащить из IMG образа для QEMU данные

 ,


0

1

Имеется образ ОС QNX, который запускается только посредством QEMU. Требуется оттуда вытащить информацию, а именно папку с файлами. Как это можно сделать? Попытки подключить локальную папку, ЮСБ и т.д. безуспешны. Мучаюсь год, помогите, могу образ скинуть.

Ответ на: комментарий от MyTrooName

Это первая часть марлезонского балета. Вторая начнётся когда надо будет примонтировать файловую систему..

anonymous
()
Ответ на: комментарий от Lexperience

qnx - это не линукс. там, вероятно, свои файловые системы, не поддерживаемые линуксом?

ну, и сделай уже, как просыт попробовать-то - дмесг палка хвост или как-то так

aol ★★★★★
()
Ответ на: комментарий от aol

linux поддерживает, смотри опции ядра

QNX4 file system support (read only) - CONFIG_QNX4FS_FS
QNX6 file system support (read only) - CONFIG_QNX6FS_FS

superuser ★★★★★
()
Ответ на: Ссылка на образ от Lexperience

вдруг у кого получится?

$ file inpu_model_743_B.img 
inpu_model_743_B.img: QEMU QCOW Image (v2), 33554432 bytes

Чему тут получаться, тут конвертировать надо:

$ man qemu-img
...
       usage: qemu-img command [command options]
...
       convert [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] filename
...
       filename
            is a disk image filename

       fmt is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats.
...
       convert [-c] [-p] [-n] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] filename [filename2
       [...]] output_filename
           Convert the disk image filename or a snapshot snapshot_param(snapshot_id_or_name is deprecated) to disk image output_filename using format output_fmt.
           It can be optionally compressed ("-c" option) or use any format specific options like encryption ("-o" option).

           Only the formats "qcow" and "qcow2" support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is
           rewritten as uncompressed data.

           Image conversion is also useful to get smaller image when using a growable format such as "qcow" or "cow": the empty sectors are detected and suppressed
           from the destination image.

           sparse_size indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for qemu-img to create a sparse image during
           conversion. If sparse_size is 0, the source will not be scanned for unallocated or zero sectors, and the destination image will always be fully
           allocated.

           You can use the backing_file option to force the output image to be created as a copy on write image of the specified base image; the backing_file
           should have the same content as the input's base image, however the path, image format, etc may differ.

           If the "-n" option is specified, the target volume creation will be skipped. This is useful for formats such as "rbd" if the target volume has already
           been created with site specific options that cannot be supplied through qemu-img.
...
Deleted
()

А в QNX есть ssh и его друг scp? Если есть предлагаю запустить: qemu [любимые опции] -net user,hostfwd=tcp::2222-:22 [твой образ]

Изнутри виртуалки: scp -r [твоя директория] [твой user name на хосте]@10.0.2.2:[куда покласть]

На хосте должен быть настроен sshd.

Подробности: https://wiki.archlinux.org/index.php/QEMU#Moving_data_between_host_and_guest_OS

anonymous
()
Ответ на: комментарий от Deleted

И что я это прочитал, почему некрасиво? Я эти инструкции все перепробывл, переконвертировал во все форматы ,а толку....достать так ничего и не смог. Через VirtualBox не грузится этот образ, поэтому гостевую не могу привязать

Lexperience
() автор топика
Ответ на: комментарий от Lexperience

Я эти инструкции все перепробывл

Но рассказать об этом «забыл»? Других инструкций кстати нет.

Deleted
()
Ответ на: комментарий от anonymous

libguestfs: error: /usr/bin/supermin exited with error status 1. To see full error messages you may need to enable debugging. Do: export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 and run the command again. For further information, read: http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs You can also run 'libguestfs-test-tool' and post the *complete* output into a bug report or message to the libguestfs mailing list.

Lexperience
() автор топика
Ответ на: комментарий от Lexperience

Во-первых, попробовать sudo virt-copy-in. Насколько я помню, без рута не особо пашут эти утилиты. Во-вторых, убедиться, что /usr/bin/supermin есть на хосте. Если нет, установить его через пакетный менеджер и попробовать снова. Если ничего не поможет, то сделать в терминале:

export LIBGUESTFS_DEBUG=1
export LIBGUESTFS_TRACE=1
sudo -E virt-copy-in ...

И залить выхлоп на pastebin.

anonymous
()
Ответ на: комментарий от Lexperience

то есть никак?

Что значит никак? Именно так как написано.

Может я что то не так делаю?

Рассказываю:

1)

$ qemu-img info inpu_model_743_B.img 
image: inpu_model_743_B.img
file format: qcow2
virtual size: 32M (33554432 bytes)
disk size: 128M
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
5         prevvw                  23M 2014-10-09 13:43:34   00:02:20.697
4         prevvm                  22M 2017-07-07 12:41:35   00:00:43.582
3         lastvm                  23M 2017-07-07 12:48:25   00:00:32.592
Format specific information:
    compat: 0.10

2)

$ qemu-img convert -f qcow2 -O raw inpu_model_743_B.img inpu_model_743_B.raw

3)

$ qemu-img info inpu_model_743_B.raw
image: inpu_model_743_B.raw
file format: raw
virtual size: 32M (33554432 bytes)
disk size: 31M

4)

$ sudo fdisk -l inpu_model_743_B.raw 

Disk inpu_model_743_B.raw: 33 MB, 33554432 bytes
16 heads, 63 sectors/track, 65 cylinders, total 65536 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

               Device Boot      Start         End      Blocks   Id  System
inpu_model_743_B.raw1   *          63       65519       32728+  4f  QNX4.x 3rd part

5)

$ sudo mkdir -pv /mnt/test
$ sudo mount inpu_model_743_B.raw /mnt/test -o loop,ro,offset=32256 -t qnx4
$ cd /mnt/test

Deleted
()
Последнее исправление: Deleted (всего исправлений: 1)
Ответ на: СПАСИБО! от Lexperience

Если без конвертаций, то qemu, вроде, может экспортировать в nbd. Потом на хосте можно подключить.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.