【2018.04.11学习笔记】【linux基础知识4.10-4.13】

4.10-4.12 lvm讲解

lvm逻辑卷管理: lvm出现问题的时候,数据不易恢复。一般生成环境中比较少用,用raid比较多。

创建逻辑卷详细操作步骤如下:

1、新增磁盘里/dev/sdb 分三个主分区 id为83:sdb1、sdb2、sdb3,分别都是1G的容量

[root@lgs-01 ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。


命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
分区号 (1-4,默认 1):
起始 扇区 (2048-20971519,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-20971519,默认为 20971519):+1G
分区 1 已设置为 Linux 类型,大小设为 1 GiB

命令(输入 m 获取帮助):n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
分区号 (2-4,默认 2):
起始 扇区 (2099200-20971519,默认为 2099200):
将使用默认值 2099200
Last 扇区, +扇区 or +size{K,M,G} (2099200-20971519,默认为 20971519):+1G    
分区 2 已设置为 Linux 类型,大小设为 1 GiB

命令(输入 m 获取帮助):n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
分区号 (3,4,默认 3):
起始 扇区 (4196352-20971519,默认为 4196352):
将使用默认值 4196352
Last 扇区, +扇区 or +size{K,M,G} (4196352-20971519,默认为 20971519):+1G
分区 3 已设置为 Linux 类型,大小设为 1 GiB

命令(输入 m 获取帮助):p

磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x3ee87830

   设备 Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     2099199     1048576   83  Linux
/dev/sdb2         2099200     4196351     1048576   83  Linux
/dev/sdb3         4196352     6293503     1048576   83  Linux

2、把分区类型改为8e的lvm类型:

命令(输入 m 获取帮助):t     
分区号 (1-3,默认 3):1
Hex 代码(输入 L 列出所有代码):8e
已将分区“Linux”的类型更改为“Linux LVM”

命令(输入 m 获取帮助):t
分区号 (1-3,默认 3):2
Hex 代码(输入 L 列出所有代码):8e
已将分区“Linux”的类型更改为“Linux LVM”

命令(输入 m 获取帮助):t
分区号 (1-3,默认 3):3
Hex 代码(输入 L 列出所有代码):8e
已将分区“Linux”的类型更改为“Linux LVM”

命令(输入 m 获取帮助):p

磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x3ee87830

   设备 Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     2099199     1048576   8e  Linux LVM
/dev/sdb2         2099200     4196351     1048576   8e  Linux LVM
/dev/sdb3         4196352     6293503     1048576   8e  Linux LVM

命令(输入 m 获取帮助):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
正在同步磁盘。

3、创建物理卷:pvcreate命令

[root@lgs-01 ~]# pvcreate /dev/sdb1
-bash: pvcreat: 未找到命令
[root@lgs-01 ~]# yum provides "/*/pvcreate"
已加载插件:fastestmirror
Determining fastest mirrors
 * base: mirrors.cn99.com
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
extras/7/x86_64/filelists_db                                                                                                   | 709 kB  00:00:00     
1:bash-completion-2.1-6.el7.noarch : Programmable completion for Bash
源    :base
匹配来源:
文件名    :/usr/share/bash-completion/completions/pvcreate

7:lvm2-2.02.171-8.el7.x86_64 : Userland logical volume management tools
源    :base
匹配来源:
文件名    :/usr/sbin/pvcreate

[root@lgs-01 ~]# yum install -y lvm2
已加载插件:fastestmirror
base                                                                                                                           | 3.6 kB  00:00:00     
extras                                                                                                                         | 3.4 kB  00:00:00     
updates                                                                                                                        | 3.4 kB  00:00:00     
updates/7/x86_64/primary_db                                                                                                    | 6.9 MB  00:00:06     
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 lvm2.x86_64.7.2.02.171-8.el7 将被 安装
--> 正在处理依赖关系 lvm2-libs = 7:2.02.171-8.el7,它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在处理依赖关系 device-mapper-persistent-data >= 0.7.0-0.1.rc6,它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在处理依赖关系 liblvm2app.so.2.2(Base)(64bit),它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在处理依赖关系 libdevmapper-event.so.1.02(Base)(64bit),它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在处理依赖关系 liblvm2app.so.2.2()(64bit),它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在处理依赖关系 libdevmapper-event.so.1.02()(64bit),它被软件包 7:lvm2-2.02.171-8.el7.x86_64 需要
--> 正在检查事务
---> 软件包 device-mapper-event-libs.x86_64.7.1.02.140-8.el7 将被 安装
---> 软件包 device-mapper-persistent-data.x86_64.0.0.7.0-0.1.rc6.el7_4.1 将被 安装
--> 正在处理依赖关系 libaio.so.1(LIBAIO_0.4)(64bit),它被软件包 device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64 需要
--> 正在处理依赖关系 libaio.so.1(LIBAIO_0.1)(64bit),它被软件包 device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64 需要
--> 正在处理依赖关系 libaio.so.1()(64bit),它被软件包 device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64 需要
---> 软件包 lvm2-libs.x86_64.7.2.02.171-8.el7 将被 安装
--> 正在处理依赖关系 device-mapper-event = 7:1.02.140-8.el7,它被软件包 7:lvm2-libs-2.02.171-8.el7.x86_64 需要
--> 正在检查事务
---> 软件包 device-mapper-event.x86_64.7.1.02.140-8.el7 将被 安装
---> 软件包 libaio.x86_64.0.0.3.109-13.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

======================================================================================================================================================
 Package                                          架构                      版本                                     源                          大小
======================================================================================================================================================
正在安装:
 lvm2                                             x86_64                    7:2.02.171-8.el7                         base                       1.3 M
为依赖而安装:
 device-mapper-event                              x86_64                    7:1.02.140-8.el7                         base                       180 k
 device-mapper-event-libs                         x86_64                    7:1.02.140-8.el7                         base                       179 k
 device-mapper-persistent-data                    x86_64                    0.7.0-0.1.rc6.el7_4.1                    updates                    400 k
 libaio                                           x86_64                    0.3.109-13.el7                           base                        24 k
 lvm2-libs                                        x86_64                    7:2.02.171-8.el7                         base                       1.0 M

事务概要
======================================================================================================================================================
安装  1 软件包 (+5 依赖软件包)

总下载量:3.1 M
安装大小:7.7 M
Downloading packages:
(1/6): libaio-0.3.109-13.el7.x86_64.rpm                                                                                        |  24 kB  00:00:00     
(2/6): device-mapper-event-1.02.140-8.el7.x86_64.rpm                                                                           | 180 kB  00:00:00     
(3/6): device-mapper-event-libs-1.02.140-8.el7.x86_64.rpm                                                                      | 179 kB  00:00:00     
(4/6): device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64.rpm                                                          | 400 kB  00:00:01     
(5/6): lvm2-libs-2.02.171-8.el7.x86_64.rpm                                                                                     | 1.0 MB  00:00:01     
(6/6): lvm2-2.02.171-8.el7.x86_64.rpm                                                                                          | 1.3 MB  00:00:02     
------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                  1.2 MB/s | 3.1 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 7:device-mapper-event-libs-1.02.140-8.el7.x86_64                                                                                  1/6 
  正在安装    : 7:device-mapper-event-1.02.140-8.el7.x86_64                                                                                       2/6 
  正在安装    : 7:lvm2-libs-2.02.171-8.el7.x86_64                                                                                                 3/6 
  正在安装    : libaio-0.3.109-13.el7.x86_64                                                                                                      4/6 
  正在安装    : device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64                                                                        5/6 
  正在安装    : 7:lvm2-2.02.171-8.el7.x86_64                                                                                                      6/6 
Created symlink from /etc/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket to /usr/lib/systemd/system/lvm2-lvmpolld.socket.
  验证中      : 7:device-mapper-event-libs-1.02.140-8.el7.x86_64                                                                                  1/6 
  验证中      : 7:device-mapper-event-1.02.140-8.el7.x86_64                                                                                       2/6 
  验证中      : 7:lvm2-libs-2.02.171-8.el7.x86_64                                                                                                 3/6 
  验证中      : device-mapper-persistent-data-0.7.0-0.1.rc6.el7_4.1.x86_64                                                                        4/6 
  验证中      : 7:lvm2-2.02.171-8.el7.x86_64                                                                                                      5/6 
  验证中      : libaio-0.3.109-13.el7.x86_64                                                                                                      6/6 

已安装:
  lvm2.x86_64 7:2.02.171-8.el7                                                                                                                        

作为依赖被安装:
  device-mapper-event.x86_64 7:1.02.140-8.el7                                     device-mapper-event-libs.x86_64 7:1.02.140-8.el7                   
  device-mapper-persistent-data.x86_64 0:0.7.0-0.1.rc6.el7_4.1                    libaio.x86_64 0:0.3.109-13.el7                                     
  lvm2-libs.x86_64 7:2.02.171-8.el7                                              

完毕!
[root@lgs-01 ~]# pvcreate /dev/sdb1
WARNING: dos signature detected on /dev/sdb1 at offset 510. Wipe it? [y/n]: y
  Wiping dos signature on /dev/sdb1.
  Physical volume "/dev/sdb1" successfully created.
[root@lgs-01 ~]# pvcreate /dev/sdb2
  Physical volume "/dev/sdb2" successfully created.
[root@lgs-01 ~]# pvcreate /dev/sdb3
WARNING: ext4 signature detected on /dev/sdb3 at offset 1080. Wipe it? [y/n]: y
  Wiping ext4 signature on /dev/sdb3.
  Physical volume "/dev/sdb3" successfully created.
[root@lgs-01 ~]# pvdisplay
  "/dev/sdb2" is a new physical volume of "1.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb2
  VG Name               
  PV Size               1.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               EoP8W8-B3x1-V2FW-kyY9-dHhy-6eIh-StZvVB
   
  "/dev/sdb1" is a new physical volume of "1.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name               
  PV Size               1.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               m8V6a8-xkMn-W5tX-YAIQ-30Xz-dqNz-TvZ6yS
   
  "/dev/sdb3" is a new physical volume of "1.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb3
  VG Name               
  PV Size               1.00 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               DrJCcW-NoZ3-1zUk-u3OE-PdET-rLAb-eyXCyd

查看物理卷pvdisplay或者pvs命令。

pvremove:删除物理卷

4、创建卷组:vgcreate

[root@lgs-01 ~]# vgcreate vg1 /dev/sdb1 /dev/sdb2
  Volume group "vg1" successfully created
[root@lgs-01 ~]# vgdisplay
  --- Volume group ---
  VG Name               vg1
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               1.99 GiB
  PE Size               4.00 MiB
  Total PE              510
  Alloc PE / Size       0 / 0   
  Free  PE / Size       510 / 1.99 GiB
  VG UUID               52fM6w-9Z59-cxCG-S41h-hRqV-i76f-nUmE3j
   
[root@lgs-01 ~]# vgs
  VG  #PV #LV #SN Attr   VSize VFree
  vg1   2   0   0 wz--n- 1.99g 1.99g

查看卷组:vgdisplay或者vgs命令。删除卷组:vgremove命令

5、创建逻辑卷:lvcreate

[root@lgs-01 ~]# lvcreate -L 200M -n lv1 vg1
WARNING: ext4 signature detected on /dev/vg1/lv1 at offset 1080. Wipe it? [y/n]: y
  Wiping ext4 signature on /dev/vg1/lv1.
  Logical volume "lv1" created.
[root@lgs-01 ~]# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1  vg1 -wi-a----- 200.00m

6、格式化逻辑卷、挂载逻辑卷:

[root@lgs-01 ~]# mkfs.ext4 /dev/vg1/lv1
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
51200 inodes, 204800 blocks
10240 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=33816576
25 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345, 73729

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (4096 blocks): 完成
Writing superblocks and filesystem accounting information: 完成 

[root@lgs-01 ~]# mkdir /mntlv1
[root@lgs-01 ~]# mount /dev/vg1/lv1 /mnt
mnt/    mnt1/   mntlv1/ 
[root@lgs-01 ~]# mount /dev/vg1/lv1 /mntlv1/
[root@lgs-01 ~]# df -h
文件系统             容量  已用  可用 已用% 挂载点
/dev/sda3             16G  1.2G   15G    8% /
devtmpfs             902M     0  902M    0% /dev
tmpfs                912M     0  912M    0% /dev/shm
tmpfs                912M  8.6M  904M    1% /run
tmpfs                912M     0  912M    0% /sys/fs/cgroup
/dev/sda1            197M  113M   84M   58% /boot
tmpfs                183M     0  183M    0% /run/user/0
/dev/mapper/vg1-lv1  190M  1.6M  175M    1% /mntlv1
[root@lgs-01 ~]# ls -l /dev/vg1/lv1
lrwxrwxrwx. 1 root root 7 4月  12 12:37 /dev/vg1/lv1 -> ../dm-0
[root@lgs-01 ~]# ls -l /dev/mapper/vg1-lv1
lrwxrwxrwx. 1 root root 7 4月  12 12:37 /dev/mapper/vg1-lv1 -> ../dm-0

扩容逻辑卷:lvresize 。逻辑卷存在的价值就是很方便的扩容缩容

先卸载,在进行扩容操作。

[root@lgs-01 ~]# umount /mntlv1
[root@lgs-01 ~]# df -h
文件系统        容量  已用  可用 已用% 挂载点
/dev/sda3        16G  1.2G   15G    8% /
devtmpfs        902M     0  902M    0% /dev
tmpfs           912M     0  912M    0% /dev/shm
tmpfs           912M  8.6M  904M    1% /run
tmpfs           912M     0  912M    0% /sys/fs/cgroup
/dev/sda1       197M  113M   84M   58% /boot
tmpfs           183M     0  183M    0% /run/user/0
[root@lgs-01 ~]# lvresize -L 300M /dev/vg1/lv1
  Size of logical volume vg1/lv1 changed from 200.00 MiB (50 extents) to 300.00 MiB (75 extents).
  Logical volume vg1/lv1 successfully resized.

检测扩容后的磁盘:e2fsck

[root@lgs-01 ~]# e2fsck -f /dev/vg1/lv1
e2fsck 1.42.9 (28-Dec-2013)
第一步: 检查inode,块,和大小
第二步: 检查目录结构
第3步: 检查目录连接性
Pass 4: Checking reference counts
第5步: 检查簇概要信息
/dev/vg1/lv1: 11/51200 files (0.0% non-contiguous), 12115/204800 blocks

更新扩容后的lv信息:resize2fs

[root@lgs-01 ~]# resize2fs /dev/vg1/lv1
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/vg1/lv1 to 307200 (1k) blocks.
The filesystem on /dev/vg1/lv1 is now 307200 blocks long.

[root@lgs-01 ~]# mount /dev/vg1/lv1 /mntlv1/
[root@lgs-01 ~]# df -h
文件系统             容量  已用  可用 已用% 挂载点
/dev/sda3             16G  1.2G   15G    8% /
devtmpfs             902M     0  902M    0% /dev
tmpfs                912M     0  912M    0% /dev/shm
tmpfs                912M  8.6M  904M    1% /run
tmpfs                912M     0  912M    0% /sys/fs/cgroup
/dev/sda1            197M  113M   84M   58% /boot
tmpfs                183M     0  183M    0% /run/user/0
/dev/mapper/vg1-lv1  287M  2.1M  266M    1% /mntlv1

缩容逻辑卷:

[root@lgs-01 ~]# umount /mntlv1/
[root@lgs-01 ~]# e2fsck -f /dev/vg1/lv1
e2fsck 1.42.9 (28-Dec-2013)
第一步: 检查inode,块,和大小
第二步: 检查目录结构
第3步: 检查目录连接性
Pass 4: Checking reference counts
第5步: 检查簇概要信息
/dev/vg1/lv1: 11/77824 files (0.0% non-contiguous), 15987/307200 blocks

[root@lgs-01 ~]# resize2fs /dev/vg1/lv1 150M
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/vg1/lv1 to 153600 (1k) blocks.
The filesystem on /dev/vg1/lv1 is now 153600 blocks long.

[root@lgs-01 ~]# lvresize -L 150M /dev/vg1/lv1
  Rounding size to boundary between physical extents: 152.00 MiB.
  WARNING: Reducing active logical volume to 152.00 MiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce vg1/lv1? [y/n]: y
  Size of logical volume vg1/lv1 changed from 300.00 MiB (75 extents) to 152.00 MiB (38 extents).
  Logical volume vg1/lv1 successfully resized.
[root@lgs-01 ~]# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1  vg1 -wi-a----- 152.00m                                                    
[root@lgs-01 ~]# mount /dev/vg1/lv1 /mntlv1/
[root@lgs-01 ~]# df -h
文件系统             容量  已用  可用 已用% 挂载点
/dev/sda3             16G  1.2G   15G    8% /
devtmpfs             902M     0  902M    0% /dev
tmpfs                912M     0  912M    0% /dev/shm
tmpfs                912M  8.6M  904M    1% /run
tmpfs                912M     0  912M    0% /sys/fs/cgroup
/dev/sda1            197M  113M   84M   58% /boot
tmpfs                183M     0  183M    0% /run/user/0
/dev/mapper/vg1-lv1  142M  1.6M  130M    2% /mntlv1

xfs扩容,xfs不支持缩容:

[root@lgs-01 ~]# umount /mntlv1/

[root@lgs-01 ~]# mkfs.xfs -f /dev/vg1/lv1
meta-data=/dev/vg1/lv1           isize=512    agcount=4, agsize=9728 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=38912, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
 
[root@lgs-01 ~]# mount /dev/vg1/lv1 /mntlv1/
[root@lgs-01 ~]# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1  vg1 -wi-ao---- 152.00m                                                    

[root@lgs-01 ~]# lvresize -L 250M /dev/vg1/lv1
  Rounding size to boundary between physical extents: 252.00 MiB.
  Size of logical volume vg1/lv1 changed from 152.00 MiB (38 extents) to 252.00 MiB (63 extents).
  Logical volume vg1/lv1 successfully resized.

[root@lgs-01 ~]# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1  vg1 -wi-ao---- 252.00m          
                                          
[root@lgs-01 ~]# df -h
文件系统             容量  已用  可用 已用% 挂载点
/dev/sda3             16G  1.2G   15G    8% /
devtmpfs             902M     0  902M    0% /dev
tmpfs                912M     0  912M    0% /dev/shm
tmpfs                912M  8.7M  904M    1% /run
tmpfs                912M     0  912M    0% /sys/fs/cgroup
/dev/sda1            197M  113M   84M   58% /boot
tmpfs                183M     0  183M    0% /run/user/0
/dev/mapper/vg1-lv1  149M  7.8M  141M    6% /mntlv1

[root@lgs-01 ~]# xfs_growfs /dev/vg1/lv1
meta-data=/dev/mapper/vg1-lv1    isize=512    agcount=4, agsize=9728 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=38912, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 38912 to 64512

[root@lgs-01 ~]# df -h
文件系统             容量  已用  可用 已用% 挂载点
/dev/sda3             16G  1.2G   15G    8% /
devtmpfs             902M     0  902M    0% /dev
tmpfs                912M     0  912M    0% /dev/shm
tmpfs                912M  8.7M  904M    1% /run
tmpfs                912M     0  912M    0% /sys/fs/cgroup
/dev/sda1            197M  113M   84M   58% /boot
tmpfs                183M     0  183M    0% /run/user/0
/dev/mapper/vg1-lv1  249M  7.9M  241M    4% /mntlv1

扩容卷组:扩容完卷组后,再进行逻辑卷扩容就行了。

[root@lgs-01 ~]# vgextend vg1 /dev/sdb3
  Volume group "vg1" successfully extended
[root@lgs-01 ~]# vgs
  VG  #PV #LV #SN Attr   VSize  VFree
  vg1   3   1   0 wz--n- <2.99g 2.74g

4.13 磁盘故障小案例

修改fstab配置文件后,重启服务器开机报错,往往是磁盘挂载出错了。

可以输入root密码,进入系统,重新编辑fstab配置文件,再重启机器就行了。

转载于:https://my.oschina.net/u/3804114/blog/1794320

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值