加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

记录一次Centos系统下lvm逻辑分区扩容失败记录

(2022-07-25 18:09:22)
分类: IT相关
[root@datatangseafile ~]# lsblk
NAME                                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                     8:0     7.3T  0 disk
├─sda1                                  8:1     500M  0 part /boot
└─sda2                                  8:2     7.3T  0 part
  ├─vg_datatangseafile-lv_root (dm-0) 253:0      50G  0 lvm  /
  ├─vg_datatangseafile-lv_swap (dm-1) 253:1     7.6G  0 lvm
  └─vg_datatangseafile-lv_home (dm-2) 253:2     7.2T  0 lvm  /home
sdb                                     8:16    9.1T  0 disk
├─sdb1                                  8:17    499M  0 part
├─sdb2                                  8:18    100M  0 part
├─sdb3                                  8:19     16M  0 part
├─sdb4                                  8:20   0 133.7G  0 part
└─sdb5                                  8:21      9T  0 part

[root@datatangseafile ~]# df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                     ext4    50G  1.5G   46G   4% /
tmpfs                tmpfs  3.8G     3.8G   0% /dev/shm
/dev/sda1            ext4   477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                     ext4   7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 8001.6 GB, 8001563222016 bytes
255 heads, 63 sectors/track, 972801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1                   267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 10000.8 GB, 10000831348736 bytes
255 heads, 63 sectors/track, 1215865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1                   267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/vg_datatangseafile-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_datatangseafile-lv_swap: 8136 MB, 8136949760 bytes
255 heads, 63 sectors/track, 989 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_datatangseafile-lv_home: 7939.2 GB, 7939209297920 bytes
255 heads, 63 sectors/track, 965220 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

[root@datatangseafile ~]# lsblk
NAME                                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                     8:0     7.3T  0 disk
├─sda1                                  8:1     500M  0 part /boot
└─sda2                                  8:2     7.3T  0 part
  ├─vg_datatangseafile-lv_root (dm-0) 253:0      50G  0 lvm  /
  ├─vg_datatangseafile-lv_swap (dm-1) 253:1     7.6G  0 lvm
  └─vg_datatangseafile-lv_home (dm-2) 253:2     7.2T  0 lvm  /home
sdb                                     8:16    9.1T  0 disk
├─sdb1                                  8:17    499M  0 part
├─sdb2                                  8:18    100M  0 part
├─sdb3                                  8:19     16M  0 part
├─sdb4                                  8:20   0 133.7G  0 part
└─sdb5                                  8:21      9T  0 part

[root@datatangseafile ~]# pvcreate /dev/sdb5
  Physical volume "/dev/sdb5" successfully created
