lvscan命令查看LVM卷
扫描新加入的磁盘:echo “- - -” > /sys/class/scsi_host/host0/scan
第一步检查磁盘是否挂载
[root@idsnginx1 logs]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM
第二步如果没有发现新加的磁盘,执行磁盘扫描命令
[root@idsnginx1 logs]# echo “- - -” > /sys/class/scsi_host/host0/scan
第三步重新扫描磁盘,可以看到新加的磁盘sdb
[root@idsnginx1 logs]# fdisk -l
Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn’t contain a valid partition table
第四步将新加磁盘分区
[root@idsnginx1 logs]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 13054.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:

  1. software that runs at boot time (e.g., old versions of LILO)
  2. booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054):
Using default value 13054

Command (m for help): m
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): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
第五步检查磁盘是否已分区
[root@idsnginx1 logs]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 83 Linux
第六步格式化分区
[root@idsnginx1 logs]# mkfs.ext3 /dev/sdb1(mkfs -t xfs /dev/sdb1)
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 26214055 blocks
1310702 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
第七步将磁盘分区表变化通知内核
[root@idsnginx1 logs]# partprobe /dev/sdb1
第八步将新加分区配置为PV模式
[root@idsnginx1 logs]# pvcreate /dev/sdb1
Writing physical volume data to disk “/dev/sdb1”
Physical volume “/dev/sdb1” successfully created
第九步将新增的PV加入现有VG
[root@idsnginx1 logs]# vgextend LVMgroup-root /dev/sdb1(vgextend centos /dev/sdb1)
Volume group “LVMgroup-root” not found
[root@idsnginx1 logs]# vgextend LVMgroup /dev/sdb1
Volume group “LVMgroup” successfully extended
第十步扩容分区所在的LV
[root@idsnginx1 logs]# lvextend -l +100%FREE /dev/mapper/LVMgroup-root(lvextend -l +100%FREE /dev/mapper/centos-root)
Extending logical volume root to 141.84 GB
Logical volume root successfully resized
第十一步调整分区大小
[root@idsnginx1 logs]# resize2fs /dev/mapper/LVMgroup-root
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/LVMgroup-root is mounted on /; on-line resizing required
Performing an on-line resize of /dev/mapper/LVMgroup-root to 37183488 (4k) blocks.
The filesystem on /dev/mapper/LVMgroup-root is now 37183488 blocks long.

fd[root@idsnginx1 logs]#

报错使用
xfs_growfs /dev/mapper/centos-root

