:~$ vgcfgrestore -f /etc/lvm/archive/shares_00003-1430114073.vg shares Volume group shares has active volume: haven200. WARNING: Found 1 active volume(s) in volume group "shares". Restoring VG with active LVs, may cause mismatch with its metadata. Do you really want to proceed with restore of volume group "shares", while 1 volume(s) are active? [y/n]: y Restored volume group shares.
:~$ lvscan ACTIVE '/dev/media/movies' [<2.64 TiB] inherit ACTIVE '/dev/shares/haven200' [400.00 GiB] inherit inactive '/dev/shares/public' [200.00 GiB] inherit
现在,被删除的LV【public】已经恢复了,但它的状态是未激活的,所以需要我们手动激活一下它。
1 2 3 4 5 6 7 8 9 10 11 12
:~$ lvchange -ay /dev/shares/public :~$ lvscan ACTIVE '/dev/media/movies' [<2.64 TiB] inherit ACTIVE '/dev/shares/haven200' [400.00 GiB] inherit ACTIVE '/dev/shares/public' [200.00 GiB] inherit
:~$ mount /dev/shares/public /mnt/public :~$ ll /mnt/public drwxr-xr-x 2 nas nas 4.0K Jun 18 2019 pure-ftpd/ drwxr-xr-x 2 root root 4.0K Jun 19 2019 rsyncd/ drwxr-xr-x 2 nas nas 4.0K Feb 22 2020 server/ drwxr-xr-x 2 nas nas 4.0K Jun 18 2019 transmission-daemon/
# format new disk :~$ gdisk /dev/sdk ... ... Command (m forhelp): n Partition number (1-?): 1 First cylinder (1-xxxx, default 1): Last cylinder, +cylinders or +size{K,M,G} (1-xxxxx, default xxxxx): Command (m forhelp): t Selected partition 1 Hex code (type L to list codes): lvm Changed system type of partition 1 to 43 (Linux LVM) ... ... # create pv :~$ pvcreate /dev/sdk1 # add pv to vg :~$ vgextend media /dev/sdk1 :~$ vgs VG #PV #LV #SN Attr VSize VFree media 2 1 0 wz--n- <4.64t 3.77g shares 1 2 0 wz--n- <1024.00g <424.00g