Formating, Partitioning and Check
Type the command format and
the menu like below will be displayed:
AVAILABLE DISK SELECTIONS:
0. c0t1d0
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t2d0 sol251
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@2,0
2. c0t3d0
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number):
Now type 0, 1, 2 to select the disk to be formated.
It is possible to select a number of disks to be formatted by the
wildcard field as the next
format /dev/rdsk/c2* - format on all drives connected to controller c2 only
If the disk is specified the next menu will be got:
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format>
Make sure that disk you will format does not contain an important
information and the backup done!
Now select the partition menu
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
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
quit
partition>
print - Display partitions
Partitions example:
Total disk cylinders available: 2036 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 101 50.20MB (102/0/0) 102816
1 swap wu 102 - 362 128.46MB (261/0/0) 263088
2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 alternates wm 363 - 1317 470.04MB (955/0/0) 962640
6 usr wm 1318 - 2035 353.39MB (718/0/0) 723744
7 home wm 1237 - 2035 393.26MB (799/0/0) 805392
partition>
Note, that
Partition 0 is always root
Partition 1 is always swap
Partition 2 is always whole disk
After partitioning is finished create file system
by the command newfs
newfs - front-end to the mkfs for making UFS file system
newfs -N - only print the file system parameters without actually
creating the file system
fsck - check and repair file system
fsck interactively repairs inconsistent file system conditions.
The default action is to wait for the user respond.
Some corrections will result in loss of data
The file system will be unmounted.
fsck /dev/rdsk/c0t2d0s7
- check device
fsck - check the files systems listed in /etc/vfstab
fsck -m - check but do not repair
fsck -y - assume a "yes" response to all questions asked by fsck
Mount file system
mount - attaches a file system to the file system hierarchy
at the mount point
umount - unmount a currently mounted file system
mount /dev/dsk/c0t2d0s3 /usr
(file system) (mount point)
mount -F FStype - specify file system type
mount -a - mount all
mount -m - do not append an entry to /etc/mnttab
mount -o "specific options" ( the default is underlined )
rw | ro - read-write or read-only.
suid | nosuid - setuid execution is allowed or disallowed.
bg | fg - retry mount in the bg or in the fg.
Mount in time of boot is executed by configuration file /etc/vfstab.
Here is the example of this file.
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t2d0s1 - - swap - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t2d0s0 /dev/rdsk/c0t2d0s0 / ufs 1 no -
/dev/dsk/c0t2d0s3 /dev/rdsk/c0t2d0s3 /usr ufs 1 no -
/dev/dsk/c0t2d0s4 /dev/rdsk/c0t2d0s4 /opt ufs 2 yes -
/dev/dsk/c0t1d0s7 /dev/rdsk/c0t1d0s7 /export ufs 2 yes -
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /data ufs 2 yes -
dbs_system:/misc - /misc nfs no yes bg
Note the last line is needed for mounting of the remote system by NFS.
The mode bg means to continue mount the remote system in background
and do not lock the boot if remote system is not accessible currently.
What is it inode? Command find
File inode is the data structure that contains all
administrative information about this file. Every inode is
identified by pair ( device number, inode number ).
inode data structure contains
- file size
- last access time
- last modification time
- creation time
- counter of catalog elements ( links )
- list of data bloks
inode - symbolic and hard links
Symbolic link is an indirect pointer to file.
Symbolic link may span different FS and may reference to directories
ln -s "source file" "target file"
ls -il print the inode number in the first column of the report
Hard link is a pointer to a file and is indistinguishable
from the original. Any changes to a file are effective independent of the
name used to the file. Hard links may not span FS and
may not refer to directories.
The command ln by default creates hard links.
Hard links are very effectives.
inode - find a file by size or time information
find . -name "fil*" -print - simple regular search of the file with
- filename pattern "fil" and wildcrad suffix.
find . -size +100 -print - file size > 100 blocks ( block = 512b )
find . -size 557c -print - file size = 557 characters
find / -name core -mtime +7 - file was modified 7 days ago
find ~ -atime +31 - file was accessed 31 days ago
find . -ctime -2 - file status was changed for a period
- of two days. File status is the
permission and ownership of the file.
Combined expression for find
find / -xdev \( -ctime -0.5 -o -mtime -0.5 \) -ls
-xdev restricts the search to the current file system
-ls prints the file with its associated statistics
tar - create tape archives
The command tar copies file to and restores files from the tape.
On the directories tar acts on the subtree.
tar cvf /dev/rmt/0lbn A B - create backup of directories A and B
tar tvf /dev/rmt/0lbn - to read the tape
tar xvf /dev/rmt/0lbn - restore from tape to the current directory
tar options ( only one these must be selected):
c - create a new tape
t - print all names of files stored on the tape
x - extract files from tape
other tar options:
f arc - store files in or extract files from archive "arc"
v - print function letter ( xfor extraction or a for
archive ) and name of files
m - update modification time to the time of extraction
o - change ownership to the user running program
Command mt:
mt rew - rewind current type to start
mt -f /dev/rmt/0lbn fsf 2 - rewind 2 volumes of the type
[Home]
[Five UNIX Tips]
[Tip 1 - File system and UNIX shell]
[Tip 2 - User environment and multi processing]
[Tip 3 - UNIX windows]
[Tip 4 - NFS protocol and shareable systems]
[UNIX vendors, Home Pages, Workstations, FAQs, News Groups]
Maintained by Rafael Stekolshchik
Last updated: July 4, 1998
klivlend1@yahoo.com
This page hosted by
Get your own Free Home Page