ダウンタイムやデータ損失なしで Centos マシン上の /DEV/SDB1 を拡張することは可能ですか?

ダウンタイムやデータ損失なしで Centos マシン上の /DEV/SDB1 を拡張することは可能ですか?

CentOS6 では、空き容量を増やすために /dev/sdb1 を拡張したいと思います。

df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_www-lv_root 18G 2.9G 14G 18% / tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 477M 105M 347M 24% /boot /dev/sdb1 296G 233G 48G 84% /sqldata

物理ハードディスク SDB は、VMWare ですでに 600 GB に拡張されています。次のように /dev/sdb1 を fdisk します。

Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000021cd

Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/sdb: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x07acc91f

Device Boot Start End Blocks Id System /dev/sdb1 1 39162 314568733+ 83 Linux /dev/sdb2 39163 78325 314576797+ 8e Linux LVM

Disk /dev/mapper/vg_www-lv_root: 18.9 GB, 18865979392 bytes 255 heads, 63 sectors/track, 2293 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

Disk /dev/mapper/vg_www-lv_swap: 2080 MB, 2080374784 bytes 255 heads, 63 sectors/track, 252 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

おそらくおわかりのとおり、/dev/sdb1 はボリューム グループの一部ではありません。そのため、どのように進めればよいかわかりません。

すでに新しいパーティション /dev/sdb2 を Linux LVM として作成しました。 fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x07acc91f

Device Boot Start End Blocks Id System /dev/sdb1 1 39162 314568733+ 83 Linux /dev/sdb2 39163 78325 314576797+ 8e Linux LVM

/dev/sdb2 は、新しい 300 GB のディスク領域を含む新しい (空の) パーティションです。ダウンタイムを許容することはできないので、sdb1 と sdb2 を「マージ」して、約 600 GB の /sqldata を作成する方法を知りたいです。

ありがとう!

答え1

この環境、つまり単一パーティションでは、ダウンタイムが必要になる可能性が非常に高くなります。

EL6のドキュメントでは、使用中のデバイスでサイズ変更を試みないこのファイル システムを使用しているすべてのものを停止し、マウント解除して、パーティション テーブルを変更します。

EL7はパーティションのサイズ変更はオンラインで可能、削除、再作成、およびpartx --updateカーネルに伝えるトリックによって。まず、おそらく EL8 にアップグレードする必要があります。


パーティションの代わりに LVM を使用すると、これは簡単になります。パーティション分割を完全にスキップします。 などのデバイス全体に物理ボリュームを作成します。/dev/sdbディスクのサイズを変更し、それを使用して PV を でpvresize変更します。 LVM を使用していないため、これは新しい LVM ストレージへの移行になります。

関連情報