Professional Documents
Culture Documents
General Commands -:
# banner Hi
# id ---> Displays user and group identification for session
# who [am i] ---> Reports information about users who are currently logged on
to a system
who :
user2
# ls -l
-rw-r--r--
user3
class 37
Jul 24
11:06
f1
-rwxr-xr-x
user3
class 52
Jul 24
11:08
f2
Printer -:
# lp report ---> Send requests to a line printer
# lp-n2 memo1 memo2
# lp-dlaser-t"confidential" memo3
# lpstat -t ---> Print spooler status information
# cancle <printer name>
# mkdbm <f-name.dbm> < <f-name.txt>
# mkdbm <f-name.dbm> << <f-name.txt>
File Permissions -:
# chmod 755 <f-name> or <d-name> ---> Change the file access
# chmod u+x,g+x,o+x file
# chown owner:group <f-name> or <d-name> ---> Change the owner and
group of a file / Change the owner of a file
# chgrp group <f-name> or <d-name> ---> Change the group of a file
# umask ---> Change default file access
# umask g=r,o=
# newgrp group-name ---> Switch your group identifier
# su - <user-name> ---> sudo login, - is going to home-directory.
Display variable values -:
# env ---> User Environment.
# PATH=/usr/bin/X11:/usr/bin
# set
# whereis cd ---> Looking for command
# ps -ef ---> Monitoring process
# ps -f
# exec ps -f
awk -:
# awk F : {print $1 $7} /etc/passwd ----> # vi /etc/passwd
x1:x:100:100: :/home/x1:/bin/sh
$1 $2 $3 $4 $5
$6
$7
2. Insert Mode
3. Append Mode
4. Esc
Ctrl+f ----> Forword page by page Ctrl+b ----> Backword page by page
Esc:$ ----> End of the file Esc:1 ----> first line
Esc:20 ----> go to 20th line
b ----> Curser moves beginning to ending
^ ----> Curser moves ending to beginning
i ----> insert mode
Esc ----> Command mode
a ----> append mode
0 ----> insert a new line
x ----> delete a character
JFS
NFS
/etc/fstab :
boot process the /sbin/init.d/localmount script executes the mount -a command
for automatically mounts FS are located in /etc/fstab
Syntax for /etc/fstab :
block:directory:type:options:bckup-frequency:pass-number:comment
type:- cdfs,hfs,nfs,vxfs,swap,swapfs,lofs,ignore
options:- rw,ro,suid,nosuid,quota,noquota
pass-number:- set by the fsck command to determine the order in which fs check
are done.
# fsck -F hfs /dev/vg01/myfs1 --> FS check for shutdown improperly, FS curupt
# fsck -F jfs /dev/vg01/myfs1
/bin
/dev
The primary directory for logical device names. The contents of this
directory are symbolic links that point to device files in the
/devices directory.
/devices
/etc
/export
/home
/kernel
/mnt
/opt
/platform
/sbin
/tmp
The directory for temporary files. This directory is cleared during the
boot sequence.
/usr
The directory that contains programs, scripts, and libraries that are
used by all system users. The directory name is an acronym for
UNIX system resources.
/var
Description
Dial-out device files for UNIX-to-UNIX Copy Protocol
(UUCP) and Point-to-Point Protocol (PPP)
/dev/dsk
/dev/fbs
/dev/fd
File descriptors
/dev/md
/dev/pts
/dev/rdsk
/dev/rmt
/dev/sound
/dev/term
Serial devices
Description
/etc/acct
/etc/cron.d
/etc/default
/etc/inet
/etc/init.d
/etc/lib
/usr
/etc/lp
/etc/mail
Description
/etc/nfs
/etc/opt
/etc/rc#.d
/etc/skel
Description
/usr/bin
/usr/ccs
/usr/demo
/usr/dt
/usr/include
/usr/java
/usr/kernel
/usr/lib
/usr/opt
/usr/sbin
/usr/spool
Types of files:
Regular or ordinary files
Directories
Symbolic links
Device files
Ex:
# cd /etc;ls -l
drwxr-xr-x
adm
drwxr-xr-x
lrwxrwxrwx
adm
acct
root bin
apache
root root
14 Apr 3 11:05
-rw-r--r--
root bin
50 Apr 3 10:45
auto_home
-rw-r--r--
root bin
auto_master
# cd /devices/pci@1f,0/pci@1,1/ide@3;ls -l
brw-------
root sys
crw-------
root sys
brw-------
root sys
crw-------
root sys
Regular files
d Directories
l
Symbolic links
Symbolic Links:
inode numbers are different
# ls -l /bin
lrwxrwxrwx 1 root root 9 Mar 22 10:39 bin -> ./usr/bin
# ln -s file1 link1
hsfs
pcfs
formatted file systems. Users can use UNIX commands for direct
read and write access to PC-DOS files.
udfs
The Universal Disk Format file system is used for optical storage
targeted at DVD and CD-ROM media. The UDF file system
allows universal data exchange and supports read and write
operations.
swapfs
fdfs
The file descriptor file system provides explicit names for opening
files by using file descriptors (for example, /dev/fd/0, /dev/fd/1,
/dev/fd/2) in the /dev/fd directory.
procfs
mntfs
# Check filesystem
** /dev/rdsk/c0d1s0
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 9 used, 47966 free (14 frags, 5994 blocks, 0.0% fragmentation)
# fsck -o f,p /dev/rdsk/c0d1s0 : # f option of the fsck command forces a file
system check, and p option checks and fixes
the file system noninteractively (preen).
/dev/rdsk/c0d1s0: 2 files, 9 used, 47966 free
/dev/rdsk/c0d1s0: (14 frags, 5994 blocks, 0.0% fragmentation)
# fsck /dev/rdsk/c0t0d0s7 : # check a file system using the unmount point
filesystem
# fsck /export/home :
# newfs NV /dev/rdsk/c0t0d0s5 :
<size>
<avail>
<capacity>
<Mounted on>
# du -k, -s, -a : # display the number of disk blocks used by directories and files
# quot -af
(or)
/dev/rdsk/c0d0s0 (/):
1120970 54185 root
801
46 uucp
62
11 adm
13
13 lp
11
4 bin
4 daemon
8 nobody
2 smmsp
# /etc/vfstab :
o The /etc/mnttab file is really an mntfs file system that provides readonly information directly from the kernel about mounted file systems on
the local host.
o Each time a file system is mounted, the mount command adds an entry
to this file. Whenever a file system is unmounted, its entry is removed
# Indicates that
# mountall -l # mount only the local file systems listed in the /etc/vfstab file
# mount /dev/dsk/c1t4d0s0 /database
Ex:
# cat /etc/vfstab
#device
device
#to mount
mount
FS
fsck
mount mount
point
type
pass
at boot options
to fsck
#
fd
/dev/fd fd
/proc -
/proc proc
/dev/dsk/c0d0s1 -
no
-
no
swap
no
/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0
swap
/tmp
tmpfs -
yes
ufs
no
# cat /etc/default/fs
LOCAL=ufs
# cat /etc/dfs/fstypes
nfs NFS Utilities
autofs AUTOFS Utilities
cachefs CACHEFS Utilities
# fstyp /dev/rdsk/c0d1s0
# umountall l : # umount only the local file systems listed in the /etc/vfstab file
# unmount -f /dev/dsk/c0t0d0s6 :
# unmount forces
# fuser -cu mount_point : # displays the name of the file system and the
user login name for each process currently active in
the file system.
# fuser -ck mount_point :
# fuser -c mount_point : # Verify that there are no processes accessing the file
system.
# umount mount_point : # Unmount the file system.
# umount -f mount_point :
# /etc/vold.conf :
# /etc/rmmount.conf :
# vold :
# mount CD-ROM
HP-UX
Default File System
Device Configuration :
/dev --> Listing device files with ll comman
Linux
ext2, ext3
Solaris
ufs
b is Block Device Files : Accessing a device via a block device file, the
system reads and writes data through a buffer in memory, rather than
transferring the data directly to the physical disk
major# : identifies the "kernel driver" that should be used when the
device is accessed.
I is instance number
Class I
H/W
disk 0 8/12.2.0
Path
Driver
sdisk CLAIMED
S/WState H/Wtype
DEVICE
SEAGATE
Description
ST32171W
c#d#s# :
Logical device names: Logical disk device names are symbolic links to the
physical device names kept in the /devices directory.
# ls /dev/dsk
c0t0d0s0 c0t0d0s4 c0t3d0s0 c0t3d0s4 c0t6d0s0 c0t6d0s4
c0t0d0s1 c0t0d0s5 c0t3d0s1 c0t3d0s5 c0t6d0s1 c0t6d0s5
Phyical Device names: Physical device names uniquely identify the physical
location of the hardware devices on the system and are maintained in the
/devices directory.
# ls -l /dev/dsk/c0t0d0s0
lrwxrwxrwx 1 root root 46 Jun 16 19:07
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
/dev/dsk/c0t0d0s0
->
system
# format :
devfsadm Command :
o Many systems are running critical customer applications on a 24-hour,
7-day-a-week basis. It might not be possible to perform a
reconfiguration boot on these systems. In this situation, you can use
the devfsadm command.
o The devfsadm command performs the device reconfiguration process
and updates the /etc/path_to_inst file and the /dev and /devices
directories during reconfiguration events.
Syntax:
#devfsadm -c device_class :
# devfsadm -c disk
# devfsadm -c disk -c tape -c audio
Syntax:
#devfsadm -i driver_name : # configure only devices for a named driver, use
the -i option.
# devfsadm -i dad : # To configure only those disks supported by the dad driver
# devfsadm -i sd : # To configure only those disks supported by the sd driver
# devfsadm -i st : # To configure devices supported by the st driver
# devfsadm -v
:
# To print the changes made by the devfsadm
command to the /dev and /devices directories
# devfsadm -C
:
# To invoke
unreferenced symbolic links for devices
# format :
cleanup
# Disk partition
- select a disk
- select (define) a disk type
- select (define) a partition table
- describe the current disk
- format and analyze the disk
- run the fdisk program
- repair a defective sector
- translate a disk address
- write label to the disk
- surface analysis
- defect list management
- search for backup labels
- read and display labels
- save new disk/partition definitions
- set 8-character volume name
- execute <cmd>, then return
PARTITION MENU:
0
- change `0' partition
1
- change `1' partition
2
- change `2' partition
3
- change `3' partition
4
- change `4' partition
5
- change `5' partition
6
- change `6' partition
7
- change `7' partition
routines
that
remove
Tag
Flag
alternates
unassigned
backup
wu
unassigned
Cylinders
Size
Blocks
wm 1 - 102
50.20MB
(102/0/0) 102816
wm 102 - 203
50.20MB
(102/0/0) 102816
0 - 4157 2.00GB
(4158/0/0) 4191264
wm 0
0
(0/0/0)
unassigned
wm
unassigned
unassigned
wm
wm
0
0
0
0
unassigned
wm
boot
wu
0.49MB
(1/0/0)
alternates
wm
0.98MB
(2/0/0)
(0/0/0)
(0/0/0)
0
(0/0/0)
(0/0/0)
partition> 1
Part
Tag Flag Cylinders
Size
Blocks
1 unassigned wm 102 - 203
50.20MB (102/0/0) 102816
Enter partition id tag[unassigned]: ^D
Note:
Part: The slice number. Valid slice numbers are 0 through 7
Tag: A value that indicates how the slice is being used.
0 = unassigned
1 = boot
2 = root
3 = swap
4 = usr
5 = backup
6 = stand
8 = home
Sun StorEdge Volume Manager array tags:
14 = public (region)
15 = private (region)
Flag: 00 wm = The disk slice is writable and mountable.
01 wu = The disk slice is writable and unmountable. This is the default
state of slices dedicated for swap areas.
10 rm = The disk slice is read-only and mountable.
11 ru = The disk slice is read-only and unmountable.
Cylinders:
The starting and ending cylinder number for the disk slice.
Size:
The slice size: Mbytes (MB), Gbytes (GB), blocks (b), or cylinders
(c).
Blocks:
The total number of cylinders and the total number of sectors
per slice.
/etc/format.dat :
# You can save customized partition tables to the
/etc/format.dat file and use them to quickly partition other disks of the same type
on the system.
save a customized partition table :
partition> name
Enter table name (remember quotes): 2gb-disk2
partition> quit
format> save
Saving new disk and partition definitions
Enter file name["./format.dat"]: /etc/format.dat
format>
Using the Customized Partition Table :
format> partition
partition> select
0. 2gb-disk2
1. original
Specify table (enter its number)[1]: 0
partition 0: starting cylinder 1 is out of range
partition> label
Ready to label disk, continue? yes
partition> quit
format> verify
format>quit
Managing Disk Labels :
Viewing the Disk VTOC (volume table of contents): You can use two methods for
locating and viewing a disks label or VTOC:
1. Use the verify command from the format utility
2. Invoke the prtvtoc command from the command line
Ex:
format> verify
Primary label contents:
Volume name = < >
ascii name = <SUN1.3G cyl 1965 alt 2 hd 17 sec 80>
pcyl = 3500
ncyl = 1965
acyl = 2
nhead = 17
nsect = 80
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 602 400.43MB (603/0/0) 820080
1 swap wm 603 - 693 60.43MB (91/0/0) 123760
2 backup wm 0 - 1964 1.27GB (1965/0/0) 2672400
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 home wm 694 - 1964 844.02MB (1271/0/0) 1728560
# prtvtoc /dev/rdsk/c1t0d0s2 :
* /dev/rdsk/c1t0d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 80 sectors/track
* 17 tracks/cylinder
* 1360 sectors/cylinder
* 3500 cylinders
* 1965 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
USER ADMIN
Imp. Files :
/etc/passwd
<LoginID>:<passwd>:<UID>:<GID>:<Comment>:<home_directory>:<login_sh
ell>
/etc/shadow
<LoginID>:<password>:<lastchg>:<min>:<max>:<warn>:<inactive>:<expire>
/etc/group
<groupname>:<group-password>:<GID>:<user name-list>
Commands :
# useradd [-u uid] [-g gid] [-G gid,gid] [-d dir] [-m] [-s shell] [-c
comment] [-k skel-dir] [-o] [-e expire] [-f inactive] <loginname>
# usermod [-u uid] [-o] [-g gid] [-G gid,gid] [-d dir] [-m] [-s shell] [-c
comment] [-l new log name] [-f inactive] [-e expire] <loginname>
# groupadd [-g gid] [-o] <group-name> #[-o is duplicated gid / non-unique
uid or gid]
# groupmod [-g gid] [-o] [-n name] <group-name>
# userdel r <login-name>
# groupdel <group-name>
# passwd <user-name>
Options :
-l
-u
-d
-n
-x
-w
-i
-f
# id <user-name> # Shows user id, name and primary and secondry group's
# finger <user-name>
# chage -l <user-name>
# newgrp <group-name>
# grpck
each
entry, and whether all login names appear in
the password file.
# useradd -D
or
unlocked
information]
-l <login-name>
-x <login-name>
# Prints an
extended
set
of
information
about
each
selected
status
message
(when
password expires.
Password files
HP-UX
/etc/passwd
Linux
/etc/passwd
Solaris
/etc/passwd
Group files
/tcb/files/auth/r/root
/etc/group
/etc/shadow
/etc/group
/etc/shadow
/etc/group
Max # of user ID
Allow/Deny remote login
/etc/logingroup
2147483647
/etc/securetty
65535
/etc/securitty
2147483647
/etc/default/login
{console}
{ttyp1}
{CONSOLE=/dev/consol
99
e}
60001
&
65534
99
(nobody4)
60002
&
65534
-2
-2 (nogroup)
(nogroup)
Useradd
Userdel
Logins
Usermod
Useradd
Userdel
Usermod
/
useradd
userdel
logines
usermod
/etc/default/passwd
etc/default/usera
Sudo File
dd
/etc/sudoers (or)
Default Shell
visudo
Bourn
POSIX
r-- r-- r--
/bin/bash
rw- r-- r-r-- --- ---
Note:
Solaris:
UID / GID numbers for regular users / groups range from 100 to 60000 unique.
1 99 # System accounts
60001 # Nobody
60002 # No Access user
14 GID is Sys. Admin group
Password : 13 Characters, *LK* is Locked account
useradd default's location is /etc/default/passwd
MAXWEEKS=
MINWEEKS=
PASSLENGTH=6
User lock ex:
test:*LK*:13427::::::
User unlock ex:
test:G9HMdpFjiJzSE:13427::::::
Linux :
useradd default's location is /etc/default/useradd
GROUP=501
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
User lock ex:
test:!!$1$8jjA2q6e$t9RvGdLM7bVZJBT6AXH8W.:13430:1:20:2:1::
User unlok ex:
test:$1$8jjA2q6e$t9RvGdLM7bVZJBT6AXH8W.:13430:1:20:2:1::
HP-UX:
Permission on /etc/passwd file is r--r--r-- only
SAM --- Accounts for Users and Groups --- Actions --- Add........
Sudo-permissions :
Linux :
# vi /etc/sudoers (or) visudo
username
ALL=(ALL) command,command,........
root
ALL=(ALL) ALL
User profile's:
Linux :
Born Shell /bin/bash
.bash_history .bash_logout .bash_profile .bashrc .gtkrc .kde/
Shell's:
Linux :
Default shell is Born Shell /bin/bash
Package Administration :
# /var/sadm/install/contents :
Patch Administration :
http://sunsolve.sun.com : # To access patch documents through the World
Wide Web
# showrev p:
# patchadd p :
# /var/sadm/patch :
Download patches:
# cd /var/tmp
# ftp sunsolve.sun.com
Name (sunsolve:usera): anonymous
Password:yourpassword
ftp> cd /pub/patches
ftp> get Solaris9.PatchReport
ftp> mget 112605*
ftp> bye
# unzip 105050-01.zip :
# patchrm
# No error.
# Usage error.
# patchrm 105050-01 :
# to remove a patch
Note: Those components of the /var/sadm directory that are updated during the
installation of patch 105050-01.
# /var/sadm/pkg/SUNWhea/pkginfo
# /var/sadm/pkg/SUNWhea/Save/105050-01
# /var/sadm/pkg/SUNWcsu/pkginfo (Update by patch)
# /var/sadm/pkg/SUNWcsu/pkginfo/Save/105050-01/undo.z (Archive
of old files replaced by patch)
# /var/sadm/pkg/patch/105050-01/README.105050-01
# /var/sadm/pkg/patch/105050-01/log
An NFS server is a machine that exports its local directories (makes them
available for client machines to mount using NFS).
Following are the tasks involved in configuring and administering an NFS server.
The first two tasks are the only ones required to get your server up and running.
i)
ii)
iii)
iv)
v)
ii)
1. On the NFS server, issue the following command for a list of all the NFS
clients that have mounted the directory you want to unexport:
/usr/sbin/showmount -a
2. On every NFS client that has the directory mounted, issue the following
command for a list of the process IDs and user names of everyone using the
mounted directory:
/usr/sbin/fuser -u servername:/directory
3. Warn any users to cd out of the directory, and kill any processes that are using
the directory, or wait until the processes terminate. You can use the following
command to kill all processes using the directory:
/usr/sbin/fuser -ck local_mount_point
4. On every NFS client that has the directory mounted, issue the following
command to unmount the directory:
/usr/sbin/umount local_mount_point
or
/usr/sbin/umount servername:/directory
5. On every NFS client that had the directory mounted, use a text editor to
comment out or remove the line in the /etc/fstab file that lists the directory you
want to unexport.
6. On the NFS server, use a text editor to remove the line in the /etc/exports file
that lists the directory you want to unexport.
7. On the NFS server, issue the following command to unexport the directory:
/usr/sbin/exportfs -u directory
For more information, see the following man pages: showmount(1M), fuser(1M),
umount(1M), and exportfs(1M), make(1), and ypmake(1M).
iv)
1. On the NFS server, issue the following command for a list of all the NFS
clients that have directories mounted from the NFS server you are planning to
disable:
/usr/sbin/showmount -a
2. On every NFS client listed by the showmount command, issue the following
command for each directory that is mounted from your NFS server:
/usr/sbin/fuser -u servername:/directory
This command lists the process IDs and user names of everyone using the
mounted directory.
3. Warn any users to cd out of the directory, and kill any processes that are using
the directory, or wait until the processes terminate. You can use the following
command to kill all processes using the directory:
/usr/sbin/fuser -ck local_mount_point
4. On every client that has directories mounted from your server, issue the
following command:
/usr/sbin/umount -h servername
5. If your server will be down for a long time, edit the /etc/fstab file on each client
to comment out or remove any NFS mounts from the server you are planning to
disable.
6. Issue the following command on the server to unexport all exported
directories:
/usr/sbin/exportfs -au
7. On the NFS server, edit the /etc/rc.config.d/nfsconf file to set the
NFS_SERVER variable to 0. This prevents the NFS server daemons from
starting up when your system reboots. If your server will be down only a short
time, this step is unnecessary.
NFS_SERVER=0
8. Edit the /etc/inetd.conf file to comment out the line that contains rpc.mountd (if
it exists) and the lines for the other RPC services.
9. Issue the following command to disable NFS server capability:
/sbin/init.d/nfs.server stop
Client:
1. In the /etc/fstab file, use a text editor to add a line for each remote directory
you want mounted on your system. If the /etc/fstab file does not exist, you will
have to create it. A line in the /etc/fstab file has the following
ii)
1. On the NFS client, issue the following command to determine whether the
directory you want to unmount is currently in use:
/usr/sbin/fuser -cu local_mount_point
This command lists the process IDs and user names of everyone using the
mounted directory.
2. Warn any users to cd out of the directory, and kill any processes that are using
the directory, or wait until the processes terminate. You can use the following
command to kill all processes using the mounted directory:
/usr/sbin/fuser -ck local_mount_point
3. If you want to remove the mounted directory permanently, use an editor to
remove the appropriate line in the /etc/fstab file.
4. Issue the following command at the HP-UX prompt:
/usr/sbin/umount local_mount_point
iii)
1. On the NFS client, issue the mount(1M) command with no options, to get a list
of all the mounted file systems on the client:
/usr/sbin/mount
2. For every NFS-mounted directory listed by the mount command, issue the
following command to determine whether the directory is currently in use:
/usr/sbin/fuser -cu local_mount_point
This command lists the process IDs and user names of everyone using the
mounted directory.
3. Warn any users to cd out of the directory, and kill any processes that are using
the directory, or wait until the processes terminate. You can use the following
command to kill all processes using the mounted directory:
/usr/sbin/fuser -ck local_mount_point
4. Issue the following command on the client to unmount all NFS-mounted
directories:
/usr/sbin/umount -at nfs
5. Edit the /etc/rc.config.d/nfsconf file on the client to set the NFS_CLIENT
and AUTOMOUNT variables to 0. This prevents the client processes from
starting up again when you reboot the client.
NFS_CLIENT=0
AUTOMOUNT=0
6. Issue the following command to disable NFS client capability:
/sbin/init.d/nfs.client stop
Note:
NFS runs over both UDP and TCP transport protocols. The default
The NFS client fails a reboot Error. If you attempt to boot an NFS client
and the client-node stops, waits, and echoes the following message:
Setting default interface for multicast: add net 224.0.0.0: gateway:
client_node_name.
these symptoms might indicate that a client is requesting an NFS mount
using an entry in the /etc/vfstab file, specifying a foreground mount from a
Enter the pgrep -xl mountd command. If the mountd daemon is not
running, start it using the /etc/init.d/nfs.server script, first with the
stop flag and then with the start flag.
o The stale NFS file handle Error. The following message appears when a
process attempts to access a
remote file resource with an out-of-date file handle. A possible cause for
the stale NFS file handle error is that the file resource on the server
moved. To solve the stale NFS file handle error condition, unmount and
mount the resource again on the client.
1. The unknown host Error. The following message indicates that the host
name of the server on the client is missing from the hosts table.
nfs mount: sserver1:: RPC: Unknown host
To solve the unknown host error condition, verify the host name in the
hosts database that supports the client node. Note The preceding
example misspelled the node name server1 as sserver1.
2. The mount point Error. The following message appears during the boot
process or in response to
an explicit mount request and indicates a non-existent mount point.
mount: mount-point /DS9 does not exist.
To solve the mount point error condition, check that the mount point exists
on the client. Check the spelling of the mount point on the command line
or in the /etc/vfstab file on the client, or comment out
the entry and reboot the system.
3. The no such file Error. The following message appears during the boot
process or in response to
an explicit mount request, which indicates that there is an unknown file
resource name on the server.
4. No such file or directory To solve the no such file error condition, check
that the directory exists
on the server. Check the spelling of the directory on the command line or
in the /etc/vfstab file.
other operations (read, write, and so on) are not visibly interrupted, they have no
reliable way to prevent other clients from obtaining a lock on a file they think they
have locked.
In the event of client failure, the locks are not immediately freed. Nor is there a
timeout. If the client process terminates, the client OS kernel will notify the server,
and the lock will be freed. However, if the client system shuts down abnormally
(e.g. power failure or kernel panic), then the server will not be notified. When the
client reboots and remounts the NFS exports, the server is notified and any client
locks are freed.
If the client does not reboot, for example if a frustrated user hits the power switch
and goes home for the weekend, or if a computer has had a hardware failure and
must wait for replacement parts, then the locks are never freed! In this
unfortunate scenario, the server lock daemon must be restarted, with the same
effects as a server failure.
Workaround: If possible (given program source and skill with code modification),
remove locking and insure no inconsistency occurs via other mechanisms,
possibly using atomic file creation (see below) or some other mechanism for
synchronization. Otherwise, build platforms never fail and have a staff trained on
the implications of NFS file locking failure. If NFS is used only for files that are
never accessed by more than a single client, locking is not an issue.
Note: A status monitor mechanism exists to monitor client status, and free client
locks if a client is unavailable. However, clients may chose not to use this
mechanism, and in many implementations do not.
c. File Locking API
In Unix, there are two flavours of file locking, flock() from BSD and lockf() from
System V. It varies from system to system which of these mechanisms work with
NFS. In Solaris, Sun's Unix variant, lockf() works with NFS, and flock() is
implemented via lockf(). On other systems, the results are less consistent. For
example, on some systems, lockf() is not implemented at all, and flock() does not
support NFS; while on other systems, lockf() supports NFS but flock() does not.
Regardless of the system specifics, programs often assume that if they are
unable to obtain a lock, it is because another program has the lock. This can
cause problems as programs wait for the lock to be freed. Since the reason the
lock fails is because locking is unsupported, the attempt to obtain a lock will
never work. This results in either the applications waiting forever, or aborting their
operation.
These results will also vary with the support of the server. While typically the NFS
server runs an accompanying lock daemon, this is not guaranteed.
Workaround: Upgrade to the latest versions of all operating systems, as they
usually have improved and more consistent locking support. Also, use the lock
daemon. Additionally, try to use only programs written to handle NFS locking
properly, veified either by code review or a vendor compliance statement.
# /dev/rmt/#tn
= Tape density [ l m h c u ]
n = No rewind
rmt = removable media tape
# cat /etc/dumpdates :
Backup :
0 9 # Backup levels v
# Verify
# Size estimate l
# Autoload
# Offline u
# Update /etc/dumpdates
Restore :
t
restoresymtable file
# newfs /dev/rdsk/c0t0d0s0 :
# Create new FS
# Mount FS
# cd /abc :
# ufsrestore rf /dev/rmt/0
# restore / (root) FS
# rm restoresymtable
# cd /usr/platform/uname m/lib/fs/ufs
# installboot bootblk /dev/rdsk/c0t0d0s0
# umount /abc :
# umount /abc
# fsck /dev/rdsk/c0t0d0s0 :
# init 6
Restore /usr & /var file system in this example:
Repeat the steps above, except step 6.
Restore regular file system /export/home in this example:
# newfs /dev/rdsk/c#t#d#S#
# mount /dev/dsk/ c#t#d#S# /mnt
# cd /mnt
# ufsrestore rf /dev/rmt/#
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/ c#t#d#S#
rewind :
offline
fsf
# cat /etc/dumpdates : # Show the level of the last backup. Day, date & time
of Backup
Tar backup: (tar = tape archive) :
$ tar cvf /dev/rmt/0 .