# dmesg | tail [3362536.189973] virtio_blk virtio1: new size: 71720960 512-byte logical blocks (36.7 GB/34.2 GiB) [3362536.189984] vda: detected capacity change from 19541262336 to 36721131520 [3362866.358221] EXT4-fs (vda1): resizing filesystem from 4742395 to 8936699 blocks [3362866.389273] EXT4-fs (vda1): resized filesystem to 8936699
找到要 resize 的磁碟編號。注意只能是位於最末段的磁碟,如下的 vda1:
1 2 3 4 5
# df Filesystem 1K-blocks Used Available Use% Mounted on ... /dev/vda1 18318068 16648976 1652708 91% / ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# sgdisk -p /dev/vda Disk /dev/vda: 38166527 sectors, 18.1 GiB Sector size (logical/physical): 512/512 bytes Disk identifier (GUID): 877716F7-31D0-4D56-A1ED-4D566EFE418E Partition table holds up to 128 entries Main partition table begins at sector 2 and ends at sector 33 First usable sector is 34, last usable sector is 38166494 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name 1 227328 38166494 18.0 GiB 8300 14 2048 10239 4.0 MiB EF02 15 10240 227327 106.0 MiB EF00
# resize2fs /dev/vda1 resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/vda1 is mounted on /; on-line resizing required old_desc_blocks = 3, new_desc_blocks = 5 The filesystem on /dev/vda1 is now 8936699 (4k) blocks long.
確認一下結果,可以發現使用率從原本的 91% 降至 49%:
1 2 3 4 5
# df Filesystem 1K-blocks Used Available Use% Mounted on ... /dev/vda1 34578052 16649988 17911680 49% / ...
今天早上 Hinet 線路有點問題,恢復後發現每個 VM 中的 pppd 噴了訊息之後都沒有自動重連:
1 2 3 4 5 6 7 8 9
Dec 26 10:15:53 mx01 pppd[778]: No response to 4 echo-requests Dec 26 10:15:53 mx01 pppd[778]: Serial link appears to be disconnected. Dec 26 10:15:53 mx01 pppd[778]: Connect time 2224.5 minutes. Dec 26 10:15:53 mx01 pppd[778]: Sent 137161190 bytes, received 206597813 bytes. Dec 26 10:15:53 mx01 pppd[778]: restoring old default route to eth0 [10.1.1.1] Dec 26 10:15:53 mx01 systemd-networkd[668]: ppp0: Lost carrier Dec 26 10:15:59 mx01 pppd[778]: Connection terminated. Dec 26 10:15:59 mx01 pppd[778]: Sent PADT Dec 26 10:15:59 mx01 pppd[778]: Modem hangup
member 21eca106efe4caee is healthy: got healthy result from http://10.1.1.70:2379 member 8614974c83d1cc6d is healthy: got healthy result from http://10.1.1.71:2379
member 21eca106efe4caee is healthy: got healthy result from http://10.1.1.70:2379 member 8614974c83d1cc6d is healthy: got healthy result from http://10.1.1.71:2379
# docker network ls NETWORK ID NAME DRIVER SCOPE c9947d4c3669 bridge bridge local 3d430f3338a2 test_net overlay global fa5168034de1 host host local c2ca34abec2a none null local