mount して新しい方にcp

新しいサイズのディスクイメージを作成して,旧disk と新disk をmount してcp とか?

qemu-img resize

未確認要確認 Re: [Qemu-devel] "Hot" resizing QCow2 image using a simple python script

qemu-img resize -f qcow2 -o size=10G original5G.qcow2

option が無い

$ qemu-img
qemu-img version 0.12.5, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
QEMU disk image utility

Command syntax:
  check [-f fmt] filename
  create [-f fmt] [-o options] filename [size]
  commit [-f fmt] filename
  convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename
  info [-f fmt] filename
  snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename

Command parameters:
  'filename' is a disk image filename
  'fmt' is the disk image format. It is guessed automatically in most cases
  'size' is the disk image size in bytes. Optional suffixes
    'k' or 'K' (kilobyte, 1024), 'M' (megabyte, 1024k), 'G' (gigabyte, 1024M)
    and T (terabyte, 1024G) are supported. 'b' is ignored.
  'output_filename' is the destination disk image filename
  'output_fmt' is the destination format
  'options' is a comma separated list of format specific options in a
    name=value format. Use -o ? for an overview of the options supported by the
    used format
  '-c' indicates that target image must be compressed (qcow format only)
  '-h' with or without a command shows this help and lists the supported formats

Parameters to snapshot subcommand:
  'snapshot' is the name of the snapshot to create, apply or delete
  '-a' applies a snapshot (revert disk to saved state)
  '-c' creates a snapshot
  '-d' deletes a snapshot
  '-l' lists all snapshots in the given image

Supported formats: cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2 parallels nbd host_cdrom host_floppy host_device raw tftp ftps ftp https http



qcow2 のファイルをmount


$ file sid00.img
sid00.img: Qemu Image, Format: Qcow , Version: 2
$ sudo qemu-nbd ./sid00.img -p 5555 &
$ sudo nbd-client localhost 5555 /dev/nbd1
Negotiation: ..size = 8388608KB
bs=1024, sz=8388608
$ sudo fdisk -l /dev/nbd1
GNU Fdisk 1.2.4
Copyright (C) 1998 - 2006 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

Disk /dev/nbd1: 8 GB, 8587192320 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System 
/dev/nbd1p1               1        1044     8385898   83  Linux

$ sudo mount /dev/nbd1p1 /mnt
$ ls /mnt
bin  boot  cdrom  dev  etc  home  initrd.img  initrd.img.old  lib  lib64  lost+found  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var  vmlinuz  vmlinuz.old

qemu-nbd --connect=

qemu-nbd --connect=/dev/nbd0 disk.qcow2
mount /dev/nbd0 /mnt

な感じで利用できるpatch があるらしい.

spam 避けですcheck を付けて下さい

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-11-17 (水) 21:23:44 (3177d)