Solaris · Storage Basics in Solaris

Solaris · Lesson 16

Storage Basics in Solaris

Understand disks, slices and device naming. VTOC and EFI labels. Using format utility. Preparing disks for ZFS.

Why storage basics matter before ZFS

ZFS hides many low-level details, but as a Solaris administrator you still need a clear mental model of disks, labels (VTOC/EFI), slices and device names before you create zpools.

In this lesson, you will learn how to use format, prtvtoc and df to understand your disks and ensure they are safe to use for new pools.

Core storage concepts in Solaris

Disks and LUNs

A disk (or LUN from a SAN) is the basic block device. Solaris presents them with controller/target IDs and slices.

Labels & slices

Disks are labelled (VTOC or EFI). Labels define slices (s0, s1, s2…) which older tools use; ZFS generally uses whole disk (s2).

From disks to zpools

ZFS builds zpools on top of one or more whole disks or vdevs. A clean understanding here avoids data loss later.

Step-by-step storage discovery commands

Use these examples on your lab system to identify free disks for ZFS. Never relabel or destroy disks on production systems without a clear plan and backups.

1. Discover disks using format (and echo | format trick)

format is the classic Solaris tool to view disks and labels. Use echo | format when you only want a summary and don’t need the interactive menu.

terminal — storage
solaris-lab
[root@solaris ~]# echo | format
Searching for disks...done
 
AVAILABLE DISK SELECTIONS:
0. c0t5000CCA01A2B3C4Dd0 <ATA-ST4000DM000-1F21-AB12-4.00TB>
/scsi_vhci/disk@g5000cca01a2b3c4d
/dev/chassis/SYS/HD0/disk
1. c0t5000CCA01A2B3C4Ed0 <ATA-ST4000DM000-1F21-AB12-4.00TB>
/scsi_vhci/disk@g5000cca01a2b3c4e
/dev/chassis/SYS/HD1/disk
 
Specify disk (enter its number):
# (format exits immediately because we piped an empty line)
 
# To enter interactive mode:
[root@solaris ~]# format
Searching for disks...done
 
AVAILABLE DISK SELECTIONS:
0. c0t5000CCA01A2B3C4Dd0 <ATA-ST4000DM000-1F21-AB12-4.00TB>
1. c0t5000CCA01A2B3C4Ed0 <ATA-ST4000DM000-1F21-AB12-4.00TB>
Specify disk (enter its number): 0
selecting c0t5000CCA01A2B3C4Dd0
[disk formatted]
format>

2. Check disk label type (VTOC vs EFI)

Older Solaris used VTOC (for smaller disks); modern systems typically use EFI labels for large disks. You can see label type from format or prtvtoc.

terminal — storage
solaris-lab
# Inside format interactive menu:
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
# (Example only – DO NOT relabel production disks without planning!)
 
# To see VTOC/partition layout (for VTOC-labelled disk)
[root@solaris ~]# prtvtoc /dev/rdsk/c0t5000CCA01A2B3C4Dd0s2
* /dev/rdsk/c0t5000CCA01A2B3C4Dd0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 7814037168 sectors
* 7814037120 accessible sectors
*
* Flags:
* 1: unmountable
* 0: mountable
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 4 00 0 1953504000 1953503999 /
1 7 00 1953504000 1953504000 3907007999 /u01
2 5 00 0 7814037120 7814037119 backup

3. Understand Solaris disk device names

Solaris uses controller/target identifiers and slices. ZFS usually uses whole disks (s2) or by-id links from /dev/dsk.

terminal — storage
solaris-lab
[root@solaris ~]# ls -l /dev/dsk/c0t5000CCA01A2B3C4Dd0s*
lrwxrwxrwx 1 root root 70 Jan 11 11:00 /dev/dsk/c0t5000CCA01A2B3C4Dd0s0 -> ../../devices/.../c0t5000CCA01A2B3C4Dd0s0
lrwxrwxrwx 1 root root 70 Jan 11 11:00 /dev/dsk/c0t5000CCA01A2B3C4Dd0s1 -> ../../devices/.../c0t5000CCA01A2B3C4Dd0s1
lrwxrwxrwx 1 root root 70 Jan 11 11:00 /dev/dsk/c0t5000CCA01A2B3C4Dd0s2 -> ../../devices/.../c0t5000CCA01A2B3C4Dd0s2
 
# Notes:
# - c0 = controller 0
# - t... = target (SCSI address / WWN)
# - d0 = disk 0
# - s0, s1, s2 = slices (Solaris partitions)
# s2 usually represents "whole disk"
 
# For ZFS pools you normally use the whole disk slice s2 or stable /dev/dsk links.

4. Checklist before creating a zpool on a disk

Before using disks for ZFS, make sure they’re not in use by old filesystems, SVM, VXVM, etc. You can double-check with mount, df and format.

terminal — storage
solaris-lab
# 1) Check current filesystems
[root@solaris ~]# df -h
Filesystem Size Used Available Capacity Mounted on
rpool/ROOT/solaris 40G 10G 30G 25% /
rpool/export/home 60G 20G 40G 34% /export/home
 
# 2) Check if any legacy volume manager is using the disk
# (examples only, commands vary by environment)
[root@solaris ~]# metastat # Solaris Volume Manager (if used)
[root@solaris ~]# vxprint # Veritas Volume Manager (if used)
 
# 3) See disk in format
[root@solaris ~]# echo | format
AVAILABLE DISK SELECTIONS:
0. c0t5000CCA01A2B3C4Dd0 <4.00TB>
1. c0t5000CCA01A2B3C4Ed0 <4.00TB>
 
# For lab/demo, we assume disk 1 is free and will be used for a new zpool later.

Small cheat sheet – storage discovery

Key commands

  • echo | format → quick disk list (non-interactive).
  • format → full interactive disk tool (labels, geometry, etc.).
  • prtvtoc /dev/rdsk/cXtYdZs2 → view VTOC partition map.
  • df -h → see mounted filesystems (what is already in use).
  • metastat / vxprint → check if SVM/Veritas are using disks (if installed).

Before using a disk for ZFS

  • Confirm it is not part of root pool (rpool) or any mounted filesystem.
  • Confirm it’s not used by SVM, Veritas or any hardware RAID you don’t intend to touch.
  • Make a note of the device path (/dev/dsk/...) you will use for zpool create.
  • If necessary, plan whether to use whole disk (s2) or a slice (older practices).

Storage safety tips before ZFS work

  • Never run formatlabel or zpool create on a disk unless you are 100% sure it is free. These operations can destroy data.
  • Prefer to do dangerous operations from a console/IPMI session, not over SSH, in case you drop the management network.
  • Always take screenshots or notes of format and zpool status for documentation and recovery.

In the next lessons, we will build on this foundation to create zpools and ZFS filesystems confidently.