Currently we have three backup stages where the last backup was taken after we created test_lv1 logical volume. To list the available backups of LVM metadata use vgcfgrestore -list. You can restore LVM metadata with the vgcfgrestore command.You can manually back up the LVM metadata to the /etc/lvm/backup file with the vgcfgbackup command. A daily system backup should include the contents of the /etc/lvm directory in the backup.How long the metadata archives stored in the /etc/lvm/archive file are kept and how many archive files are kept is determined by parameters you can set in the lvm.conf file.By default, the metadata backup is stored in the /etc/lvm/backup file and the metadata archives are stored in the /etc/lvm/archive file.LVM metadata backups and archives are automatically created whenever there is a configuration change for a volume group or logical volume, unless this feature is disabled in the lvm.conf file.~]# mkdir ~]# mount /dev/mapper/test_vg-test_lv1 /test/Ĭreate a dummy file and note down the md5sum value of this file ~]# touch ~]# md5sum /test/fileĭ41d8cd98f00b204e9800998ecf8427e /test/fileĪLSO READ: Beginners guide to how LVM works in Linux (architecture) Step 1: List backup file to restore LVM metadata in Linux We will put some data into our logical volume to make sure there are no data loss after we recover LVM2 partition, restore PV and restore VG using LVM metadata in the next steps. Test_lv1 test_vg -wi-a- 1.00g /dev/sdb(0) <- new Logical Volume LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices Similarly you can see the new logical volume test_lv1 is mapped to /dev/sdb device ~]# lvs -o+devices Here as you see test_vg is mapped to /dev/sdb ~]# vgs -o+devices List the available volume groups along with the mapped storage device. Writing superblocks and filesystem accounting information: done ALSO READ: How to install EPEL repo in RHEL 8 Linux Create Logical VolumeĬreate a new logical volume test_lv1 under our new volume group test_vg ~]# lvcreate -L 1G -n test_lv1 test_vgĬreate ext4 file system on this new logical volume ~]# mkfs.ext4 /dev/mapper/test_vg-test_lv1Ĭreating filesystem with 262144 4k blocks and 65536 inodesįilesystem UUID: c2d6eff5-f32f-40d4-88a5-a4ffd82ff45a
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |