[Lustre-discuss] recovering formatted OST

Andreas Dilger andreas.dilger at oracle.com
Wed Oct 20 08:32:57 PDT 2010


Right - you need to recreate the LV exactly as it was before. If you created it all at once on the whole LUN then it is likely to be allocated in a linear way. If there are multiple LVs on the same LUN and they were expanded after use the chance of recovering them is very low.

In the e2fsprogs there is a tool I wrote called findsuper to scan a device looking for ext3 superblock signatures. If needed, you could run findsuper to determine the starting offset of the filesystem, and then just create a simple partition with the right starting offset on order to run e2fsck. 

That said, if there were filesystems formatted in each partition, the amount of data loss may be large. You may have some saving grace if the first partitions are very small and fit inside the space previously used by the 400MB journal.

Cheers, Andreas

On 2010-10-20, at 9:06, Wojciech Turek <wjt27 at cam.ac.uk> wrote:

> Thank you for quick reply.
> Unfortunately all partitions were formatted with ext3, also I didn't mention earlier but the OST was placed on the LVM volume which is now gone as the installation script formatted the physical device. I understand  that this complicates things even further. In that case i guess firstly I need to try to recover the LVM information otherwise fsck will not be able to find anything is that right?
> 
> Best regards,
> 
> Wojciech
> 
> On 20 October 2010 08:46, Andreas Dilger <andreas.dilger at oracle.com> wrote:
> On 2010-10-19, at 17:01, Wojciech Turek wrote:
> > Due to the locac disk failure in an OSS one of our /scratch OSTs was formatted by automatic installation script. This script created 5 small partitions and 6th partition consisting of the remaining space on that OST. Nothing else was written to that device since then. Is there a way to recover any data from that OST?
> 
> Your best bet is to make a full "dd" backup of the OST to a new device (for safety), first restore the original partition table.  If there was not originally a partition table, then you can just erase the new partitions:
> 
>  dd if=/dev/zero of=/dev/XXX bs=512 count=1
> 
> Then run e2fsck -fy, followed by "ll_recover_lost_found_objs" (from a newer lustre RPM, if you don't have it).  It is likely that you will get some or most of the data back.  This depends heavily on exactly what was written over the original filesystem.
> 
> If it was just a new partition table, there should be relatively little damage (ext3 is very robust this way, and can repair itself so long as the starting alignment is correct).  If there were filesystems formatted in each of these partitions, then the amount of data available will be reduced significantly.
> 
> Cheers, Andreas
> --
> Andreas Dilger
> Lustre Technical Lead
> Oracle Corporation Canada Inc.
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/attachments/20101020/ff239004/attachment.htm>


More information about the lustre-discuss mailing list