LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices



Reply
 
Search this Thread
Old 04-19-2008, 10:43 AM   #1
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 602

Rep: Reputation: 30
solaris 10 - full system backup


I want to make full system backup. Thi is disk layout:
Code:
/             /dev/rdsk/c0t0d0s0   4.5 G
/usr          /dev/rdsk/c0t0d0s1   6.0 G
/export/home  /dev/rdsk/c0t0d0s3   6.0 G
/opt          /dev/rdsk/c0t0d0s4  36.5 G
/var          /dev/rdsk/c0t0d0s5   4.0 G
swap          /dev/rdsk/c0t0d0s6   2.0 G
I have also tape with 300 G space so space is not a problem.
I think that the most reasonable way is to use UFSDUMP.
This is no problem for me to maka dump for /opt and /export/home.
Simply umount them and execute:
ufsdump 0ucf /dev/rmt/0 /export/home

But how to umount /usr /var and /(root) slice ? It is imposible.
How can I backup them ? What are the most common ways ?
(all I need to 1 tape)

Last edited by czezz; 04-19-2008 at 11:59 AM.
 
Old 04-19-2008, 11:48 AM   #2
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 602

Original Poster
Rep: Reputation: 30
What I found about / (root) slice is that before backing up system must go to single user mode (init -s) then execute
Code:
ufsdump 0uf /dev/rmt/0n /
But I am still not usre what to do with /usr and /var ?
 
Old 04-19-2008, 12:00 PM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Go in single user (or at least stop all applications) and then use snapshots (man fssnap) for all of your filesystems.
 
Old 04-19-2008, 12:25 PM   #4
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 602

Original Poster
Rep: Reputation: 30
Well... what I am afraid of fssnap is this:

Code:
bash-3.00# fssnap -d -F ufs /usr
fssnap: ioctl: error 22: Invalid argument
It happans to me frequently and I got no idea what is wrong
For sure it is not a reason of "xntpd" - which is turned off.

BTW.
Can I go with system to Single User Mode and then make snapshots for all my fs ?
Code:
/
/usr
/export/home
/opt
/var
then bring system back to init 3 and after all make ufsdumps of all snapshots ?
 
Old 04-19-2008, 05:02 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by czezz View Post
Well... what I am afraid of fssnap is this:

Code:
bash-3.00# fssnap -d -F ufs /usr
fssnap: ioctl: error 22: Invalid argument
It happans to me frequently and I got no idea what is wrong For sure it is not a reason of "xntpd" - which is turned off.
Well, in 99% of the cases the culprit is xntpd, I would double check. If not, that might be another real-time process staying there. You can also try mounting /usr read-only.
Quote:
Can I go with system to Single User Mode and then make snapshots for all my fs (/ /usr /export/home /opt /var) then bring system back to init 3 and after all make ufsdumps of all snapshots ?
No, you need to have at least one non "snapshotted" filesystem where to store the changelogs during the backups.
 
Old 04-19-2008, 05:16 PM   #6
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
While it is recommended by Sun, and in principle is true, that you should go to single user, very few Solaris sysadmins ever do that. On production systems, they just can't afford to take it down to single user every night or every week to do backups. The basic idea is that you want your system to be fairly quiet. If there is lots of disk reading and writing activity, database stuff, and applications with stuff in memory that periodically gets written out, then the odds are higher that something about the ufsdump will be inconsistent. While most systems are never totally quiet, using an fssnap snapshot greatly reduces the window of exposure, and in practice sysadmins seldom if ever run into problems doing recoveries from their dumps.

Of course, be sure to test your backups to make sure you can recover from them and that you know how to do it.

I wrote a fairly lengthy script that does backups for Solaris using fssnap and ufsdump that runs off a configuration script so that it is easy to manage. I suppose I should post it somewhere so that others could make use of it. However, I finally switched to using Amanda. After you've done a certain amount of scripting, and have a certain number of systems you have to backup, you reach a point where a more serious application makes a lot of sense. I took my backup script and adapted it into a wrapper for Amanda so that it would do fssnaps before doing its ufsdumps. That wrapper is posted and documented on the Amanda wiki at zmanda.com.

So, if you wanted to try adopting Amanda, it's all available there for you. Or you could just read through the script and its comments to see how I did it. It gets slightly complex when you script it and try to take into account all the various issues that might come up. It does shut down xntpd before doing an fssnap of the root partition, for example, and then starts it up again after taking the snapshot. It also makes sure that the snapshot is on a different partition from the one being snapshotted.

