Проект

Общее

Профиль

Block resize » История » Версия 2

Рамиль Абдулбяров, 2013-06-25 08:22

1 1 Андрей Волков
h1. Block resize
2
3
nitro ~ # *lvresize -L25G nitro/qemu944-pc-script5-static*
4
5
nitro ~ # *lvs --units b nitro/qemu944-pc-script5-static*
6
7
<pre>
8
  LV                        VG    Attr     LSize        Pool Origin Data%  Move Log Copy%  Convert
9
  qemu944-pc-script5-static nitro -wi-a--- 26843545600B
10
</pre>
11
12
nitro ~ # *netstat -apx*
13
14
<pre>
15
Active UNIX domain sockets (servers and established)
16
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
17
unix  2      [ ACC ]     SEQPACKET  LISTENING     87       1462/udevd           /run/udev/control
18
unix  2      [ ACC ]     STREAM     LISTENING     2045277  7492/qemu-system-x8  /run/qemu/qemu943.control.sock
19
unix  2      [ ACC ]     STREAM     LISTENING     2045279  7492/qemu-system-x8  /run/qemu/qemu943.readline.sock
20
unix  2      [ ACC ]     STREAM     LISTENING     1057389  7272/qemu-system-x8  /run/qemu/qemu940.control.sock
21
unix  2      [ ACC ]     STREAM     LISTENING     1057391  7272/qemu-system-x8  /run/qemu/qemu940.readline.sock
22
unix  2      [ ACC ]     STREAM     LISTENING     87456868 32329/sshd: root@pt  /tmp/ssh-HvAJN32329/agent.32329
23
unix  2      [ ACC ]     STREAM     LISTENING     86420695 25902/qemu-system-x  /run/qemu/qemu9071.control.sock
24
unix  2      [ ACC ]     STREAM     LISTENING     86420697 25902/qemu-system-x  /run/qemu/qemu9071.readline.sock
25
unix  7      [ ]         DGRAM                    1256     2795/rsyslogd        /dev/log
26
unix  2      [ ]         DGRAM                    1277     2860/rsync           
27
unix  2      [ ]         DGRAM                    1285     518/cron             
28
unix  2      [ ]         DGRAM                    69584005 30905/dnsmasq        
29
unix  3      [ ]         DGRAM                    1151     1462/udevd           
30
unix  2      [ ]         DGRAM                    909290   28721/ntpd           
31
unix  2      [ ]         DGRAM                    87456850 32329/sshd: root@pt  
32
unix  3      [ ]         DGRAM                    1150     1462/udevd
33
</pre>
34
35
nitro ~ # *qmp-shell /run/qemu/qemu943.control.sock*
36
37
<pre>
38
Welcome to the QMP low-level shell!
39
Connected to QEMU 1.2.2
40
</pre>
41
42
(QEMU) press: TAB-TAB
43
44
<pre>
45
add-fd                      cpu                         migrate_set_downtime        query-commands              query-uuid
46
add_client                  device-list-properties      migrate_set_speed           query-cpu-definitions       query-version
47
balloon                     device_add                  netdev_add                  query-cpus                  query-vnc
48
block-job-cancel            device_del                  netdev_del                  query-events                quit
49
block-job-set-speed         dump-guest-memory           pmemsave                    query-fdsets                remove-fd
50
block-stream                eject                       qmp_capabilities            query-kvm                   screendump
51
block_passwd                expire_password             qom-get                     query-machines              set_link
52
block_resize                getfd                       qom-list                    query-mice                  set_password
53
block_set_io_throttle       human-monitor-command       qom-list-types              query-migrate               stop
54
blockdev-snapshot-sync      inject-nmi                  qom-set                     query-migrate-cache-size    system_powerdown
55
change                      memsave                     query-balloon               query-migrate-capabilities  system_reset
56
change-vnc-password         migrate                     query-block                 query-name                  system_wakeup
57
client_migrate_info         migrate-set-cache-size      query-block-jobs            query-pci                   transaction
58
closefd                     migrate-set-capabilities    query-blockstats            query-status                xen-save-devices-state
59
cont                        migrate_cancel              query-chardev               query-target
60
</pre>
61
62
(QEMU) *query-block*
63
64
<pre>
65
{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}]}
66
</pre>
67
68
(QEMU) *block_resize device=disk-943-pc-script-static size=26843545600*
69
70
<pre>
71
{u'return': {}}
72
</pre>
73
74 2 Рамиль Абдулбяров
h1. Выход из qmp-shell по Ctrl + D, а НЕ по quit
75
76 1 Андрей Волков
k943-pc-script ~ # *dmesg |tail*
77
78
<pre>
79
[6183931.271452] virtio_blk virtio2: new size: 52428800 512-byte logical blocks (26.8 GB/25.0 GiB)
80
</pre>
81
82
k943-pc-script ~ # *blockdev --rereadpt /dev/vdc*
83
84
k943-pc-script ~ # *pvs /dev/vdc*
85
86
<pre>
87
  PV         VG     Fmt  Attr PSize  PFree   
88
  /dev/vdc   static lvm2 a-   20.00g 1020.00m
89
</pre>
90
91
k943-pc-script ~ # *pvresize /dev/vdc*
92
93
<pre>
94
  Physical volume "/dev/vdc" changed
95
  1 physical volume(s) resized / 0 physical volume(s) not resized
96
</pre>
97
98
k943-pc-script ~ # *pvs /dev/vdc*
99
100
<pre>
101
  PV         VG     Fmt  Attr PSize  PFree
102
  /dev/vdc   static lvm2 a-   25.00g 6.00g
103
</pre>