LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 01-16-2007, 06:12 AM   #1
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Rep: Reputation: 15
Disksuite backup.


Hi,
I have set up disk mirroring with two disks on Solaris 10 and I can metaoffline and metaonline them. When the mirror comes back up the disks sync. great. What I want to do is write a script to run from Cron. this script should metaonline one half of the mirror let it sync and then leave it in a metaoffline state.

Firstly, is this a really bad idea? ie how long can I leave a system running on half a mirror.

Secondly, how can I get a script to check when the disk is synced up so I know when to break the mirror.
the exit status of metaonline says successful even when the disks have not finished syncing.

Thirdly, has anyone done this? got a script i can read?

Cheers,
Neil.
 
Old 01-16-2007, 08:48 AM   #2
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
I so far have this script. Seems to detect when the disks have resynced and I can break the mirror.

I would still like to know if anyone else knows if this is a good idea or not. As I understand it. The system keeps track off data it needs to sync. I guess there must be a limit on this data? Anyone know what that might be??

#!/bin/bash

# Must prepare a known good status.sta file beforehand.

# Get the current concise status
metastat -c > status

# Until status exit code is good you cant break the mirror.
until diff status.sta status > /dev/null
do
echo "The exit code is $? "
echo "I cant break the mirror exit code should be 1"
done
echo "The exit code is $? "
echo "I can break the mirror exit code should be 0"
metaoffline d32 d22 ; metaoffline d31 d21 ; metaoffline d30 d20

Cheers,
neil.
 
Old 01-16-2007, 10:16 AM   #3
mackdav
Member
 
Registered: Feb 2005
Distribution: RHEL, CentOS
Posts: 113

Rep: Reputation: 16
Strictly speaking you can run on a single-armed mirror until the disk fails, a single-armed mirror is functionally no different from a single, un-mirrored disk.

I'm curious as to why you'd want to do this. When you re-attach the mirror, disksuite synchronizes everything, which means that the file systems are read and synchronized end-to-end. There is no "incremental" mirror synchronization. This increases the wear on both disks. And keeping the mirror broken means you have no recourse if/when the primary disk fails -- sure you can boot of the "detached" mirror, sure, but disksuite will immediately notice that there are no live mirrors and refuse to mount anything. Disksuite is fiddly enough when the mirrors are properly attached, you are just making work for yourself in the event of a failure.

If you want a "backup" system (ie to let you recover from accidental deletions etc), look into rsync, which can do more like you appear to be trying to do here. Let Disksuite cover you for hardware failure.
 
Old 01-16-2007, 01:16 PM   #4
mackdav
Member
 
Registered: Feb 2005
Distribution: RHEL, CentOS
Posts: 113

Rep: Reputation: 16
Possibly relevant: http://thedailywtf.com/Articles/RAIDing_Disks.aspx
 
Old 01-17-2007, 02:09 AM   #5
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
Thankyou very much for the response.

At the moment I am running with a single disk on a production system.
I have the luxury of a second identical V240 to play with for a time.
2 x 36Gig local disks.

The mirroring is for a backup system in a way. I have set up the box to boot off either disk for a speedy recovery and wanted to keep the two synced up every once in a while. I dont think much data will change between the two. We will have a RAID Array with a ZFS filesystem across Fibre Channel that will be the busy filesystem.

I didnt realise it wasn't an incremental sync, I thougt it was actually because the man page for metaonline says that the system keeps a log of whats changed, so I assumed it was incremental. (haha, never assume). I havent followed your link yet but yes rsync sounds more efficient. I guess I'll have to weigh up the differences. (mmm perhaps rsync to the SAN)

I dont think I will have to metaonline the sub-mirrors very often to keep a system thats very easily recoverable. A Sun engineer said this is what other customers of theirs do. We are also going to have a completely 'mirrored' system at another site. So even if the site managed to lose power we would still automatically be operational.

From your response you say the mirroring will protect me from hardware failure. Does that mean if a disk fails the data on the other half of the mirror remains consistent? Please excuse my ignorance. I hope that is the case, because it means I've already achieved what I set out to do. I which case thankyou very very much mackdav.

I'll just leave them mirrored and bootable! I assumed, (there I did it again), that If I metaofflined the Submirror it would protect the data as its not writeable. I suppose If I get a controller failure the other site will take over. In fact I think there might be another controller available in the V240 I could put the other disk in there or maybe even a three way mirror.