Linux系统扩容硬盘相关推荐

  1. linux系统 opt扩容,Linux系统扩容根目录磁盘空间的操作方法

    一.使用背景 Linux根目录磁盘空间不够用了,当修改了虚拟机模版增加磁盘大小或者插入了一块新硬盘,但是发现系统里的大小还是没改变. 产生的原因是没有给磁盘格式化,没有增加分区. 二.操作方法 1. ...

  2. linux 系统迁移到固态硬盘,windows 和 Linux 系统 从硬盘迁移到SSD

    windows 和 Linux 系统 从硬盘迁移到SSD 1. Windows 实验室这次搞了几块三星的ssd,型号是:三星(SAMSUNG) 850 EVO 250G SATA3 固态硬盘 三星有个 ...

  3. 2021-11-22--中标麒麟-Linux系统扩容根目录磁盘空间

    title categories tags abbrlink date updated 中标麒麟-Linux系统扩容根目录磁盘空间 Linux 中标麒麟 yum 6db4 2021-11-22 15: ...

  4. linux系统新硬盘格式化,linux系统如何格式化一块硬盘?

    如果大家给windows系统装过硬盘的话,应该会对本文内容倍感亲切. 说说windows 让我们从一些问题开始: 当我们给win主机插入一块新的硬盘的时候,我们并不能在"我的电脑" ...

  5. 安装Ubuntu Linux系统时硬盘分区最合理的方法

    无论是安装Windows还是Linux操作系统,硬盘分区都是整个系统安装过程中最为棘手的环节,网上的一些Ubuntu Linux安装教程一般都是自动分区,给初学者带来很大的不便,下面我就根据多年来在装 ...

  6. Linux系统扩硬盘,Linux系统硬盘扩容

    1.查看硬盘已经用了99% $ df -h #查看硬盘已经使用了99% 文件系统 容量 已用 可用 已用% 挂载点 devtmpfs 2.0G 0 2.0G 0% /dev tmpfs 2.0G 12 ...

  7. linux系统在硬盘上安装程序,在硬盘中安装Linux操作系统最简单的方法

    通过Grub(多系统引导管理器)来安装 本人最近摸索Linux系统,想在本机上安装双系统,但我这老爷机上没有软驱,没有刻录机,下载的ISO文件只能存在硬盘上,也只能通过硬盘来安装,在各大Linux的B ...

  8. 同一个硬盘装多个linux系统,在一个硬盘上安装两个Linux操作系统方法

    一个硬盘已安装Fedora 8 Linux系统,并安装grub引导管理程序,现要在这个硬盘的 空闲分区中安装Fedora 9,操作如下: 1.将Fedora-9-i386-DVD.iso文件放到一个W ...

  9. linux系统在硬盘上安装程序,怎么样用硬盘上的镜象文件来安装Linux系统?我都进入安装界面了,但是那个安装程序好像找不到那几个镜象文件,请指点...

    怎么样用硬盘上的镜象文件来安装Linux系统?我都进入安装界面了,但是那个安装程序好像找不到那几个镜象文件,请指点 光盘镜象文件名字为: 5.1-RELEASE-i386-disc1.iso 5.1- ...

  10. Linux系统中硬盘的管理

    磁盘数据块大小的由来 在我们的硬件平台上,CPU不能直接读取硬盘上的数据,而是通过内存先将硬盘上的数据读入并保存,在x86平台上,32位的处理器只能寻址到4G大小的内存空间,内存的存储单元是被编址的, ...

最新文章

  1. 038_JavaScript对象
  2. ICLR 2017 | GAN Missing Modes 和 GAN
  3. CLR运行时细节 - Method Descriptor
  4. 开源分布式搜索平台ELK+Redis+Syslog-ng实现日志实时搜索
  5. 硬盘使用GPT方式安装windows 10方法
  6. mysql数据库中excel数据的导入与导出
  7. JSON与MAP之间的转换
  8. linux设置最大打开文件数
  9. Zabbix监控Redis状态
  10. 一个简单的完全信息动态博弈的解答
  11. matlab 2020b linux版本 下载
  12. secoclient-linux-64 安装与卸载
  13. iOS 集成友盟分享图片链接为http时无法加载问题解决
  14. PMP扫盲篇2 | PMP报名、缴费、考试那些事儿~~
  15. Asp.net 使用weboffice实现Word在线编辑
  16. 高科技玩具这么无趣,为何还要鼓励孩子玩?
  17. RK61键盘使用说明书
  18. 浏览器的收藏夹在哪里打开
  19. 血泪!pyinstaller打包文件过大的解决方法
  20. 【ZZULIOJ】1036: 某年某月有多少天

热门文章

  1. 计算机基础(2)— windows 防火墙对FTP服务器、HTTP服务器的影响
  2. 博弈论完全信息博弈思维导图
  3. 医疗器械安全知识小科普
  4. 《高等数学B(一)》笔记
  5. [Maven实战-许晓斌]-[第二章]-2.7-2.8 Mave安装的最优建议和安装小结
  6. 如何快捷地下载知乎中的视频
  7. 上网访问速度慢的原因(计算机网络常识)
  8. codeforces #630 F. Selection of Personnel
  9. Linux内核5.0版本五大模块及内核书籍推荐
  10. 互联网和大数据是什么意思_互联网包括大数据吗 大数据与互联网的关系是什么...