婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > VMware 虛擬機(linux)增加根目錄磁盤空間的方法

VMware 虛擬機(linux)增加根目錄磁盤空間的方法

熱門標簽:天津人工電銷機器人費用 地圖標注小區(qū)項目入駐 曲阜地圖標注app 內(nèi)蒙古電信外呼系統(tǒng) 開封400電話辦理價格 漳州外呼系統(tǒng)怎么樣 凱立德劇院地圖標注 哪個地圖標注更清晰 4s店如何在百度地圖標注

一、關(guān)閉你的虛擬機系統(tǒng),找到如下內(nèi)容:選擇"Edit Virtual mache settings”

點擊"Expand“

擴大虛擬機的空間為"40G"(根據(jù)個人需要填寫空間大小)。但是linux下面并不可見。

二、使用linux下的fdisk工具進行分區(qū)。

用root用戶登錄到你的linux系統(tǒng),查看你系統(tǒng)的分區(qū)

#fdisk -l

會出現(xiàn)以下的信息:

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
/dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/mapper/vg_zxw-lv_root: 18.8 GB, 18832424960 bytes
255 heads, 63 sectors/track, 2289 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_zxw-lv_root doesn't contain a valid partition table

Disk /dev/mapper/vg_zxw-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 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_zxw-lv_swap doesn't contain a valid partition table
根據(jù)提示信息可以判斷出此系統(tǒng)的磁盤接口為SCSI,對應“sda”如果上面的紅色字體是“hda”,那么此系統(tǒng)的磁盤接口為IDE對應“hda”所以我做一下操作:

#fdisk /dev/sda/

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):m //“ 列出fdisk的幫助”
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help):n //” 命令n用于添加新分區(qū)"
Command action
e extended
p primary partition (1-4)
p //" 選擇創(chuàng)建主分區(qū)"此時,

Partition number (1-4):3 //fdisk會讓你選擇主分區(qū)的編號,如果已經(jīng)有了主分區(qū)sda1,sda2,那么編號就選3,即要創(chuàng)建的該分區(qū)為sda3.
First cylinder (2611-3916, default 2611): //此時,fdisk又會讓你選擇該分區(qū)的開始值這個就是分區(qū)的Start 值(start cylinder);這里最好直接按回車,
Using default value 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-3916, default 3916): //此時,fdisk又會讓你選擇該分區(qū)的開始值這個就是分區(qū)的End 值這里最好直接按回車,
Using default value 3916

Command (m for help): w //w "保存所有并退出,分區(qū)劃分完畢"
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
三、我們的新建分區(qū)/dev/sda3,卻不是LVM的。所以,接下來使用fdisk將其改成LVM的。
#fdisk /dev/sda
Command (m for help): m
Command (m for help): t //改變分區(qū)系統(tǒng)id

Partition number (1-4): 3 //指定分區(qū)號
Hex code (type L to list codes): 8e //指定要改成的id號,8e代表LVM。
Command (m for help): w
四、重啟系統(tǒng)后,登陸系統(tǒng)。(一定要重啟系統(tǒng),否則無法擴充新分區(qū))

五、格式化該新添加的分區(qū):
#fdisk -l

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
/dev/sda2 64 2611 20458496 8e Linux LVM
/dev/sda3 2611 3916 10483750 8e Linux LVM
你會發(fā)現(xiàn)多了一塊分區(qū)。
#mkfs -t ext3 /dev/sda3 //在硬盤分區(qū)“/dev/sda3”上創(chuàng)建“ext3”文件系統(tǒng)。
此時我們就可以使用該新增分區(qū)啦:
六、擴充新分區(qū)
#lvs
#pvcreate /dev/sda3 //pvcreate指令用于將物理硬盤分區(qū)初始化為物理卷,以便被LVM使用。要創(chuàng)建物理卷必須首先對硬盤進行分區(qū),并且將硬盤分區(qū)的類型設置為“8e”后,才能使用pvcreat指令將分區(qū)初始化為物理卷。
Physical volume "/dev/sda3" successfully created
#vgextend VolGroup00 /dev/sda3 (其中是當前需要擴充的lvm組名,可以通過df -h查看,例如我的是: /dev/mapper/VolGroup00-LogVol00) //vgextend指令用于動態(tài)的擴展卷組,它通過向卷組中添加物理卷來增加卷組的容量。
#vgdisplay //用于顯示LNM卷組的元數(shù)據(jù)信息。

--- Volume group ---
VG Name vg_zxw
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 19.51 GiB
PE Size 4.00 MiB
Total PE 4994
Alloc PE / Size 4994 / 19.51 GiB
Free PE / Size 4994 / 10.01GB
VG UUID sqBgTs-iA8x-tCXZ-KYxK-SyWS-TfXQ-uBsLaR
(主要查看Free PE / Size 4994 / 10.01GB,說明我們最多可以有10.01GB的擴充空間。我一般選擇小于10.01GB)
# lvextend -L+9.8G /dev/VolGroup00/LogVol00 /dev/sda3

Logical volume LogVol00 successfully resized
#e2fsck -a /dev/VolGroup00/LogVol00 //使用e2fsck指令檢查文件系統(tǒng)錯誤。也可用“fsck -t ext2 -V /dev/sda3/檢查ext2文件系統(tǒng)。
(做fsck,檢查文件系統(tǒng))
#resize2fs /dev/VolGroup00/LogVol00 //resize2fs指令被用來增大或者收縮未加載的“ext2/ext3”文件系統(tǒng)的大小。
#df -h //查看一下你的系統(tǒng)磁盤空間"/"目錄變成了40GB
ok,這樣就大功告成了。

標簽:六盤水 慶陽 衡陽 茂名 衡陽 三門峽 仙桃 湘西

巨人網(wǎng)絡通訊聲明:本文標題《VMware 虛擬機(linux)增加根目錄磁盤空間的方法》,本文關(guān)鍵詞  VMware,虛擬機,linux,增加,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《VMware 虛擬機(linux)增加根目錄磁盤空間的方法》相關(guān)的同類信息!
  • 本頁收集關(guān)于VMware 虛擬機(linux)增加根目錄磁盤空間的方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 集贤县| 兴安县| 克东县| 南康市| 隆子县| 团风县| 临武县| 西畴县| 库车县| 木里| 浦北县| 金乡县| 宽城| 扶绥县| 麻阳| 赤壁市| 海阳市| 吴堡县| 馆陶县| 婺源县| 枝江市| 陆川县| 拉萨市| 乐至县| 剑阁县| 将乐县| 宁乡县| 颍上县| 宁蒗| 石屏县| 随州市| 河间市| 舟曲县| 从化市| 陵川县| 东源县| 安乡县| 区。| 左权县| 互助| 象山县|