檢視當前掛載硬碟的常用命令:fdisk -l
lsblk
重新掃瞄scsi命令:partprobe /dev/sdb
檢視新掛載的硬碟/dev/sdb
[root@hadoop001 ~]
ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb
可以看到新的/dev/sdb
是新加的鍵盤
[root@hadoop001 ~]
fdisk -l
disk /dev/sda: 42.9 gb, 42949672960 bytes, 83886080 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 label type: dos
disk identifier: 0x000939d4
device boot start end blocks id system
/dev/sda1 * 2048 2099199 1048576 83 linux
/dev/sda2 2099200 83886079 40893440 8e linux lvm
disk /dev/sdb: 53.7 gb, 53687091200 bytes, 104857600 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
units = sectors of 1 * 512 = 512 bytes
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
units = sectors of 1 * 512 = 512 bytes
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
分割槽硬碟
fdisk /dev/sdb
# 按n一路回車預設分割槽乙個
# 按t 輸入3選硬碟格式 輸入8e 修改分割槽格式為lvm
# 按wq 儲存配置
已經分割槽成為/dev/sdb1
[root@hadoop001 ~]
fdisk -l
disk /dev/sda: 42.9 gb, 42949672960 bytes, 83886080 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 label type: dos
disk identifier: 0x000939d4
device boot start end blocks id system
/dev/sda1 * 2048 2099199 1048576 83 linux
/dev/sda2 2099200 83886079 40893440 8e linux lvm
disk /dev/sdb: 53.7 gb, 53687091200 bytes, 104857600 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 label type: dos
disk identifier: 0xf14e5714
device boot start end blocks id system
/dev/sdb1 2048 104857599 52427776 8e linux lvm
units = sectors of 1 * 512 = 512 bytes
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
units = sectors of 1 * 512 = 512 bytes
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
建立pv物理卷
[root@hadoop001 ~] pvcreate /dev/sdb1
physical volume "/dev/sdb1" successfully created.
檢視vg分組
root@hadoop001 ~] vgs
vg #pv #lv #sn attr vsize vfree
centos 1 2 0 wz--n- <39.00g 4.00m
加入vg分組
[root@hadoop001 ~] vgextend centos /dev/sdb1
volume group "centos" successfully extended
擴充套件lv
size of logical volume centos/root changed from <35.12 gib (8990 extents) to <85.12 gib (21790 extents).
logical volume centos/root successfully resized.
系統重新讀取大小
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=9205760, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=4495, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 9205760 to 22312960
VMware硬碟擴容
使用vmware經常會遇到預先為其分配的硬碟空間不夠了,這時候就需要多劃分一些硬碟空間給vmware使用,按照如下方法實現擴容 環境 windows xp vmware fedora 10 步驟 1 在cmd視窗中輸入 vmware vdiskmanager x 50gb g cenos.vmdk ...
CentOS7 LVM新增硬碟及擴容
使用到的命令 分割槽完成後不用重啟,使用partx a dev sda通知核心更新分割槽 分割槽完成後不用重啟,使用partx a dev sda通知核心更新分割槽 常用命令 pvdisplay 檢視物理卷pv pvcreate 建立物理卷pv 語法 pvcreate 磁碟路徑1 磁碟路徑n pvc...
阿里雲硬碟擴容
阿里雲硬碟擴容 不要按照阿里雲文件的方法擴容,巨坑。以下是用 growpart 工具 可以不影響執行的擴容。yum install y cloud utils growpart執行fdisk l命令檢視磁碟實際大小。fdisk l執行df h命令檢視磁碟分配大小。df h執行growpart命令,呼...