linux擴充套件根目錄大小
df命令檢視自己的/目錄屬於哪個邏輯卷(我們要做的是對邏輯卷擴充套件)
[root@redhat6-3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_redhat63-lv_root
18102140 1298416 15884172 8% /
tmpfs 124592 0 124592 0% /dev/shm
/dev/sda1 495844 29859 440385 7% /boot
新加一塊硬碟,我的是sdb 先建立物理卷
[root@redhat6-3 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xce359e4e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1): (回車,預設將所有空間分配給第一個主分割槽)
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):
Using default value 261
Command (m for help): t(修改磁碟格式為LVM)
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
再次檢視磁碟情況
[root@redhat6-3 ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00085274
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 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: 0xce359e4e
Device Boot Start End Blocks Id System
/dev/sdb1 1 261 2096451 8e Linux LVM
將新建立的主分割槽建立為物理卷
[root@redhat6-3 ~]# pvcreate /dev/sdb1
Writing physical volume data to disk "/dev/sdb1"
Physical volume "/dev/sdb1" successfully created
檢視根目錄所屬的卷組和邏輯卷
[root@redhat6-3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_redhat63-lv_root
(此處說明卷組是vg_redhat63邏輯卷是/dev/mapper/vg_redhat63-lv_root)
18102140 1298416 15884172 8% /
tmpfs 124592 0 124592 0% /dev/shm
/dev/sda1 495844 29859 440385 7% /boot
將剛建立的物理卷/dev/sdb1新增到卷組中
[root@redhat6-3 ~]# vgextend vg_redhat63 /dev/sdb1
Volume group "vg_redhat63" successfully extended
將卷組的1GB擴充套件給根所在的邏輯卷
[root@redhat6-3 ~]# lvextend -L +1G /dev/mapper/vg_redhat63-lv_root
Extending logical volume lv_root to 18.54 GiB
Logical volume lv_root successfully resized
啟用修改的配置
[root@redhat6-3 ~]# resize2fs /dev/mapper/vg_redhat63-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_redhat63-lv_root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/mapper/vg_redhat63-lv_root to 4859904 (4k) blocks.
The filesystem on /dev/mapper/vg_redhat63-lv_root is now 4859904 blocks long.
檢視系統情況
[root@redhat6-3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_redhat63-lv_root
19134332 1298424 16868444 8% /
tmpfs 124592 0 124592 0% /dev/shm
/dev/sda1 495844 29859 440385 7% /boot
之前的系統
[root@redhat6-3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_redhat63-lv_root
18102140 1298416 15884172 8% /
tmpfs 124592 0 124592 0% /dev/shm
/dev/sda1 495844 29859 440385 7% /boot
根目錄成功擴充套件1G空間
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-776558/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos 擴充套件root根分割槽的大小CentOS套件
- lvm 線上擴充 / 目錄的大小LVM
- centos7 新增磁碟到/(根目錄下),擴充套件VG卷和lvCentOS套件
- 如何在 Linux 中擴充套件 XFS 根分割槽Linux套件
- VMware虛擬機器Linux系統根目錄空間擴充操作虛擬機Linux
- 擴充套件資料檔案大小套件
- VMware之Ubuntu20.04擴充根目錄磁碟空間Ubuntu
- Linux下擴充套件根檔案系統所在的分割槽Linux套件
- centerOs根目錄盤擴容筆記ROS筆記
- 【記錄】安裝 maxminddb 擴充套件套件
- [記錄] 安裝 maxminddb 擴充套件套件
- kotlin 擴充套件(擴充套件函式和擴充套件屬性)Kotlin套件函式
- 題目4:棋盤尋寶擴充套件套件
- linux檢視目錄大小及硬碟大小Linux硬碟
- 【記錄】安裝 Xdebug 擴充套件套件
- [記錄] 安裝 Xdebug 擴充套件套件
- 列出並排序檔案系統根目錄(/)下各個目錄的大小排序
- php新增pcntl擴充套件(Linux)PHP套件Linux
- 擴充套件Linux網路棧套件Linux
- Linux擴充套件邏輯卷Linux套件
- WCF擴充套件:行為擴充套件Behavior Extension套件
- 【Kotlin】擴充套件屬性、擴充套件函式Kotlin套件函式
- 【記錄】編譯安裝 ProtoBuf 擴充套件編譯套件
- [記錄] 編譯安裝 ProtoBuf 擴充套件編譯套件
- 【記錄】編譯安裝 YAML 擴充套件編譯YAML套件
- [記錄] 編譯安裝 YAML 擴充套件編譯YAML套件
- 記錄Laravel開發常用擴充套件包Laravel套件
- Linux 上安裝 PHP 擴充套件LinuxPHP套件
- Linux擴充套件LVM空間Linux套件LVM
- Linux 檔案系統擴充套件Linux套件
- Sanic 擴充套件套件
- ORACLE 擴充套件Oracle套件
- 擴充套件工具套件
- 擴充套件歐幾里得套件
- DOM擴充套件套件
- 擴充套件ACL套件
- Lua擴充套件套件
- 照片擴充套件套件