CentOS 6.4 KVM サーバーにディスクをマウントする方法

CentOS 6.4 KVM サーバーにディスクをマウントする方法

私はすでにいくつかのサイトで稼働している KVM サーバーで Centos 6.4 を使用していますが、今ではスペースがほとんど不足しているため、サーバー プロバイダーからさらに GB を購入して HDD を増やすことにしました。サーバー プロバイダーに問い合わせたところ、自分でマウントする必要があると言われましたが、正直なところ、グーグルで検索しても、何をすべきかがよくわかりません...または、もっと簡単に実行できる最善の方法は何かと言うと、わかりません。サーバー プロバイダーの Web サイトにガイドがありますが、私のケースには当てはまらないと思います。ガイドラインに従い始めましたが、最初のコマンドから結果が一致していないようです。私が行ったのは次のとおりです。サーバー プロバイダーの例: fdisk -ul /dev/vdb 結果は、ディスクが拡張されたかどうかに関する情報になるはずです。私のサーバーの場合: fdisk -ul /dev/vdb 結果は空白でデータなし

そこで、この時点で df -l を実行し、出力は次のようになりました。

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_SERVER-lv_root 16070076 4696580 10557164 31% / tmpfs 961212 0 961212 0% /dev/shm /dev/vda1 495844 73767 396477 16% /boot

fdisk -l を実行した後の出力は次のようになります:

Disk /dev/vda: 214.7 GB, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000a608e

Device Boot Start End Blocks Id System /dev/vda1 * 3 1018 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/vda2 1018 41611 20458496 8e Linux LVM Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/vg_SERVER-lv_root: 16.7 GB, 16718495744 bytes 255 heads, 63 sectors/track, 2032 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_SERVER-lv_swap: 4227 MB, 4227858432 bytes 255 heads, 63 sectors/track, 514 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

コマンドは fdisk -ul /dev/vda となり、結果は次のようになります。

 Disk /dev/vda: 214.7 GB, 214748364800 bytes
    16 heads, 63 sectors/track, 416101 cylinders, total 419430400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000a608e

    Device Boot Start End Blocks Id System /dev/vda1 * 2048 1026047 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/vda2 1026048 41943039 20458496 8e Linux LVM Partition 2 does not end on cylinder boundary.

さて、この時点で私は少し混乱しています。今、最も簡単な方法は何でしょうか、どのように進めればよいでしょうか?

タイ


こんにちは、GioMac さん、ご協力ありがとうございます。リクエストされた出力を以下に示します。

出力が長すぎるため、Pastebin に移動されました

serverfaultにリクエストを投稿する前に、サーバープロバイダーに連絡して、このガイドを紹介してもらいました(http://guide.onamae-server.com/vpskvm/1_15_16_81_1/) サーバーは KVM なのでサポートが提供されず、詳細を教えていただけませんでした。

 lsblk
NAME                              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                                11:0    1 1024M  0 rom
vda                               252:0    0  200G  0 disk
ââvda1                            252:1    0  500M  0 part /boot
ââvda2                            252:2    0 19.5G  0 part
  ââvg_v1577145116-lv_root (dm-0) 253:0    0 15.6G  0 lvm  /
  ââvg_v1577145116-lv_swap (dm-1) 253:1    0    4G  0 lvm  [SWAP]

 partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/vda (              Device or resource busy).  As a result, it may not reflect all of your changes u              ntil after reboot.

答え1

ファイルシステムがいっぱいになっているようには見えません。でも大丈夫です。

幸いなことに、LVM を使用しているため、何でも簡単に拡張および移動できます。

スペースを拡張するには 2 つの方法があります。

A. 拡張VDAを提供

LVM物理ボリューム、ボリュームグループを拡張し、それを論理ボリュームに追加してからLinuxファイルシステムを拡張する必要があります。

B. プロバイダーが新しいディスクを接続しました (vdb など)

LVM pvを作成し、それをvgに追加し、lvにスペースを追加してから、Linuxファイルシステムを拡張する必要があります。

どちらもライブシステムで実行できます。

グラフィカル サーバーを実行している場合は、system-config-lvm GUI で実行できます。

完全な回答を得るには、次のような詳細情報を提供してください:

partprobe
df -h
fdisk -l
dmesg
pvs
vgs
lvs
mount

どの OS からサーバーに接続したかを伝えます。

答え2

新しいパーティションのファイルシステムに気付きませんでした。「mount」コマンドを使用する必要があります。このコマンドに関連するドキュメント [1] を確認してください。マウント コマンドはパーティションをマウントしますが、永続的ではありません。次回の起動時に再度マウントする必要があります。永続的にするには、/etc/fstab ファイルを編集する必要があります。パーティションを永続的にマウントする方法については、[2] を参照してください。

よろしく

[1]http://linux.die.net/man/8/mount
[2]http://linuxexpresso.wordpress.com/2010/03/14/mount-partitions-in-terminal-fstab/

関連情報