[Linux] Extend space of root disk in Linux7
[root@node1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 26G 17G 9.8G 63% / ★totally 26G
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 8.8M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/sda1 1014M 178M 837M 18% /boot
tmpfs 285M 16K 285M 1% /run/user/0
[root@node1 ~]# fdisk -l ★Check disk info
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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: 0x000db4a0
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 62914559 30407680 8e Linux LVM
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors ★New disk detected
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 /dev/mapper/centos-root: 27.9 GB, 27913093120 bytes, 54517760 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 /dev/mapper/centos-swap: 3221 MB, 3221225472 bytes, 6291456 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
[root@node1 ~]# parted -l ★Check disk partition
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 32.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1075MB 1074MB primary xfs boot
2 1075MB 32.2GB 31.1GB primary lvm
Error: /dev/sdb: unrecognised disk label
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-swap: 3221MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 3221MB 3221MB linux-swap(v1)
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-root: 27.9GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 27.9GB 27.9GB xfs
[root@node1 ~]# vgdisplay ★Check VG
--- Volume group ---
VG Name centos ★
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 <29.00 GiB
PE Size 4.00 MiB
Total PE 7423
Alloc PE / Size 7423 / <29.00 GiB
Free PE / Size 0 / 0
VG UUID hsgPKH-ONEj-HrAg-efnA-CT6E-c6jv-2yRixu
[root@node1 ~]# lvdisplay ★Check LV
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID jxntjj-2vw1-iZZl-rKGs-N0br-TueY-k7EcfQ
LV Write Access read/write
LV Creation host, time node1, 2019-01-09 15:27:52 +0900
LV Status available
# open 2
LV Size 3.00 GiB
Current LE 768
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/root ★this LV will be extended.
LV Name root
VG Name centos
LV UUID Hdc1jk-0TNj-7rze-F3Vr-XmVK-NeWe-1DGffp
LV Write Access read/write
LV Creation host, time node1, 2019-01-09 15:27:53 +0900
LV Status available
# open 1
LV Size <26.00 GiB
Current LE 6655
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
[root@node1 ~]# vgextend centos /dev/sdb ★First, extend VG
Physical volume "/dev/sdb" successfully created.
Volume group "centos" successfully extended
[root@node1 ~]# vgdisplay ★
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 48.99 GiB ★done.
PE Size 4.00 MiB
Total PE 12542
Alloc PE / Size 7423 / <29.00 GiB
Free PE / Size 5119 / <20.00 GiB
VG UUID hsgPKH-ONEj-HrAg-efnA-CT6E-c6jv-2yRixu
[root@node1 ~]# lvextend -l +100%FREE /dev/centos/root ★Second, extend LV
Size of logical volume centos/root changed from <45.00 GiB (11519 extents) to 45.99 GiB (11774 extents).
Logical volume centos/root successfully resized.
[root@node1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID jxntjj-2vw1-iZZl-rKGs-N0br-TueY-k7EcfQ
LV Write Access read/write
LV Creation host, time node1, 2019-01-09 15:27:52 +0900
LV Status available
# open 2
LV Size 3.00 GiB
Current LE 768
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID Hdc1jk-0TNj-7rze-F3Vr-XmVK-NeWe-1DGffp
LV Write Access read/write
LV Creation host, time node1, 2019-01-09 15:27:53 +0900
LV Status available
# open 1
LV Size 45.99 GiB ★Done.
Current LE 11774
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
[root@node1 ~]# xfs_growfs /dev/centos/root ★Use xfs_growfs to extend the size of Filesystem.(Like resize2fs in Linux5)
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=1703680 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=6814720, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=3327, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 6814720 to 12056576
[root@node1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 46G 17G 30G 36% /
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 8.8M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/sda1 1014M 178M 837M 18% /boot
tmpfs 285M 20K 285M 1% /run/user/0
[Linux] Extend space of root disk in Linux7的更多相关文章
- linux下使用非root账号安装zabbix-client
linux下使用非root账号安装zabbix-client使用非root账号rusky登录:[rusky@testServer]#tar zxvf zabbix-2.4.5.tar.gz #cd z ...
- linux下mysql忘记root密码怎么办
Linux下MySQL忘记root密码怎么办? Linux下MySQL忘记root密码怎么办? 1. 修改MySQL配置文件 默认MySQL的配置文件为/etc/my.cnf,在[mysqld]下面添 ...
- linux中如何用root去修改其他用户的密码
linux中如何用root去修改其他用户的密码 昨天linux实验课,我有很多自己想摸索的东西.今天周五,本是下午一二节是编译的实验,可强烈的欲望让我今早就来实验室了,摸索吧,碰到了这个问题.... ...
- linux安装mysql后root无法登录 sql 无法登录
linux安装mysql后root无法登录 问题:[root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): ...
- skip-grant-tables 修改linux的mysql忘记root密码
skip-grant-tables 修改linux的mysql忘记root密码 今天修改mysql中的admin用户权限,在执行update user set host =' %' where use ...
- Linux忘记Mysql原来root的密码
Linux忘记Mysql原来root的密码 1.首先需要有linux操作系统root的权限 2.ps aux | grep mysql (或者 systemctl status mysql) 发现my ...
- linux开机出现Give root password for maintenance (or type Control-D to continue):解决办法
修改rc.local后导致 linux开机出现Give root password for maintenance,而且很多系统文件无法修改,之前的rc.local也不能修改了,单用户模式也无法进入 ...
- 运维笔记--linux下忘记mysql root密码
补充链接:Windows下忘记密码处理: https://www.cnblogs.com/hellojesson/p/5972950.html 场景描述: Linux环境下忘记 root 密码, 1. ...
- linux "No space left on device" 磁盘空间解决办法
某年某月某日某时,某人在工作中设置crontab定时任务规则保存时,提示“No space left on device”,此时用df -h检查磁盘,发现还有剩余空间.请问是什么原因及如何排查?什么会 ...
随机推荐
- Nuget安装包
Selenium.WebDriver Selenium.WebDriver.ChromeDriver Selenium.Firefox.WebDriver Selenium.WebDriver.IED ...
- 业务限流场景简单实现方案:RateLimiter
前因:因为本系统中,有大数据高并发的场景.在向下游系统发送请求的时候,需要限流.否则会造成下游系统的堵塞. 实现方案1: Thread.sleep(ms). 优点:简单粗暴,一行代码搞定 缺点:有点l ...
- chordDiagramFromMatrix()函数与circos.link()函数结合绘制箭头线
chordDiagramFromMatrix(matp2,annotationTrack="grid", grid.col = c(re ...
- 自定义 Cordova插件(基础篇)
cordova自定义插件 注意:存放自定义cordova插件目录不能有空格可能会报错 cordova的安装 下载node.js,安装完成后你可以在命令行中使用node和npm. 安装cordova使用 ...
- 移动vue项目,启动错误:Module build failed: Error: No PostCSS Config found in:
解决办法:在根目录新建postcss.config.js module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 versio ...
- mpvue开发项目总结(从0到上线)
1.简言 为期一个半月的小程序开发,其中夹杂其他项目的功能迭代,跌跌撞撞的将项目完成了,今天中秋节放假前一天,以此来记录下此次打怪升级的心得与分享其中遇到花费时间的问题. 因为此次开发的是一个类电商项 ...
- php(一)搭建php开发环境
1.下载php语言包 php作为一门语言,本身可以是一个纯绿色版的"文件夹"——称之为"php语言包".windows版的下载地址:https://window ...
- 前端JS基础知识
1. 原型 / 构造函数 / 实例 原型(prototype): 一个简单的对象,用于实现对象的 属性继承.可以简单的理解成对象的爹.在 Firefox 和 Chrome 中,每个JavaScript ...
- IE10打印预览无反应
1. 建议您打开IE后,按Alt键,选择”工具“-”兼容性视图设置“,将网站添加到兼容性视图列表中,看情况如何.2.internet选项-高级-启用保护模式 勾去掉 看看行不行3.按下“Windows ...
- 查看linux服务器上Tensorflow的版本和位置
查看tensorflow版本,可以在终端输入查询命令如下: python import tensorflow as tf tf.__version__ 查询tensorflow安装路径为: tf.__ ...