[root@datatangseafile ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  "/dev/sdb5" is a new physical volume of "8.96 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb5
  VG Name
  PV Size               8.96 TiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

[root@datatangseafile ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_datatangseafile
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               7.28 TiB
  PE Size               4.00 MiB
  Total PE              1907595
  Alloc PE / Size       1907595 / 7.28 TiB
  Free  PE / Size       0 / 0
  VG UUID               s7soE8-swut-DYbT-z5Rn-x9MQ-v8EC-tRGOLj


[root@datatangseafile ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn 't support GPT. Use GNU Parted.


Disk /dev/sda: 8001.6 GB, 8001563222016 bytes
255 heads, 63 sectors/track, 972801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1                   267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 10000.8 GB, 10000831348736 bytes
255 heads, 63 sectors/track, 1215865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1                   267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/vg_datatangseafile-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_datatangseafile-lv_swap: 8136 MB, 8136949760 bytes
255 heads, 63 sectors/track, 989 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_datatangseafile-lv_home: 7939.2 GB, 7939209297920 bytes
255 heads, 63 sectors/track, 965220 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

[root@datatangseafile ~]# lsblk
NAME                                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                     8:0     7.3T  0 disk
├─sda1                                  8:1     500M  0 part /boot
└─sda2                                  8:2     7.3T  0 part
  ├─vg_datatangseafile-lv_root (dm-0) 253:0      50G  0 lvm  /
  ├─vg_datatangseafile-lv_swap (dm-1) 253:1     7.6G  0 lvm
  └─vg_datatangseafile-lv_home (dm-2) 253:2     7.2T  0 lvm  /home
sdb                                     8:16    9.1T  0 disk
├─sdb1                                  8:17    499M  0 part
├─sdb2                                  8:18    100M  0 part
├─sdb3                                  8:19     16M  0 part
├─sdb4                                  8:20   0 133.7G  0 part
└─sdb5                                  8:21      9T  0 part
[root@datatangseafile ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  "/dev/sdb5" is a new physical volume of "8.96 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb5
  VG Name
  PV Size               8.96 TiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

[root@datatangseafile ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_datatangseafile
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               7.28 TiB
  PE Size               4.00 MiB
  Total PE              1907595
  Alloc PE / Size       1907595 / 7.28 TiB
  Free  PE / Size       0 / 0
  VG UUID               s7soE8-swut-DYbT-z5Rn-x9MQ-v8EC-tRGOLj

[root@datatangseafile ~]# vgextend vg_datatangseafile /dev/sdb5
  Volume group "vg_datatangseafile" successfully extended
[root@datatangseafile ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_datatangseafile
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               16.24 TiB
  PE Size               4.00 MiB
  Total PE              4257594
  Alloc PE / Size       1907595 / 7.28 TiB
  Free  PE / Size       2349999 / 8.96 TiB
  VG UUID               s7soE8-swut-DYbT-z5Rn-x9MQ-v8EC-tRGOLj

[root@datatangseafile ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                       50G  1.5G   46G   4% /
tmpfs                 3.8G     3.8G   0% /dev/shm
/dev/sda1             477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                      7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# lvextend -l +100%FREE /dev/mapper/vg_datatangseafile-lv_home
  Size of logical volume vg_datatangseafile/lv_home changed from 7.22 TiB (1892855 extents) to 16.19 TiB (4242854 extents).
  Logical volume lv_home successfully resized.
[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                       50G  1.5G   46G   4% /
tmpfs                 3.8G     3.8G   0% /dev/shm
/dev/sda1             477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                      7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                     ext4    50G  1.5G   46G   4% /
tmpfs                tmpfs  3.8G     3.8G   0% /dev/shm
/dev/sda1            ext4   477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                     ext4   7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# xfs_growfs /dev/mapper/vg_datatangseafile-lv_home
xfs_growfs: /dev/mapper/vg_datatangseafile-lv_home is not a mounted XFS filesystem

[root@datatangseafile ~]# resize2fs /dev/mapper/vg_datatangseafile-lv_home
resize2fs 1.41.12 (17-May-2010)
resize2fs: New size too large to be expressed in 32 bits

[root@datatangseafile ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                       50G  1.5G   46G   4% /
tmpfs                 3.8G     3.8G   0% /dev/shm
/dev/sda1             477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                      7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                       50G  1.5G   46G   4% /
tmpfs                 3.8G     3.8G   0% /dev/shm
/dev/sda1             477M   48M  404M  11% /boot
/dev/mapper/vg_datatangseafile-lv_home
                      7.2T  2.2T  4.6T  33% /home
[root@datatangseafile ~]# lvdisplay /dev/mapper/centos-root
  Volume group "centos" not found
  Cannot process volume group centos
[root@datatangseafile ~]#
[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# uname -a
Linux datatangseafile.com 2.6.32-696.18.7.el6.x86_64 #1 SMP Thu Jan 4 17:31:22 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@datatangseafile ~]# lvextend -l +98%FREE /dev/mapper/vg_datatangseafile-lv_home
[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# lvdisplay /dev/mapper/vg_datatangseafile-lv_home
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  --- Physical volume ---
  PV Name               /dev/sdb5
  VG Name               vg_datatangseafile
  PV Size               8.96 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2349999
  Free PE               0
  Allocated PE          2349999
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

[root@datatangseafile ~]# pvremove -h
  pvremove: Remove LVM label(s) from physical volume(s)

pvremove
        [--commandprofile ProfileName]
        [-d|--debug]
        [-f[f]|--force [--force]]
        [-h|-?|--help]
        [-t|--test]
        [-v|--verbose]
        [--version]
        [-y|--yes]
        PhysicalVolume [PhysicalVolume...]

[root@datatangseafile ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  --- Physical volume ---
  PV Name               /dev/sdb5
  VG Name               vg_datatangseafile
  PV Size               8.96 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2349999
  Free PE               0
  Allocated PE          2349999
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

[root@datatangseafile ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_root
  LV Name                lv_root
  VG Name                vg_datatangseafile
  LV UUID                ijZd9o-zu19-s46a-6ykj-xDEt-lkn7-tK59UQ
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_swap
  LV Name                lv_swap
  VG Name                vg_datatangseafile
  LV UUID                vxlCHc-MQN6-vt01-zwo1-Zq8q-uB7t-O8t8kX
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 0
  LV Size                7.58 GiB
  Current LE             1940
  Segments               1
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:2

[root@datatangseafile ~]# lvremove -h
  lvremove: Remove logical volume(s) from the system

lvremove
        [-A|--autobackup y|n]
        [--commandprofile ProfileName]
        [-d|--debug]
        [-f|--force]
        [-h|--help]
        [--noudevsync]
        [-S|--select Selection]
        [-t|--test]
        [-v|--verbose]
        [--version]
        LogicalVolume[Path] [LogicalVolume[Path]...]

[root@datatangseafile ~]# vgremove -h
  vgremove: Remove volume group(s)

vgremove
        [--commandprofile ProfileName]
        [-d|--debug]
        [-f|--force]
        [-h|--help]
        [--noudevsync]
        [-S|--select Selection]
        [-t|--test]
        [-v|--verbose]
        [--version]
        VolumeGroupName [VolumeGroupName...]

[root@datatangseafile ~]# shutdown now

Broadcast message from root@datatangseafile.com
        (/dev/pts/0) at 2:10 ...

The system is going down for maintenance NOW!
[root@datatangseafile ~]#




[root@datatangseafile archive]# vgscan
  Reading all physical volumes.  This may take a while...
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  Found volume group "vg_datatangseafile" using metadata type lvm2

[root@datatangseafile archive]# pvscan
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  PV /dev/sda2   VG vg_datatangseafile   lvm2 [7.28 TiB / 0    free]
  PV unknown device VG vg_datatangseafile   lvm2 [8.96 TiB / 0    free]
  Total: 2 [16.24 TiB] / in use: 2 [16.24 TiB] / in no VG: 0 [0   ]

[root@datatangseafile archive]# lvscan
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  ACTIVE            '/dev/vg_datatangseafile/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_datatangseafile/lv_swap' [7.58 GiB] inherit
  inactive          '/dev/vg_datatangseafile/lv_home' [16.19 TiB] inherit

[root@datatangseafile archive]# pvdisplay
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  --- Physical volume ---
  PV Name               unknown device
  VG Name               vg_datatangseafile
  PV Size               8.96 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2349999
  Free PE               0
  Allocated PE          2349999
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

[root@datatangseafile archive]# vgdisplay
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  --- Volume group ---
  VG Name               vg_datatangseafile
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               1
  Max PV                0
  Cur PV                2
  Act PV                1
  VG Size               16.24 TiB
  PE Size               4.00 MiB
  Total PE              4257594
  Alloc PE / Size       4257594 / 16.24 TiB
  Free  PE / Size       0 / 0
  VG UUID               s7soE8-swut-DYbT-z5Rn-x9MQ-v8EC-tRGOLj

[root@datatangseafile archive]# lvdisplay
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_root
  LV Name                lv_root
  VG Name                vg_datatangseafile
  LV UUID                ijZd9o-zu19-s46a-6ykj-xDEt-lkn7-tK59UQ
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_swap
  LV Name                lv_swap
  VG Name                vg_datatangseafile
  LV UUID                vxlCHc-MQN6-vt01-zwo1-Zq8q-uB7t-O8t8kX
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              available
  # open                 0
  LV Size                7.58 GiB
  Current LE             1940
  Segments               1
  Allocation             inherit
  Read ahead sectors     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/vg_datatangseafile/lv_home
  LV Name                lv_home
  VG Name                vg_datatangseafile
  LV UUID                zx5T34-7IaD-ylAe-oa74-D03K-52AX-75y31S
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2019-03-21 08:52:41 -0400
  LV Status              NOT available
  LV Size                16.19 TiB
  Current LE             4242854
  Segments               2
  Allocation             inherit
  Read ahead sectors     256


[root@datatangseafile backup]# df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_datatangseafile-lv_root
                     ext4    50G  1.5G   46G   4% /
tmpfs                tmpfs  3.8G     3.8G   0% /dev/shm
/dev/sda1            ext4    50G  1.5G   46G   4% /boot
/dev/mapper/vg_datatangseafile-lv_home
                     ext4    50G  1.5G   46G   4% /home

[root@datatangseafile backup]# lsblk
NAME                                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                     8:0     7.3T  0 disk
├─sda1                                  8:1     500M  0 part
└─sda2                                  8:2     7.3T  0 part
  ├─vg_datatangseafile-lv_root (dm-0) 253:0      50G  0 lvm  /
  └─vg_datatangseafile-lv_swap (dm-1) 253:1     7.6G  0 lvm
sdb                                     8:16    9.1T  0 disk
├─sdb1                                  8:17    499M  0 part
├─sdb2                                  8:18    100M  0 part
├─sdb3                                  8:19     16M  0 part
├─sdb4                                  8:20   0 133.7G  0 part
└─sdb5                                  8:21      9T  0 part

[root@datatangseafile backup]# cd /home
[root@datatangseafile home]# ls
[root@datatangseafile home]# pvcreate /dev/mapper/vg_datatangseafile-lv_home -u “mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d” --restorefile /etc/lvm/backup/vg_datatangseafile
  Too many characters to be uuid.
  Run `pvcreate --help' for more information.
[root@datatangseafile backup]# cat /etc/lvm/archive/* |grep mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d
                        id = "mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d"
                        id = "mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d"

[root@datatangseafile backup]# cd /etc/lvm/archive
[root@datatangseafile archive]# ls
vg_datatangseafile_00000-1959374370.vg  vg_datatangseafile_00002-1773824715.vg  vg_datatangseafile_00004-1738739734.vg
vg_datatangseafile_00001-2038434398.vg  vg_datatangseafile_00003-1126580245.vg  vg_datatangseafile_00005-1607963211.vg
[root@datatangseafile archive]#
[root@datatangseafile archive]# pvcreate /dev/sdb5 -u “mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d” --restorefile /etc/lvm/backup/vg_datatangseafile
  Too many characters to be uuid.
  Run `pvcreate --help' for more information.



[root@datatangseafile /]# pvcreate /dev/sdb5
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  Physical volume "/dev/sdb5" successfully created
[root@datatangseafile /]# pvdisplay
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               0
  Allocated PE          1907595
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

  --- Physical volume ---
  PV Name               unknown device
  VG Name               vg_datatangseafile
  PV Size               8.96 TiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2349999
  Free PE               0
  Allocated PE          2349999
  PV UUID               mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d

  "/dev/sdb5" is a new physical volume of "8.96 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb5
  VG Name
  PV Size               8.96 TiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               ai3PPO-kSTO-Xdxz-Kgki-d1fm-11hZ-6gWagF

[root@datatangseafile /]#
[root@datatangseafile /]# pvremove  /dev/sdb5
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  Labels on physical volume "/dev/sdb5" successfully wiped
[root@datatangseafile archive]# pvscan
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  PV /dev/sda2   VG vg_datatangseafile   lvm2 [7.28 TiB / 0    free]
  PV unknown device VG vg_datatangseafile   lvm2 [8.96 TiB / 0    free]
  Total: 2 [16.24 TiB] / in use: 2 [16.24 TiB] / in no VG: 0 [0   ]
[root@datatangseafile archive]# vgreduce --removemissing /dev/vg_datatangseafile
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  WARNING: Partial LV lv_home needs to be repaired or removed.
  There are still partial LVs in VG vg_datatangseafile.
  To remove them unconditionally use: vgreduce --removemissing --force.
  Proceeding to remove empty missing PVs.
[root@datatangseafile archive]# vgreduce --removemissing --force /dev/vg_datatangseafile
  Couldn't find device with uuid mgQZyd-kV9t-niqq-xa7B-5I1Z-gzQU-Gzk93d.
  Removing partial LV lv_home.
  Logical volume "lv_home" successfully removed
  Wrote out consistent volume group vg_datatangseafile
[root@datatangseafile archive]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_datatangseafile
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              1907595
  Free PE               1892855
  Allocated PE          14740
  PV UUID               JRVBzY-eiJe-apk8-QP1n-ldNK-VeuL-qpnVH6

总结:ext4 格式系统文件下扩容到最后一步报错:resize2fs: New size too large to be expressed in 32 bits。不知道该怎么处理,后来索性把lv_home删除了。把sdb格式化xfs格式,挂载到/home,还原home目录备份数据数据。
问题思考:
1,报错是否因为ext4格式最大限制16TB一下,如果是,那么系统文件换成xfs格式呢?如果不是文件格式问题是什么问题?
2,把lv_home逻辑分区删除了,如何在当前基础上重新把lv_home创建恢复?

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有