Block resize » История » Редакция 2
Редакция 1 (Андрей Волков, 2013-05-22 08:07) → Редакция 2/3 (Рамиль Абдулбяров, 2013-06-25 08:22)
h1. Block resize
nitro ~ # *lvresize -L25G nitro/qemu944-pc-script5-static*
nitro ~ # *lvs --units b nitro/qemu944-pc-script5-static*
<pre>
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
qemu944-pc-script5-static nitro -wi-a--- 26843545600B
</pre>
nitro ~ # *netstat -apx*
<pre>
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] SEQPACKET LISTENING 87 1462/udevd /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 2045277 7492/qemu-system-x8 /run/qemu/qemu943.control.sock
unix 2 [ ACC ] STREAM LISTENING 2045279 7492/qemu-system-x8 /run/qemu/qemu943.readline.sock
unix 2 [ ACC ] STREAM LISTENING 1057389 7272/qemu-system-x8 /run/qemu/qemu940.control.sock
unix 2 [ ACC ] STREAM LISTENING 1057391 7272/qemu-system-x8 /run/qemu/qemu940.readline.sock
unix 2 [ ACC ] STREAM LISTENING 87456868 32329/sshd: root@pt /tmp/ssh-HvAJN32329/agent.32329
unix 2 [ ACC ] STREAM LISTENING 86420695 25902/qemu-system-x /run/qemu/qemu9071.control.sock
unix 2 [ ACC ] STREAM LISTENING 86420697 25902/qemu-system-x /run/qemu/qemu9071.readline.sock
unix 7 [ ] DGRAM 1256 2795/rsyslogd /dev/log
unix 2 [ ] DGRAM 1277 2860/rsync
unix 2 [ ] DGRAM 1285 518/cron
unix 2 [ ] DGRAM 69584005 30905/dnsmasq
unix 3 [ ] DGRAM 1151 1462/udevd
unix 2 [ ] DGRAM 909290 28721/ntpd
unix 2 [ ] DGRAM 87456850 32329/sshd: root@pt
unix 3 [ ] DGRAM 1150 1462/udevd
</pre>
nitro ~ # *qmp-shell /run/qemu/qemu943.control.sock*
<pre>
Welcome to the QMP low-level shell!
Connected to QEMU 1.2.2
</pre>
(QEMU) press: TAB-TAB
<pre>
add-fd cpu migrate_set_downtime query-commands query-uuid
add_client device-list-properties migrate_set_speed query-cpu-definitions query-version
balloon device_add netdev_add query-cpus query-vnc
block-job-cancel device_del netdev_del query-events quit
block-job-set-speed dump-guest-memory pmemsave query-fdsets remove-fd
block-stream eject qmp_capabilities query-kvm screendump
block_passwd expire_password qom-get query-machines set_link
block_resize getfd qom-list query-mice set_password
block_set_io_throttle human-monitor-command qom-list-types query-migrate stop
blockdev-snapshot-sync inject-nmi qom-set query-migrate-cache-size system_powerdown
change memsave query-balloon query-migrate-capabilities system_reset
change-vnc-password migrate query-block query-name system_wakeup
client_migrate_info migrate-set-cache-size query-block-jobs query-pci transaction
closefd migrate-set-capabilities query-blockstats query-status xen-save-devices-state
cont migrate_cancel query-chardev query-target
</pre>
(QEMU) *query-block*
<pre>
{u'return': [{u'locked': False, u'type': u'unknown', u'io-status': u'ok', u'removable': False, u'device': u'disk-943-pc-script-root', u'inserted': {u'bps_rd': 0, u'backing_file_depth': 0, u'encrypted': False, u'bps_wr': 0, u'drv': u'raw', u'bps': 0, u'iops': 0, u'file': u'/dev/nitro/qemu943-pc-script-root', u'iops_rd': 0, u'encryption_key_missing': False, u'ro': False, u'iops_wr': 0}}, {u'locked': False, u'type': u'unknown', u'io-status': u'ok', u'removable': False, u'device': u'disk-943-pc-script-code', u'inserted': {u'bps_rd': 0, u'backing_file_depth': 0, u'encrypted': False, u'bps_wr': 0, u'drv': u'raw', u'bps': 0, u'iops': 0, u'file': u'/dev/nitro/qemu943-pc-script-code', u'iops_rd': 0, u'encryption_key_missing': False, u'ro': False, u'iops_wr': 0}}, {u'locked': False, u'type': u'unknown', u'io-status': u'ok', u'removable': False, u'device': u'disk-943-pc-script-static', u'inserted': {u'bps_rd': 0, u'backing_file_depth': 0, u'encrypted': False, u'bps_wr': 0, u'drv': u'raw', u'bps': 0, u'iops': 0, u'file': u'/dev/nitro/qemu943-pc-script-static', u'iops_rd': 0, u'encryption_key_missing': False, u'ro': False, u'iops_wr': 0}}, {u'locked': False, u'tray_open': False, u'io-status': u'ok', u'removable': True, u'device': u'ide1-cd0', u'type': u'unknown'}, {u'device': u'floppy0', u'type': u'unknown', u'tray_open': False, u'locked': False, u'removable': True}, {u'device': u'sd0', u'type': u'unknown', u'tray_open': False, u'locked': False, u'removable': True}]}
</pre>
(QEMU) *block_resize device=disk-943-pc-script-static size=26843545600*
<pre>
{u'return': {}}
</pre>
h1. Выход из qmp-shell по Ctrl + D, а НЕ по quit
k943-pc-script ~ # *dmesg |tail*
<pre>
[6183931.271452] virtio_blk virtio2: new size: 52428800 512-byte logical blocks (26.8 GB/25.0 GiB)
</pre>
k943-pc-script ~ # *blockdev --rereadpt /dev/vdc*
k943-pc-script ~ # *pvs /dev/vdc*
<pre>
PV VG Fmt Attr PSize PFree
/dev/vdc static lvm2 a- 20.00g 1020.00m
</pre>
k943-pc-script ~ # *pvresize /dev/vdc*
<pre>
Physical volume "/dev/vdc" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
</pre>
k943-pc-script ~ # *pvs /dev/vdc*
<pre>
PV VG Fmt Attr PSize PFree
/dev/vdc static lvm2 a- 25.00g 6.00g
</pre>