centos 6.4 KVM伺服器掛載磁碟的方法

centos 6.4 KVM伺服器掛載磁碟的方法

我在 KVM 伺服器上安裝了 Centos 6.4,已經在幾個網站上運行,現在我的空間快用完了,所以我決定從伺服器供應商購買更多 GB 以增加 HDD。我聯繫了伺服器供應商,他們告訴我我必須自己安裝它,但說實話,即使我在谷歌上搜尋它似乎也不太清楚我必須做什麼......或者更好地說什麼是最好的和簡單的方法來做到這一點。伺服器提供者的網站上有一個指南,但我認為它不適用於我的情況,我開始遵循指南,但從第一個命令似乎與結果不匹配,這就是我所做的:來自伺服器提供者範例: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 ty,請您提供協助,請在下方找到所要求的輸出。

由於長度過長,輸出已移至 Pastebin

在伺服器故障上發布請求之前,我聯繫了伺服器供應商,他們向我指出了本指南(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,因此您可以輕鬆擴展和移動任何內容。

有兩種方法可以擴展您的空間:

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

並告訴您從哪個作業系統連接到伺服器。

答案2

我沒有註意到新分割區的檔案系統。您應該使用“mount”命令。請檢查與此命令相關的文件[1]。 Mount 指令將掛載該分割區,但它不會是永久的。下次啟動時,您將需要再次安裝它。要使其永久化,您應該編輯 /etc/fstab 檔案。請參考[2]了解如何永久掛載分割區。

問候

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

相關內容