Linux硬盘扩容LVM逻辑卷管理详细操作手册(个人实际操作整理版)

Linux6.4硬盘扩容LVM逻辑卷管理操作手册
1. 对新增加的硬盘进行分区、格式化
1.1. 用root用户登录系统
使用SSH客户端登录Linux服务器。
1.2. 查看挂载情况(此步可省略)
(加上-T这个参数,就可以列出所有系统挂载的分区的文件类型信息)
[root@servername ~]# df -lh
文件系统              容量  已用  可用 已用%% 挂载点
教育评价
/dev/sda3              95G  4.0G  86G  5% /
tmpfs                3.9G  72K  3.9G  1% /dev/shm
/dev/sda1            388M  37M  331M  10% /boot
[root@servername ~]#
1.3. 查看磁盘情况(此步不建议省略)
下方字为要创建分区的硬盘。
[root@servername ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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
2013年春季流行女装Disk identifier: 0x000bf627
  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          52      409600  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              52        574    4194304  82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3            574      13055  100252672  83  Linux
Disk /dev/sdb桑塔纳2000机油: 1073.7 GB, 1073741824000 bytes
日本合气道255 heads, 63 sectors/track, 130541 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: 0x00000000
[root@servername ~]#
1.4. 创建分区
下方字为要创建分区的硬盘注意跟上面查看到的要对应。
[root@servername ~]# 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 0x883e515a.
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      分区编号选1,如果被占依此类推
First cylinder (1-130541, default 1): 按回车    默认(起始扇区
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130541, default 130541): 按回车  默认(结束扇区)也可以使用长泾中学+100M即创建100M分区 也可以使用(K,M,G)
Using default value 130541
Command (m for help): w    写分区表(可以输入t进行分区格式调整,见1.6调整分区格式
The partition table has been altered!
Calling ioctl() to re-read partition table.
panelSyncing disks.
[root@servername ~]#
1.5. 重新查看磁盘情况(此步可省略)
下方字为新创建的磁盘分区信息。
[root@servername ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x000bf627
  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          52      409600  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              52        574    4194304  82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3            574      13055  100252672  83  Linux
Disk /dev/sdb: 1073.7 GB, 1073741824000 bytes
255 heads, 63 sectors/track, 130541 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

本文发布于:2024-09-21 22:27:32,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/399017.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:分区   硬盘   查看   扇区   登录   挂载   系统   默认
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议