You can find the links to Amanda and from there to my wrapper (in the wiki under user documentation under clients) here http://www.linuxquestions.org/bookmarks/tags/backup
 
Old 04-19-2008, 05:41 PM   #7
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by czezz View Post
Code:
bash-3.00# fssnap -d -F ufs /usr
fssnap: ioctl: error 22: Invalid argument
I'm on Solaris 9, but I don't think this has changed.

Is it possible that you simply don't need to specify "-F ufs" when you are deleting the snapshot (-d)?

I chose to use

Code:
WHICHSNAP=`/usr/lib/fs/ufs/fssnap -o raw,bs=${SNAPSHOT}/${PALPH},unlink ${P}`;
and then I can use ${WHICHSNAP} in the ufsdump command. Note that if you do a `man fssnap` it won't give all the options for ufs, but rather tells you to look at the file system specific man page. So, then you do a `man fssnap_ufs` and you get all the options.

${P} is the partition I am doing the snapshot of. bs= gives the backing store where the original versions of changed files will get stored if there are changes on ${P} before the snapshot is stopped. In my script, I determine the partition where the snapshot is going to get stored, and that is ${SNAPSHOT}. The ${PALPH} is an alphanumeric construction of the partition that is being backed up that can be used for a file name. So, for example, I end up with _usr_local as a name for /usr/local.

When I'm done, I just do a `/usr/lib/fs/ufs/fssnap -d ${P};`

So, anyway, I never need the `-F ufs` because I'm explicitly calling the /usr/lib/fs/ufs/fssnap. I find using full paths to particular executables safer in scripts in general, but I seem to recall there was some other reason here for explicitly using that version. It was a couple of years ago that I wrote that. It's just been working ever since.

Also, note that if you want all these dumps to go to one tape, then you need /dev/rmt/0n for the no-rewind version of the device.

Last edited by choogendyk; 04-19-2008 at 05:46 PM.
 
Old 04-20-2008, 09:26 AM   #8
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 602

Original Poster
Rep: Reputation: 30
Hey Choogendyk,
Quote:
Is it possible that you simply don't need to specify "-F ufs" when you are deleting the snapshot (-d)?
it does not really help - take a look:
Code:
bash-3.00# fssnap -d /usr
fssnap: ioctl: error 22: Invalid argument
I will investigate this deeper on monday.

There is another importand thing which you mentioned:
Quote:
Also, note that if you want all these dumps to go to one tape, then you need /dev/rmt/0n for the no-rewind version of the device.
How should I understand that ? What procedure should be executed ? Is it like:
make snapshot of first fs (/) then backup it like this:
Code:
ufsdump 0uf /dev/rmt/0n /tmp/snaps/1_snap
then how to backup another snapshot of another fs (lets say /usr which is in /tmp/snaps/2_snap) on same tape ?
 
Old 04-20-2008, 02:52 PM   #9
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
Try `fssnap -i` to see what it thinks it has. If it thinks that /usr is an invalid argument, then it must think it has no snapshot for /usr at this point.

Use `mt status` in between or before ufsdump actions to see where you are. Since you are using /dev/rmt/0 (or 0n), it will default to that. The status will tell you what position you are in on the tape. If you use the device 0, it will rewind after doing a ufsdump. If you use the device 0n, it will not rewind. So, the status after doing a dump will tell you that you are at tape position 1, or 2, or something like that, rather than 0.

You can also use `mt rewind`, `mt fsf 1`, etc. to position the tape.

Especially when debugging, or working out procedures, I *always* use informational commands in between doing other things. So, doing `mt status` and `fssnap -i` should be used liberally if you aren't quite sure what is going on.
 
Old 04-20-2008, 09:53 PM   #10
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
Interesting. I went onto one of my Solaris systems to check. Discovered a snapshot sitting there that I didn't know was there (using `fssnap -i`). That solved a problem I'd been seeing in my backups and hadn't had time to investigate.

Anyway, after deleting that one, and doing an `fssnap -i` to confirm that there were none. I did an `fssnap -d /usr/local` and got precisely the same error you have been seeing: "fssnap: ioctl: error 22: Invalid argument". So that confirms that the error means you have no such snapshot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Full system backup software (easy) rushinblue Linux - Software 9 11-08-2007 01:10 PM
Full system backup. Terroth Linux - Newbie 11 06-21-2005 01:52 AM
Full System Backup from network froggo Linux - Newbie 1 05-19-2005 03:03 PM
full System Backup czezz Linux - Software 10 05-08-2005 02:50 PM
full system backup dbc254 Linux - General 6 12-26-2003 10:27 PM


All times are GMT -5. The time now is 09:30 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration