Re: Broke the OS -- how to save the RAID?

Jonathan Sailor <[email protected]>
Newsgroups gmane.linux.evms.devel
Message-ID <[email protected]>
On Sat, 30 Dec 2006, Lesson No. 25 wrote:
> A humble request for help...  (Sorry it's a bit long.)
>
> I have (had) a PC acting as a NAS.  It was running
> gentoo linux (CLI only, no GUI), and had two separate
> software RAID-1 mirrors (2 HDDs in each, 4 HDDs total)
> setup using EVMS.
>
> Recently, I broke the OS.  (Details of the breakage:
> I upgraded portage using 'emerge portage'.  Portage
> reported many (~140, I think) config files needed
> updating.  I rebooted, without touching any of them.
> Suddenly eth0 no longer worked; some other things were
> broken, too, like the shutdown process.  Rebooted,
> swapped names of all modified config files with their
> older ones, figured I could revert if it didn't work.
> (Bad idea, I am reminded...)  Now it doesn't even
> boot, just asks me what runlevel to enter, I type a
> number, and it quickly says, "No more processes left
> this runlevel" (or somesuch).)

Ah, Gentoo. It can be "fun" like that sometimes. You say below that you 
don't care much for the OS, and I think that's probably wise. Recovering 
the OS from this is probably more trouble than it's worth.

> The data on my (formerly) RAIDed drives is intact--I
> verified this by booting with the System Rescue CD and
> mounting the drives individually (read-only).  I don't
> care too much about the FUBAR'd OS; I think I might
> like to switch distro's anyway.  But I could use some
> help rescuing the evms metadata.  (I think that's what
> I need, yes?)  What I want to do is save the requisite
> files from my broken OS so that once I install a new
> OS, I can just drop the files in place (or import the
> metadata, as it were), and my RAID mirrors will work
> again as before.

Here's some good news: EVMS actually stores its metadata on the volumes 
themselves (which is why the LiveCDs could activate everything 
properly.) As long as your new distro supports evms, running 
evms_activate should Just Work, and all your old volumes will show up 
under /dev/evms/ .

The only thing that you might need to worry about is that the 
installation of your new OS might mess up the data on the EVMS-managed 
storage. If you have a fifth hard drive in your system, or if you had 
root on plain disk partitions, you should just be able to install the 
new OS on top of the old OS. If not, you'll either need to use a new 
distro which supports installing onto EVMS, or use EVMS from a 
Gentoo/Ubuntu/etc. LiveCD to create a compatibility volume of a standard 
partition somewhere for the new OS to live.

If, for some reason, the installation of the new OS clobbered the EVMS 
metadata, I'd suspect it would have cloberred the rest of those 
partitions as well (which would make the metadata somewhat useless), but 
I'm not familiar enough with EVMS to say that the backups would be 
useless. If you do want to make them, you should be able to run 
evms_metadata_backup directly from a LiveCD (without chrooting.)

Something like
  livecd ~ # evms_metadata_backup .
  livecd ~ # scp evms-metadata* you@some_other_computer:

(or do whatever else you want to do to get the file it generates stored 
someplace.)

> I never backed up the evms metadata, and evms.conf was
> not set to back it up automatically.  (I wish now that
> were the default, though perhaps there's good reason
> that it isn't.)  I tried chrooting to my broken OS
> root after booting from sysresccd, and running
> evms_metadata_backup, but it just produces an empty
> file.
>
> Is my desired solution (recovering the metadata by
> grabbing some files) workable?  Will it still work if
> I switch distros?  What files do I need, or how can I
> backup the metadata?
>
> If my desired solution is not workable, is there a way
> to set evms up again without destroying and replacing
> the data?
>
> Thanks very much in advance to any kind soul who reads
> all this and offers assistance.
>
> 'Lesson No. 25'

Farewell

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Evms-devel mailing list
[email protected]
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.