Blog Archive

Thursday, June 11, 2009

Solaris Filesystem Layout

The most basic new questions are "where is f00?", "why can't I find f00?", and "what the f**k is that?" First, lets look at the high level root directory structure:

* /etc, /usr, /var: You know what they are.
* /opt: Similar to Linux, this is where we tend to store most commercial/distributed software
* /home, /net: These are, by default, automount (an automatic, on-demand NFS mounting service) point. More on automount later.
* /export: This is a common directory on commercial UNIX varients which servers both as a place for data to be shared via NFS and also, most commonly, as a general purpose dumping ground for things that don't go anywhere else. More on this with the automount discussion.
* /proc: Contains data about each process, with directory structures named after the process id. Used by the "Ptools".

Now, looking at /usr. There are a bunch of odd looking directories in there, and at first glance, a huge ammount of duplication. You've got to understand that Solaris prides itself on adherence to a wide range of industry standards, such as XPG4, UNIX98, POSIX, etc. This is one reason Solaris is often considered superior to Linux for enterprise applications and development. In order to satisfy everyone some tools are kept in their own locations to allow for diferent tools to fill diffrent needs and standards. Lets look at some of the directories in /usr:

* /usr/bin, /usr/sbin: You know these. Standard tools in bin and "system" tools in sbin.
* /usr/5bin: Location for System V binaries, in Solari 2.x systems this is just a symlink to /usr/bin
* /usr/adm: Symlink to /var/adm, the Solaris equiv to the Linux /var/log
* /usr/aset: Automated Security Enhancement Tool (ASET) tools. Seperated because the directory is root owned 700.
* /usr/ccs: CC's (?) directory containing Sun/SystemV development tools, including ar, m4, make, nm, ld, yacc, lex, elfdump, etc. Do not confused these for GNU tools.
* /usr/dt: CDE and related tools. I can't find an exact source for the definition of "dt" but anytime you see it just think "cde".
* /usr/games: Ya, you wish.
* /usr/gnome: GNOME. Well, JDS anyway.
* /usr/kernel: Various drivers and bits that act as secondary to /kernel.
* /usr/kvm: This is a dead directory, used to be used but its just a historical placeholder now. Stands for what you think it does.
* /usr/openwin: The old OpenWindows tools, including Sun's X server (Xsun), OpenLook libs, tools, and window manager, etc.
* /usr/platform: Platform specific stuff, most commonly known for the tools prtdiag, used for finding hardware status, and eeprom for interfacing with take a guess. On SPARC there are lots of directories in here for all the diffrent architectures and system specifics.
* /usr/proc: The Solaris "ptools" (pfiles, pmap, pwdx, pstack, etc). The tools just symlink to /usr/bin.
* /usr/sadm: Solaris admin tools, such as smc, the "Solaris Management Console" (GUI admin tool), and others.
* /usr/sfw: SFW stands for "Sun FreeWare". This is where you'll find GCC, GIMP, MySQL, and lots more. Don't bitch that Solaris doesn't have any tools untill you look for your GNU favorites here! Please note that to keep GNU tools distinct from Solaris system tools common names are preceeded with a "g" (for GNU), so "gmake" for GNU Make, "gld" for GNU LD, "gas" for GNU AS, etc.
* /usr/snadm: Solstice Stuff, historical, ignore it.
* /usr/ucb, /usr/ucbinclude, /usr/ucblib: BSD Tools! UCB stands for "University of California Berkeley". You'll find the BSD versions of common tools here, so if you prefer the BSD varient of ps (ie: "ps aux") over the SysV one (ie: "ps -ef") you'll want this in your path!
* /usr/xpg4, /usr/xpg6: Tools that comply with the XPG4 and XPG6 standards respectively. These are X/Open specs that are part of larger standards like the Single Unix Specification.
* /usr/X: Symlink to /usr/openwin
* /usr/X11, /usr/X11R6: Xorg X Server and associated tools.

For more information on standards that Solaris adhers to please see this page which details them.

If you think that some of these directories are stupid or unneeded I'll say simply that, A) many people agree with you, B) many strongly disagree with you. The most hotly debated directory in /usr is /usr/sfw which many people want to see renamed to /usr/gnu.

As for /var I'll only say on Solaris we typically store logs in /var/adm, not /var/log, like Linux, but this is slowly changing. You'll now find logs in both directories.

One side note, a large number of Solaris users consider /usr/local to be a sin against nature and taboo. I personally use it, but its not unusual for folks to want to keep /usr "pure". I've seen some shops use /usr2, /opt/local, and /export/local instead, but personally that seems stupid to me. Let your concious be your guide. These are purely matters of personal style.

No comments:

Post a Comment