Linux磁盘扩容LVM_物理分区/dev/sdx容量扩大,怎么扩展 到lvm里去呢-程序员宅基地

技术标签: linux  

在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区。为了保证系统后期的可用性,建议所有新系统安装都采用LVM。

LVM结构图 
lvm结构图

扩容步骤 
1. 查看磁盘设备 
命令:# fdisk -l 
结果:

Disk /dev/sda: 697.9 GB, 697932185600 bytes
255 heads, 63 sectors/track, 84852 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: 0x00054716

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       39163   314059776   8e  Linux LVM
  • 找到需要扩展的磁盘设备

2.使用fdisk /dev/sda 对磁盘进行分区 
命令:# fdisk /dev/sda 
结果:

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 partit

   p
Partition number (1-4): 3
First cylinder (39163-84852, default 39163): 
Using default value 39163
Last cylinder, +cylinders or +size{K,M,G} (39163-84852, default 84852): 
Using default value 84852

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: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
  • 依次输入n,p, 3(分区号,根据实际情况配置),enter,enter ,最后按w保存 

之前最大分区号 
之前最大的分区号是2,所以将本分区号设置为3,本人理解。

3.使用fdisk -l查看分区是否创建成功 
命令: fdisk -l 
结果: 
本结果应该是有3个分区才正确,这里不给出结果内容

4.重启机器 
命令:# reboot 
因为只有重启后,才能正式生效。

5.格式化分区

[root@localhost ~]# ls -l /sbin/mkfs.*

-rwxr-xr-x. 1 root root 375240 Aug  7  2017 /sbin/mkfs.btrfs
-rwxr-xr-x. 1 root root  36984 Dec  2 07:28 /sbin/mkfs.cramfs
-rwxr-xr-x. 4 root root  96296 Aug  3  2017 /sbin/mkfs.ext2
-rwxr-xr-x. 4 root root  96296 Aug  3  2017 /sbin/mkfs.ext3
-rwxr-xr-x. 4 root root  96296 Aug  3  2017 /sbin/mkfs.ext4
-rwxr-xr-x. 1 root root  37104 Dec  2 07:28 /sbin/mkfs.minix
-rwxr-xr-x. 1 root root 368464 Aug  4  2017 /sbin/mkfs.xfs

[root@localhost ~]# mkfs.xfs /dev/sdb1

6.挂载分区 mount /dev/sdb1 /data

7.加入自启动 vi /etc/fstab

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/magerguo/article/details/79761474

智能推荐

约瑟夫环的数学公式推导_约瑟夫出圈问题公式-程序员宅基地

文章浏览阅读6.7k次,点赞7次,收藏35次。约瑟夫环的数学方法解决 编写约瑟夫环程序时会发现,当我们把整个报数过程的人数N变的很大,例如到几百万,虽然在最后还是只剩下两个人报数,但也要循环几百万次才能确定最后留下来的那个人。这样程序执行的效率不高,会占用大量时间去执行循环的过程。有时会发生输出一直等待很长时间才能出来结果。经过查询资料,找到了约瑟夫环的数学解决方法,以及它的算法具体执行的过程来做分享。我们假设..._约瑟夫出圈问题公式

软件测试|Pytest必会使用autouse实现自动传参-程序员宅基地

文章浏览阅读120次。1.薪资丰厚: 基本薪资+绩效+项目奖金+年终奖2.福利: 和正式员工福利基本看齐,共享工位,免费夜宵,班车,一流办公环境,月末周六双倍工资3.技术栈:C/C+当用例很多的时候,每次。不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦。不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦。

基于51单片机冰箱温度控制器设计_基于51单片机的智能冰箱控制系统设计-程序员宅基地

文章浏览阅读871次,点赞11次,收藏3次。*单片机设计介绍, 基于51单片机冰箱温度控制器设计。_基于51单片机的智能冰箱控制系统设计

ubuntu创建sftp和ftp服务器及相应的用户管理_ubuntu sftp服务器查看用户和密码-程序员宅基地

