|
|
solaris8 - Day 4
Goals
In this session you will:
- backup your box
- control your discspace usage
POST
- log into your machine as a non-priviliged user
- how's your box doing: discspace, load, users, etc?
- become
root and take your machine down to a single-user (maintenance) mode.
- what controls the order of events on the transition to single-user mode?
- bring your box up to a normal multiuser mode
- what controls the order of events on the transition to multi-user mode?
- assume the following mountpoints:
/dev/dsk/c0t0d0s0 /swap
/dev/dsk/c0t0d0s1 /
/dev/dsk/c0t0d0s3 /usr
/dev/dsk/c0t0d0s4 /home
How would you handle a filesystem corruption problem on:
backups
workstation backups
- commercial products v. roll-your-own
- full v. incremental backups
- offsite storage
- Whole OS v. data and config files
- exclusions
- leading
/ stripped?
before restoring from backup, make sure your backup is better than what you've got now...
the usual suspects
tar, useful for backing up hierarchies (dirs and subdirs). gtar versions will let you append and inline compress.
- create
tar -cvf target.tar source (no tape)
tar -cv /dev/tapedevice source (tape)
tar -czv /dev/tapedevice source (tape, inlined gz)
- list
tar -tvf tarball.tar [path]
- extract
tar -xvf tarball.tar [path]
- check to see if the leading path is stored
- extract to STDOUT with a switch
- may inline compression, or compress after the fact (usually
gzip)
- use exclusion files to exclude files you don't want to back up.
cpio, useful for incremental backups.
- cpio works on arbitrary files; use
find to locate the files
- cpio includes rudimentary compression
- use
-local switch to limit to your own box
- create (copy out to archive)
find criteria -print | cpio -o > target.cpio
- list
cpio -it < archive.cpio 'filename'
extract (copy in from archive) cpio -im archive.cpio 'string*'
pax, the posix-compliant archiver. Default format is ustar (posix tar)
- four modes: list (default), read, write, copy
- create a cpio archive:
find output | pax -x cpio -w -f cpio.pax
- create a tar archive:
find output | pax -w -f tarball.pax
- append/update a tar archive:
find output | pax -a -w -f tarball.pax
- list an archive:
pax -v -f archive.pax
- extract an archive:
pax -r 'files' < archive.pax
dump-style utilities, useful for non-portable, schedulable backups
- dump works on hierarchies, and does incrementals internally
- incrementals handled by numbers. Each incremental backs up files changed since last lower-numbered backup
0 traditional for monthly backups. Done from single-user runlevel
5 traditional for weekly backups
9 traditional for daily backups
- dump is not portable between systems
- rudimentary compression
- in root dir, unpacks in place; otherwise relative to local dir
- create
ufsdump levelf target.dump source
- list
ufsrestore -tf file.dump filename
- extract
ufsrestore -rf file.dump filename
software management
You will install software:
- from sourcecode
- from precompiled binaries
package management with the CLI tools
- installing from the spool
- files are not copied to the spool directory, they are actually spooled:
pkgadd -d device-name -s spooldir pkgid ; pkginfo -d spooldir | grep pkgid
- the default location to look for packages is
/var/spool/package
-
-
- installing individual packages
pkgadd -d directory pkgid
pkgchk -v pkgid
- information about installed packages
- removing installed packages
package management with admintool
patch management
Solaris 2.6 and later use command line tools to apply patches, although scripts are also packed.
Support customers get CDs every few weeks. Nonsupported customers grab patches off the net: http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access
showrev -p, patchadd -p show patches
pkgparam pkgid PATCHLIST shows patches for a given pkg
patchadd patchid shows patches for a given pkg
patchrm patchid shows patches for a given pkg
Homework
http://www.mousetrap.net/syllabus/solaris8/day4.html
$Id: day4.orb,v 1.6 2002/10/27 20:59:53 mouse Exp $
|
© 1994-2002 jason carr.
distributed under the terms of the GNU Free Documentation License.
jason carr
Reminders
- Classroom temperature can be wildly variable. Dress lightly and bring layers.
- your username is based on the class title and the last two digits of your workstation's hostname.
- remember to take your work with you.
|
|