13. Hard Drives

All hard drives have 8 partitions, that you can adjust in size. Each partition is called a slice. For slice (partition) 0 the true name would be /dev/dsk/c0t3d0s0 (the last part (s0) is the name of the slice). Let’s break down this name (or address):

Breakdown of device (hard drive) names

/dev /dsk /c0 t3 d0 s0
Devices directory Hard disk (c=controller) usually c0 (SCSI port) (t=target) in this case target disk 3 (d=disk) usually 0 unless you have 2 or more hard drives per target (s=slice) or partition, between 0-7

*Note: some devices (targets) have two disks in them

Every time you have a device you will have two entries: one in /dev/dsk/ and one in /dev/rdsk. The following explains the nuances between them:

Differences between dsk, and rdsk devices

/dev/dsk/ (device special device) /dev/rdsk/ (character special device)
Use this to move a large block of data using these commands:
  • Mount

  • Ufsdump

Use this to move small bits of data at a time (one character at a time) using these commands:
  • Newfs

  • Fsck

If you are interested in the content, use this one If you are interested in the structure use this one

To see which devices numbers are being used, use the ls /dev/dsk or ls /dev/rdsk command.

For partitioning, use the following commands:

Some notes about partitioning: Partition (or slice) 2 goes from beginning to end of disk, this partition tells you how big the drive is (do not use partition 2), this is used for scripts, and to check drive size. The “free hog” partition will take up any free space and put it in this slice. Don’t pay attention to flag and tag field. Doing “all free hog” in modify will make all partitions 0 (zero). Partitioning does not effect data but will make it harder to find. Make backups before partitioning, restore backups, then reboot.

For optimization of your hard drive you need to know the following:

  1. Which partitions (file system, swap)
  2. Size of each partition (df –k (shows hard disk space) , dv –sk [filename] (shows how big the sub directory is)
  3. Location – put the busiest partitions in the middle

To optimize the hard disk, you need to do the following:

  1. Which file system is in use now (df –k)
  2. How busy is the hard drive (iostat –d10)
  3. Choose new partition sizes
  4. Backup all file systems (ufsdump)
  5. Boot from the DC (so it doesn’t use root)
  6. Repartition (format)
  7. Create file system for each partition (newfs)
  8. Mount the disk
  9. Restore the disk
  10. Edit vfstab on the hard drive
  11. Reboot

There are cylinder groups (or regions) on a file system (disk)

The super block contains the following information:

  1. Total number of files
  2. Total amount of used space
  3. Location of cylinder groups

To monitor your resources do the following:

Here is a sample set of partitions (you don’t want 100% of your disk allocated)

Partitions allow you to decide how much space you give to each thing (dividing up space)

Reasons to partition: Divide up and reserve space. Set properties (make read only, make quotas of how space a user can use). Special (s) in permission in the x (execute) field makes whoever is the owner the permissions of that users, and can be done in group also (nosuid – doesn’t allow you to do this)

Some good sizes for partitions (with Solaris)


  Go to Chapter 12       Go to Index        Go to Chapter 14