Deleted LVM and VG Restoration with Metadata in Linux- Redhat | Suse | CentOS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome to my channel into Linux in this video I'm going to show you and discuss about when accidentally if somebody remove your LVM or your filesystem how to recover it right so this is a very good features which we have it in LVM because for example in real time scenario your data is the key and it is most important when you are when something is using for example if you're running database or some replication production application and accidentally or someone has removed remove your filesystem you will lose all your data and what scenario if you do not have backup for this file system you are almost fired right so how to get rid of it so there is one of features in LVM through which we can recover your LVM and you would still have your data so I'm going to show you how to do that so first thing is your lbm so currently I have one l vm is around 512 mb of filesystem formatted and if i go inside this data directory you can see there are four files and now someone has remove it so to remove that I have to unmount it and someone has removed this and we we remove I have seen one instance where one person he he was supposed to extend the filesystem right extend the filesystem and he was into a different wall maybe he was he was oh he was a technical guy and he was weldin or less in Phoenix but he did the mistake so it can be an he mineral error also so if I remove it like this really move and this is asking whether I can remove the active LVM so I have removed it and now inside neither busy I don't see me Elvis you know so if I do a videos and see this is the vg2 disk inside this video and there is no LV right so how to recover so now when you create lbm every time you create a VM or if you do some changes in your LVM it will write some data in some location right regarding the changes which you have done so there is something called metadata in LVM which will keep track of your file system and your LBM when it has created when it has resize what time what is the size and other information so those meta data for your LVM will located default in this location let's say the CL VM so if I just go inside this location and if I do LS f and L you'll see one directly called backup and will tell you what is this directory for okay so here you can see mirror VG information and also if I got to metadata in here I cannot see any metadata right because there was one LVM which was there inside this VZ but now it got removed so the middle of the information is not there right and also there is one directory called okay if you go into this directory you were able to see some files yeah just one error second root here and you will see many files regarding mirror VG this is all mirrored VG so those are the metadata files so and also the timings you would see this show on Showtime you know those are modified and last it has modified on February 9 and if you want if you just do more tell or less whatever it is you would see some information here that here it is given I have educated or somebody has educated and come on LV remove this LVM and this is fine so date and time and the other PV information inside this lbm which was used so this is the metadata which is going to help us to restore my lbm right so now when I do lbs no LV there was one LP which is removed so to restore it what I will do there is one command called VG c MZ backup first thing is this one v c MZ beckham right so you can take the backup of your VZ so currently when you run this command it will default save the file here in l vm backup directory okay so this is a file and it is not required to restore your air BM I'm just showing you how to take the break-up so the other command is VZ c MZ store right so when you do a VDC FZ restore - - to see those option there is one option called list I'm going to use that command - one is less and my vagine M my VG is mirror ok so when I when this come on it will give all the information from the dead it has started when it has created till the recent one the recent one is this so after this no changes has been done here so this is the meta data which will require to restore your LV here you can see this is the command which is ran here and you have to use this way so how do you restore it PG c MZ is stop - a4 file to specify the fine which file you are going to use so I'm going to use this location inside this location this is the file I'm going to use and what is the vision IAM so here my VG name is mirror VG okay so once I run this command let me clear the screen and you can see restored volume group successfully and you're very busy your beginning so now if i do l vs middle VD now I can see my V is back and it is available here but currently it is not active so in order to active that what you can do you can just do a video chances are I've is in M which is Mira ve it wanted to do it will active all the Elvis running under this video so currently I have only one LV so it will give this one and the other way you can do LV Cheng's that is because to IBM and you need to do the same thing mirror VG neither it will be okay so when I activate and now if I take the status I can see it is active so now I have to open it and or I need to mount it so information is already there in less it is a festive I saw I'm going to run this come on now - a and now if I do - if I do Elvis now you can see it is also active and also open and if I do rdf - it's I can see my file system is back right so the concern is data so whether I have the data or not so that is the main concern so now let me see whether I have the data and I can see my data is still there right so this is how you can save your back if you accidentally remove or something nasty you have done in accidentally in some LVM and you wanted to restore it back so this is how we can restore it okay so this is regarding the lbm restoration but how about the VG so how we can restore the VD so for restoring VG also it is same thing so I have taken a back of already so let me go to this territory and always keep the backup file in some other location for example in temp let me copy this to temp because this will be vanish when I have removed my VD so let me remove my vgv [Music] we didn't know before that let me see whether I have this funny no not okay I have this fine but so let me remove it so it says mirrors okay so I'm given so it is saying money of active will be and this video it is because it is mounted so I need to unmount the filesystem first data and now if I remove it we didn't move they will be it's fine so my lb is you know my VD is also remove so if I do i ns - she'd my breakup frame and I hope I don't have the backup file so that is why I said that you have to take this backup file in some location right so I have kept it I kept that file in slash temp and everything just copy the line nuclear define call meter reading all right so I have this file now and let me check with this movie g VG c FG CMD store and provide the file name is right if I run this it will throw an error because it will I would need to give the visioning so here it is saying specify a single William drove to the store so I need to specify the vision name as well so I will do neither VCS as well for my VG which was removed right so let me run this sorry that is my spelling mistake here middle really fine so now you can see the stored volume group mirror VG so my middle VG is restored and let me try to see whether I have the media or not and here is your V Z so earlier when I turn this come on with yes it is no VG available but now it has come back so this is a really good thing regarding restoration of your files LVM and also VZ if you external accidentally remove or something now still happen on your Viji we can divide it back and you can have your data back right so this is it guys for your for this video this is regarding the restoration of LVM and distillation of busy so please let me know if you have any doubts feel free to comment anything if you have please write your doubts in my youtube comment section and also please subscribe my channel if you have not subscribed beard thank you so much for watching this video have a good day
Info
Channel: Tune To Linux
Views: 15,345
Rating: undefined out of 5
Keywords: LVM, LVM feature, lvm version2, new features in Linux LVM, create LVM, new LVM and FS, benefits of LVM, step by step procedure to create LVM in linux, how to create LVM in linux, extend LVM, LVM metadata, restore LVM, new fs creation in Linux, shrink LVM in linux, create LVM with extents, Linux LVM concept, Linux lvm concept for beginner, stipe LVM, storage migration from storage to another, disaster recovery with LVM mirroring, understanding LVM, basic concept about LVM
Id: 0WFxSUoDcL4
Channel Id: undefined
Length: 15min 42sec (942 seconds)
Published: Wed Feb 08 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.