restore removed lvol

 
Court Campbell
Honored Contributor

restore removed lvol

Man, it has been awhile and I feel like a fish out of water. I was recently asked to remove an lvol, so i did it. Now it needs to be restored. I know I could recreate the lvol and restore, but i thought there was another way to do it. I recreated the character and block special files for the lvol, but I know there is a little more to it. Anyone have any good ideas?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: restore removed lvol

What does 'lvdisplay' now show for that LV?
Vivek Bhatia
Trusted Contributor

Re: restore removed lvol

Hi Court,

Please follow the steps.

1. Remove the character and block device files you have created.

2. Lvcreate -L lv_size_MB VG_NAME
3. mkdir DiR_OLD (Create the directory )
4. newfs -F vxfs /dev/VG_NAME/rLVOL_NAME
5. mount /dev/VG_NAME/LVOL_NAME DIR_OLD
6. Now restore all the files in DIR_OLD.

Thanks
Vivek Bhatia
Court Campbell
Honored Contributor

Re: restore removed lvol

Pat - The lvol is gone, there is no info for lvdisplay to show.


Vivek - Thanks for the info, but that is a creation of a new lvol and a new file system. Not what I am asking for.

Anyway, a former co-worker was able to help out. I was lucky that all the lvols on the disk were contiguous. I was able to use the bdf output to get the number of PE's used for the lvol. I then did an lvcreate using the pe size and mounted it. I just barely dodged that bullet.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Viktor Balogh
Honored Contributor

Re: restore removed lvol

Hi Court,

Does it mean that you found the data untouched on the newly created LV? With a filesystem on it? What a luck... :)
****
Unix operates with beer.