An easy way to make sure the disks are idle is to lock the file systems as you do
the backup. Sun sells a program called "lockfs" with backup copilot and Disk
Suite products.
I don't think it is included with other versions of SunOS, but I don't know. The
version of dump that comes with Copilot will lock the file system before doing
the backup and unlock it afterwords.
SunOS 4.1.1 requires a kernel hack to support this but all the later kernels
should have this built in.
The real problem, if you don't want to spend the money, is to figure out how to
write lockfs yourself. I used to have some of the details, but seem to have lost
them. Basically there are ioctls for locking a UFS.
In /usr/include/sys/filio.h I see:
/* file system locking */
#define FIOLFS _IO(f, 64) /* file system lock */
#define FIOLFSS _IO(f, 65) /* file system lock status */
#define FIOFFS _IO(f, 66) /* file system flush */
/* short term backup */
#define FIOAI _IO(f, 67) /* allocation information */
#define FIODUTIMES _IO(f, 68) /* delay update access time */#define FIODIO _IO(f, 69) /* delay write all data */
#define FIODIOS _IO(f, 70) /* status of FIODIO */
#endif /*!_sys_filio_h*/
These were provided with backup copilot, however sun appears to have neglected to
include an updated man page for filio. If you've got them in your kernel you
might be able to figure it out.
Good Luck,
--dan
|>
|> : >Does anyone have a shell script that I can use to automate ufsdump
|> : >in Solaris 2.1. We have one file system that we need automatically
|> : >backed up nightly and I was wondering if anyone has a job that will
|> : >do that? Any help will be greatly appreciated.
|>
|> : --------------------------------------------------------------------------
|> : #!/bin/sh
|> (...stuff deleted...)
|>
|> This is only part of the solution since you would like to make sure
|> the file systems backed up are idle. Else your backup tapes won't be
|> very useful.
|>
|> One idea would be to create a special intialization state for use by
|> shutdown, such that going to this state would go to single user mode,
|> write the disks to tape and restart full multiuser mode again.
|> Would this work?
|>
|> If the disk concerned is not one of the system disks I'm sure there
|> could be an easier solution. (Simply stop NFS services and starting
|> them again?)
|>
|> Any other ideas/comments?
|>
|> --
|> _
|> | | )