[comp.sys.sgi] logical volume Q & A.

daveh@xtenk.asd.sgi.com (David A Higgen) (12/04/90)

Here's a recent question  I answered which might be of some general interest:

> From: fine@sofine.detroit.sgi.com (Steve Fine)
>
> If I have 2 ipi's set up in a logical volume (not stripped) and the amount
> of data on the disk is much, much smaller than the size of the first disk,
> and the second disk goes dead, is there anyway to recover the data on the
> first disk.  
> 
> In general, is there any way to recover data on lv if 1 of x disks (even a 
> middle on) goes dead.

In general, the answer is: no, there is no systematic and guaranteed recovery
procedure. A logical volume is a device, not a filesystem: the individual 
component disks are just "space": there is no administrative data on each disk.

You have to regard a logical volume as being effectively one big disk: one disk 
failing is analogous to (say) one head failing on a regular disk.

As ever, the word is: DO YOUR BACKUPS!

Having said that, there are things that could be worth trying. (I'm assuming
you're talking about a logical volume containing a filesystem).

You would start by replacing (or repairing) the failed disk, and remaking the
logical volume (with mklv -f). Next, fill the replacement disk with zeros
(by dd from /dev/zero, for example).
Then run fsck on the volume. Inodes on the replacement disk will look 
like unallocated inodes (being zero), so fsck will ignore those inodes but 
attempt to fix up the rest of the filesystem. (This will only work if it's not
the first disk that's busted: if that happens you've lost the superblock and
the root directory so fsck can't do anything).

This will save some if not most of the files on the other disks. NOTE IT IS
NOT GUARANTEED: if any of the files whose inodes were on the surviving 
disks had data blocks or indirect blocks on the busted disk; those files will 
be either lost completely or partially corrupted (ie contain zeros instead of
data in some or all places)! Thus you would want to inspect the files in the 
restored filesystem for sanity: any consecutive passages of 512 zero bytes 
would suggest corruption.

So, this might be worth trying if you had some vital files that you hadn't
yet backed up: but DON'T regard it as a safety net to avoid doing backups!!


			Dave Higgen (daveh@xtenk.asd.sgi.com)