by Ras
18. April 2012 21:09
# Disk management
Disks consist of the folowing
1. Tracks - concentric rings on each platter
2. Cylinders - groups of tracks
3. Sectors/Blocks - 512 byte blocks
## Disk Partitions
Note: Partitions within Solaris are AKA slices
Note: x86 PCs are limited to 4 FDISK primary partitions/ Solaris requires 1 FDISK partition for its use
and slices wil be created within the FDISK partition
Note: on x86, Solaris uses a Volume Table of Contents(VTOC) to represent various slices within the lone FDISK partition on the disk
Note: On Sparc, Solaris uses VTOC to represent ALL slices on disk, NOT within lone FDISK partition
Slices rules within x86 using VTOC:
10 Slices(0-9) MAX maybe created when using VTOC on x86
10 Slices(0-9) MAX maybe create when using VTOC on x86
Slices 2,8,9 are reserved
Slice 2 - VTOC
Note: VTOC represent the disk's label and occupies Slice 2
0,1,3,4,5,6,7 available
Default Sclice allocation:
0 - /
3 - /var
7 - /export/home
Note: Disk '/ (root) & /usr' mount points is known as 'system disk' which wil be used to boot Solaris
All other disks are known as secondary disks
### Print VTOC/Disk Label - using prtvtoc
prtvtoc /dev/dsk/c0t0d0s0
c0t0d0s0
c0 - Controller # - this is the first controller on the system
t0 - an identifier for bus-oriented controller - first target or id on the bus - first hard disk
d0 - represents disk #
s0 - represent the slice/partition #
### Create Unix file system (UFS) for new slices
after creating a new slice with format command (and partition part)
newfs /dev/rdsk/c0t0d0s4
### Create mount points for newly created filesystem
mkdir /data1
mount /dev/rdsk/c0t0d0s4 /data1
on /etc/vfstab add:
/dev/rdsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /data1 ufs 2 yes -
and mount -a
#### Steps to partition and create a filesystem
1- run format to identify connected disk
2- for x86, ensure the presence of fdisk partition
3- create desired slices using 'partition' sub-menu
4- label each disk after altering partition table
5- use n'newfs' with raw location to create UFS filesystem for each slice
6- Mount each UFS slice to user-space directory
7- update /etc/vfstab file to allow changes to persist
##How to determine the filesystem
1- fstyp /dev/dsk/c0t0d0s0
2- grep mount point from /etc/vfstab
3- cat /etc/mnttab - displays currently mounted filesystems
### Temporary filesystem
TempFS provides in-memory, very fast, storage and boosts application performance
1- Determine the amount of available memory
- prtconf | grep -i memory
2- Execute mount command
-
mount -F tmpfs -osize=100m swap /tmpdata
df -h | grep -i tempdata
tempfs will die with reboot
### Swap creation - files & partition
swap -l #shows which device is configured for swap and the space
swap -s #shows allocated, available and used space
### swap file creation
1- mkfile - creates zero-filled swap file
2- swap -a - activates the swap file
mkfile 512m /data2/swap2
swap -a /data2/swap2
swap -d /data2/swap2 - removes swap space