文章浏览阅读4.8k次。一、sftp服务器进入root模式(下面的操作默认都是在root用户下)#安装openssh-serverapt-get install -y openssh-server创建sftp的组和用户#创建sftp-users组groupadd sftp-users#创建sftp用户目录alicemkdir /home/alice#创建sftp用户alice,并且绑定其主目..._ubuntu sftp服务器查看用户和密码

关于在simulink中使用s-function后出现State derivatives returned by S-function during flag=1 call must be a rea_state derivatives returned by s-function 'pmsm' in-程序员宅基地

文章浏览阅读5.9k次,点赞9次,收藏16次。解决了在simulink中使用s-function遇到的报错:State derivatives returned by S-function 'demo' in 'test/S-Function' during flag=1 call must be a real vector of length 2 _state derivatives returned by s-function 'pmsm' in 'ipmsm/ipmsm/s-function1

Sublime Text 关闭自动更新 | Mac_mac sublime text 取消更新提示-程序员宅基地

文章浏览阅读3.1k次。1. 打开配置文件Mac 如下图2. 在文件内部添加这段文字,就可以了:"update_check":false _mac sublime text 取消更新提示

随便推点

关于g2o_viewer data/result_after.g2o使用过程中coredump、与lsd_slam依赖包libg2o冲突问题_libg2o_-程序员宅基地

文章浏览阅读1.1k次。电脑上装的东西多了就很容引起版本或者依赖问题。。。这不,按照高博教程做octomap实验时候运行g2o_viewer data/result_after.g2o时候就直接coredump。。。。回想起来自己ROS系统中装了libg2o,于是卸载之:sudo apt-get remove ros-indigo-libg2o然后重新执行g2o_viewer data/result_after.g2o注..._libg2o_

学习通选修刷课使用过程(懂得都懂)_学习通脚本-程序员宅基地

文章浏览阅读2w次,点赞58次,收藏268次。学习通不想好好上课系列_学习通脚本

将Total Commander设置为“默认”文件管理器?_total commander默认文件管理器-程序员宅基地

文章浏览阅读1.6k次。将Total Commander设置为“默认”文件管理器?法一:开始,运行,输入regedit ,回车: 定位到HKEY_LOCAL_MACHINE_total commander默认文件管理器

C#反序列化无法找到程序集_未能找到程序集“g:\c#%5cc#%20%e4%b8%8a%e4%bd%8d%e6%9c%ba%5-程序员宅基地

文章浏览阅读7.7k次。反序列化无法找到程序集提示找不到程序集. 原因是序列化时把序列化类的命名空间等信息保存了,但应用程序和类库的命名空间可能是不一样的,所以提示找不到程序集. 解决方法如下: 方法1.将dll加入强名称,注册到全局程序集缓存中 方法2.在反序列化使用的IFormatter 对象加入Binder 属性,使其获取要反序列化的对象所在的程序集_未能找到程序集“g:\c#%5cc#%20%e4%b8%8a%e4%bd%8d%e6%9c%ba%5c%e7%a9%ba%e5%8e%8

Jet-Lube EZY-Turn Kopr-Kote Deacon_dpezy-程序员宅基地

文章浏览阅读234次。Jet-Lube EZY-Turn Kopr-Kote Deacon Moly-Lith 12|34 21 (Oilfield) 21 (Water Well) 21 Arctic (Oilfield) 21 Arctic (Water Well) 550 Extreme 550 Extreme All Weather 713-670-5700 769 Lubricant 930 Whitmore Drive Alco-EP Alco-EP ECF Alco-EP-73 Plus AP-1 AP-1W _dpezy

mpi4py 中的单边通信相关操作_win.fence() win.free()-程序员宅基地

文章浏览阅读511次。本文从本人简书博客同步过来在上一篇中我们简要地介绍了 mpi4py 中的单边通信概念,下面我们将介绍单边通信的相关操作。创建/释放窗口对象注意:在使用单边通信操作之前,所有进程都须通过共同参与的创建窗口操作公开声明自己可供访问的内存空间。创建和释放窗口对象的方法(MPI.Win 类方法)接口如下:Create(type cls, memory, int disp_unit=..._win.fence() win.free()

推荐文章

热门文章

相关标签