中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

centos7 / redhat 7的分區擴容

發布時間:2020-07-16 04:22:16 來源:網絡 閱讀:639 作者:qunchaomin 欄目:系統運維

linux擴容:分區擴容前先用fdisk把該分區的system id改成lvm(8e)
創建邏輯卷:
創建PV(轉換物理卷)--->創建VG--->創建LV,并格式化
fdisk /dev/sdb,創建分區并將id改為8e
fdisk /dev/sdc創建分區并將id改為8e
fdisk /dev/sdd創建分區并將id改為8e
pvscan查看當前是否有物理卷
pvdisplay
1、[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[root@localhost ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created.
[root@localhost ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created.
[root@localhost ~]#
2、創建卷組VG
vgscan、vgdisplay
[root@localhost ~]# vgscan
Reading volume groups from cache.
[root@localhost ~]# vgcreate mail_store /dev/sdc1 /dev/sdb1 /dev/sdd1
Volume group "mail_store" successfully created
[root@localhost ~]#
3、創建LV
[root@localhost ~]# lvscan
[root@localhost ~]# lvdisplay
[root@localhost ~]#
[root@localhost ~]# lvcreate -L 15G(大小) -n mail(名稱) mail_store(卷組)
Logical volume "mail" created.
[root@localhost ~]# lvscan
ACTIVE '/dev/mail_store/mail' [15.00 GiB] inherit
[root@localhost ~]# lvdisplay
--- Logical volume ---
LV Path /dev/mail_store/mail
LV Name mail
VG Name mail_store
LV UUID j5Hvhi-ppem-Okz1-CV0o-SnKY-Gkdk-lr2zXU
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-12-01 03:11:40 +0800
LV Status available

open 0

LV Size 15.00 GiB
Current LE 3840
Segments 2
Allocation inherit
Read ahead sectors auto

  • currently set to 8192
    Block device 253:0

格式化lv為ext4文件類型:mkfs -t ext4 /dev/mail_store/mail
[root@localhost ~]# mkfs -t ext4 /dev/mail_store/mail
mke2fs 1.42.9 (28-Dec-2013)
文件系統標簽=
OS type: Linux
塊大小=4096 (log=2)
分塊大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
983040 inodes, 3932160 blocks
196608 blocks (5.00%) reserved for the super user
第一個數據塊=0
Maximum filesystem blocks=2151677952
120 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: 完成
正在寫入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
掛載lv到/mnt目錄:mount /dev/mail_store/mail /mnt/
[root@localhost ~]# mount /dev/mail_store/mail /mnt/
[root@localhost ~]# df -Th
文件系統 類型 容量 已用 可用 已用% 掛載點
/dev/sda2 ext4 17G 3.5G 13G 22% /
devtmpfs devtmpfs 897M 0 897M 0% /dev
tmpfs tmpfs 912M 0 912M 0% /dev/shm
tmpfs tmpfs 912M 9.1M 903M 1% /run
tmpfs tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 175M 840M 18% /boot
tmpfs tmpfs 183M 20K 183M 1% /run/user/1000
/dev/sr0 iso9660 3.8G 3.8G 0 100% /run/media/mcq/RHEL-7.4 Server.x86_64
tmpfs tmpfs 183M 0 183M 0% /run/user/0
/dev/mapper/mail_store-mail ext4 15G 41M 14G 1% /mnt
[root@localhost ~]#

總結步驟:
a、pvcreate /dev/sdc1創建一個新的pv分區
注:可能報錯,需要更新分區表,執行partprobe,再執行
partprobe
[root@localhost ~]# pvcreate /dev/sdb2
Physical volume "/dev/sdb2" successfully created.

b、vgextand ROOT /dev/sdc1將新的pv分區擴容到vg組ROOT
[root@localhost ~]# vgextend VAR /dev/sdb2
Volume group "VAR" successfully extended

c、lvextend /dev/VAR/var /dev/sdb2或 lvextend -L +20G /dev/VAR/var 將新擴容的空間放入lv卷
[root@localhost ~]# lvextend /dev/VAR/var /dev/sdb2
Size of logical volume VAR/var changed from 2.00 GiB (512 extents) to <12.00 GiB (3071 extents).
Logical volume VAR/var successfully resized.

d、resize2fs /dev/VAR/var
[root@localhost ~]# resize2fs /dev/VAR/var
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/VAR/var is mounted on /var; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/VAR/var is now 3144704 blocks long.

df -Th能看到/dev/VAR/var已經擴容

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

济南市| 西青区| 馆陶县| 兴化市| 维西| 滨州市| 鹤庆县| 当涂县| 阳原县| 正安县| 安新县| 宁波市| 济南市| 金阳县| 同仁县| 星座| 英超| 盐池县| 阿图什市| 三河市| 保亭| 大竹县| 泉州市| 克什克腾旗| 维西| 莲花县| 阜南县| 合作市| 开江县| 鄄城县| 陇南市| 永济市| 忻城县| 彰化市| 南阳市| 罗城| 伊金霍洛旗| 金坛市| 屏山县| 新巴尔虎左旗| 尖扎县|