Some Brief Notes on Solaris 10 Disk Layout

Solaris documentation use the term “partition” differently than the common use.  Unix has a related concept called slicesUnix systems can detect primary partitions (Solaris calls these FDISK partitions) but not extended or logical partitions.  Each disk is only expected to contain a single Solaris FDISK partition.  If any of the other primary partitions contain DOS (FAT-32) partitions they can be mounted (FS type=“pcfs”) and used, otherwise they are ignored.

“Up until Solaris 7 you could newfs a non-Solaris FDISK partition and have a ufs filesystem on it.  The command line parsing of mkfs_ufs broke in Solaris 8, and hasn’t worked since — you can’t feed the necessary parameters in even though the manpage says you should be able to do so.”
— Andrew Gabriel, comp.unix.solaris post on 11/27/07.

A Solaris partition in turn can be divided into (up to) eight “slices” using a data structure called “VTOC” (virtual table of contents).  Slices are not the same as traditional partitions.  Each has a traditional purpose, and slices can overlap others—it is up to the admin to make sure the filesystems in each slice do not overlap!  The partitions were originally lettered ‘a’ through ‘h’, but more modern systems number them 0-7.  Slice 2 by default is reserved to refer to the whole Solaris partition (again, usually this is the whole disk).

Annoyingly, many Unix documents and man pages mix the terms partition and slice.  You have been warned!

By convention (and assumed by some disk management utilities) some of these slices are reserved for special uses.  On any bootable partition/disk, the root (“/”) file system should be slice ‘0’.  slice ‘1’ is used for swap, ‘2’ refers to the whole partition/disk and can be used for backups.  Slice ‘3’ may be used to hold a bootable OS image for clients with a different architecture).  Today slice 3 often contains a copy of the root filesystem, used for live upgrade when you don’t have mirrored disks.  Slice ‘7’ for /home (/export/home).  This leaves slices 4 and 5 available for your own ideas.  And ‘5’ is usually used for /opt.

Slice 7 is usually /export or /export/home.  Solaris is intended as a server, so users are expected to use NFS to auto-mount their “real” home directory on /home when they login on any host.  If this machine is not the one containing the actual home directories, an /export/home is auto-mounted on /home only if NFS isn’t used.  Only create /home directly if host is not networked and you don’t want to use an auto-mounter.

On x86 hardware, Solaris uses 16 slices (0-9 are usable, sometimes) instead.  Slice 8 is used in the booting process.  ‘9’ is used to map out bad disk blocks.

Modern Solaris includes many features that complicate planning your disk map.

You can use an un-named slice to hold a ZFS pool, from which you can allocate many ZFS file systems easily.  For x86 systems (at least) you can create on Solaris FDISK partition to hold the VTOC slices, and another FDISK partition (of type “OTHER OS”) for a ZFS pool.

ZFS can’t (yet!) be used for some uses, such as the root filesystem (or currently, any filesystem holding files created by an installer).  Zone roots also can’t use ZFS.

Or, you can use Solaris Volume Management (SVM) for a slice, and allocate many UFS file systems from that.  SVM should need an additional slice (#7) reserved to hold meta (or virtual) device data, often called a metaDB replica (size: 32MB is fine).  Since ZFS is still not usable for many purposes, SVM is currently recommended unless you have an entire non-boot disk for the zpool. See also VxVM (Veritas VM), a commercial LVM solution available for Solaris, HP-UX, and others.

There are differences in Solaris disk use for x86 and for Sparc.  For example, while SPARC boot blocks can be contained within the root slice, the x86 boot stuff (grub) is bigger, so a boot partition is normally created.  Although this space is unused on non-boot drives, it is almost always left in place.)  SPARC VTOC has 8 slices, x86 VTOC has 16.  format can’t manipulate the slices above #7 very well, but they can be with the fmthard command.

Besides VTOC another type of partition is an EFI/GPT which has completely different slices, but that can’t be used on a boot disk.  These can only be mixed in restricted ways.

If you plan to use live upgrade, you must duplicate all paths to files added by the installer/patch manager.  If you use mirrored disks there is no problem; you break the mirror use LU on one disk, reboot that, and sync then re-mirror the other disk.  But on a single disk you must either keep all system standard paths on the root partition, or duplicate both / (root), /var, and so on.  Thus, best advice is to not sub-partition any standard paths in /var or /usr.  It is OK to create new directories such as /website, and make those separate partitions.

The best advice today is to keep the boot disk small and simple, using a standard layout.  Other disks can be used for additional filesystems as needed.

If you only have one disk (possibly because you’re using hardware RAID), the most flexible disk map will reserve one slice for SVM to create additional filesystems.  Hopefully in the future, ZFS will be usable for a boot slice which will greatly simplify everything.  And maybe extended and logical partitions will be recognized and mountable too!