gregl.blogg.se

Linux recover lost partition
Linux recover lost partition












etc/lvm/archive/VolGroup_00003-2103841493.vg – LVM configuration backup file name This file is human readable in text format.īelow command will help us to recover the deleted logical ~]# vgcfgrestore -f /etc/lvm/archive/VolGroup_00003-2103841493.vg VolGroup In above example, linux server took the lvm configuration backup and save it in file /etc/lvm/archive/VolGroup_00003-2103841493.vg.

linux recover lost partition

Whenever logical volume group get modified the linux server will take the backup of existing configuration and save it in /etc/lvm/archive ~]# vgcfgrestore -list VolGroupįile: /etc/lvm/archive/VolGroup_00000-304429941.vgĭescription: Created *before* executing '/sbin/vgs -noheadings -o name -ignoreskippedcluster -config 'log''įile: /etc/lvm/archive/VolGroup_00001-1788852006.vgĭescription: Created *before* executing 'lvcreate -L 2G -n lvtest VolGroup'įile: /etc/lvm/archive/VolGroup_00003-2103841493.vgĭescription: Created *before* executing 'lvremove /dev/VolGroup/lvtest'ĭescription: Created *after* executing 'lvremove /dev/VolGroup/lvtest' Step 3: Recover the Logical Volume by using vgcfgrestore command Now we have removed the newly created locical volume, at this moment the data’s in the volume has ~]# lvs Logical volume "lvtest" successfully removed Step 2: Remove the newly created logical volumeīelow command is not reccommended to exectue in Prodcution Linux Server, be careful while executing these ~]# umount ~]# lvremove /dev/VolGroup/lvtest Writing superblocks and filesystem accounting information: ~]# mount -t ext4 /dev/VolGroup/lvtest ~]# df -hįilesystem Size Used Avail Use% Mounted onĢ.0G 3.0M 1.8G 1% ~]# cp /etc/passwd /etc/group ~]# ls -l /data/ Lvtest VolGroup -wi-a- ~]# mkdir -p ~]# mkfs.ext4 /dev/VolGroup/lvtestĢ6214 blocks (5.00%) reserved for the super userģ2768 blocks per group, 32768 fragments per group LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert VolGroup 2 2 0 wz-n- 12.50g ~]# lvcreate -L 2G -n lvtest VolGroup Volume group "VolGroup" successfully ~]# vgs VolGroup 1 2 0 wz-n- 7.51g ~]# vgextend VolGroup /dev/sdb

linux recover lost partition

Physical volume "/dev/sdb" successfully ~]# vgs Step 1: Create the physical volume (PV), extend the volume group (VG) and create new logical volume ~]# fdisk -l | grep /dev/sd Here I have created the new 2G logical volume and deleted the same for pratical example. Linux server store the lvm configuration backup copies in the /etc/lvm/archive directory. By using vgcfgrestore command we can recover deleted LVM partitions. Some times system admin mistakenly delete LVM partitions while working on production servers.














Linux recover lost partition