Thanks again for your help, you've given lots to think about and it does help to communicate with someone else.

Regards,
Neil.
 
Old 01-17-2007, 02:12 AM   #6
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
One other thing, Im not detaching the mirror, Im offlining it. Maybe that makes a difference. With one half of th emirror offline I can still reboot, The whole mirror comes back after synchronising.

reagrds,
Neil.
 
Old 01-17-2007, 02:29 AM   #7
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
Usually you cant ufsdump a system without taking it to single user mode.

However if you mirror it, offline the submirror, and then usfdump it.
You can, and still keep the system up and running.

Thats what its for.

Also, metaoffline is incremental. Im just not sure whats its capacity for being incremental is.

I read the artical in the link above. And no, I dont think thats "just how its done". Why do I find that insulting?
 
Old 01-17-2007, 10:50 AM   #8
mackdav
Member
 
Registered: Feb 2005
Distribution: RHEL, CentOS
Posts: 113

Rep: Reputation: 16
I was not aware of "metaoffline", that makes all the difference.

As long as you are only "offline" during your backup sequences, you are protected from hardware failures. If one arm of the mirror is "offline" and the live arm dies, you are in just as much trouble.
 
Old 01-17-2007, 02:05 PM   #9
mdhmi
Member
 
Registered: Dec 2005
Location: Detroit, Michigan
Distribution: Ubuntu
Posts: 86

Rep: Reputation: 15
Quote:
Originally Posted by mackdav
If one arm of the mirror is "offline" and the live arm dies, you are in just as much trouble.
You don't run a hot spare?
 
Old 01-17-2007, 02:49 PM   #10
mackdav
Member
 
Registered: Feb 2005
Distribution: RHEL, CentOS
Posts: 113

Rep: Reputation: 16
If you have a single-armed mirror, hot-spares don't do anything for you because there is nothing live to copy to the hot-spare.

Hot spares help you survive multiple hardware failures (ie mirror arm dies, hotspare reconstructs, then either hotspare or surviving mirror dies; system keeps going).

So no, generally we don't run hot spares on our small servers because two disks in a mirror is good enough to ensure data survives a single disk failure. 99% of the time this lets you replace the dead disk in a controlled fashion before the survivor dies. Yes there is a window of risk, and you have to be on top of things to catch and correct these issues, but for our applications it is adequate.

That and most of our servers are two-disk 1U systems
 
Old 01-18-2007, 02:13 AM   #11
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
"As long as you are only "offline" during your backup sequences, you are protected from hardware failures. If one arm of the mirror is "offline" and the live arm dies, you are in just as much trouble."

Thanks mackdav, If this happened, although I wasnt using for a real backup, I think I can still boot off the offlined device but I would have to restart the system first. But only because Ive arranged for it beforehand in the PROM. I have 2U V240's and could have a three way mirror with hot spare as there are four hard disk bays. Unfortunately I only have two disks in each server.

I wondered about using one of the other bays for one 'mirror arm' if it was on a separate controller. But as far as I can tell all four disk slots use the same controller

I have enough info for what I need to do now. Thanks for the responses. And yesterday I got 5 x 1.98Terabyte seen on the fibre channel from The SAN. So today I will set up my mirror, without a metaoffline script, and keep all other data on the SAN with a ZFS filesystem from the concatenated SAN drives. That gives me about 10TB of space thats all hardware RAIDed striped and includes two physical global hot spares plus the benefits of the ZFS filesystem. SO I have saved us £20,000 consultancy from Sun. And will need minimum administration.

I have a backup strategy as well now, and the whole site will be replicated to a second Disaster Recovery site

Thanks again for helping me clear up all my questions.

Perhaps the guy from the BBC should have hired me!!

Cheers,
Neil.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 01:13 AM
Error when attempting backup with File Backup lglrgl Linux - Software 0 08-03-2006 10:38 AM
Selective backup to CDRW, or other backup methods. trekk Linux - Software 1 11-03-2003 02:46 PM
disksuite querie nelly_boy Solaris / OpenSolaris 1 07-07-2003 12:55 PM
backup and update the backup file doris Linux - General 4 08-24-2002 07:26 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration