LoginSignup
238
126

元々は /usr は user の略に決まってるじゃん?ホームディレクトリを置く場所だったんだから

Last updated at Posted at 2024-06-18

Twitterとか見て「そうだったのかー」とか言うんじゃなくて、ちゃんと調べてみましょうよ。/usr は元々ユーザーのホームディレクトリをおいていた場所ですよ。/bin などを置いていたシステムディスクの容量が足りなくなったので別ディスクだった /usr 以下を使うようになっただけです。Unix System Resources とかそんな長い名前、後付けに決まってるでしょ?

翻訳は面倒なので、DeepL(の少し手直し)です。

初期の Unix のドキュメントから

URLと1972年という年から、おそらく Version 1 Unix (1971) のドキュメントだと思います。ここ 経由で見つけました。

12ページにこのようなものがあります。詳細はよくわかりませんがディレクトリ構造でしょう。

idata:
/ root
    41.
    140016
    .byte 7,1
    9f-.-2
    41.
    <..\0\0\0\0\0\0>
    41.
    <.\0\0\0\0\0\0>
    42.
    <dev\0\0\0\0\0>
    43.
    <bin\0\0\0\0\0>
    44.
    <etc\0\0\0\0\0>
    45.
    <usr\0\0\0\0\0>
    46.
    <tmp\0\0\0\0\0>

そして以下のように続いています。行頭の「/」はコメントの意味でしょうかね。

/ device directory
   ︙

/ binary directory
   ︙

/ etcetra directory
   ︙

/ user directory
   ︙

/ temporary directory
   ︙

/ initialization program
   ︙

以上、/ user directory でした。

AT&T Archives: The UNIX Operating System

1982 年に AT&T が制作した動画のようです。

13:30 ぐらいより、字幕を表示すると次のように users directory と言っていることがわかります。

when you log into a UNIX system you normally are sitting in a place that's called your home directory or users directory

System V Interface Definition Fourth Edition

UNIX System V の標準規格である System V Interface Definition (SVID) からの情報です。Fourth Edition は 1995 年に出版されましたが、もし最初の版から書いてあるのであれば 1985 年です。

Volume 1a の P64

filsys ( BA_ENV ) filsys ( BA_ENV )
NAME
 file system – directory tree structure
DESCRIPTION
 Directory Tree Structure

All System V conforming systems must have a "root" (/), a "user" (/usr) and a "var" (/var) subtree accessible to user-level programs. The user, root and var subtrees may or may not be different physical file systems, but their appearance to user programs will always be the same.

DeepL訳 すべてのSystem V準拠システムは、ユーザー・レベルのプログラムからアクセス可能な「ルート」(/)、「ユーザー」(/usr)、「var」(/var)サブツリーを持たなければならない。user、root、var サブツリーは、物理的に異なるファイルシステムであってもなくてもよいが、ユーザー・プログラムから見た外観は常に同じである。

Linux Filesystem Hierarchy

Linux Filesystem Hierarchy: Chapter 1. Linux Filesystem Hierarchy
https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html

1.17. /usr
/usr usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc.... X and its supporting libraries can be found here. User programs like telnet, ftp, etc.... are also placed here. In the original Unix implementations, /usr was where the home directories of the users were placed (that is to say, /usr/someone was then the directory now known as /home/someone). In current Unices, /usr is where user-land programs and data (as opposed to 'system land' programs and data) are. The name hasn't changed, but it's meaning has narrowed and lengthened from "everything user related" to "user usable programs and data". As such, some people may now refer to this directory as meaning 'User System Resources' and not 'user' as was originally intended.

DeepL訳 /usrは通常、システム上で最も多くのデータを含んでいる。したがって、すべてのユーザー・バイナリ、そのドキュメント、ライブラリ、ヘッダー・ファイルなどを含む、システムで最も重要なディレクトリの1つである。Xとそれをサポートするライブラリはここにある。telnet、ftpなどのユーザープログラムもここに置かれます。オリジナルのUnixの実装では、/usrはユーザーのホームディレクトリが置かれる場所でした(つまり、/usr/someoneは現在/home/someoneとして知られているディレクトリでした)。現在のUnicesでは、/usrは(「システムランド」のプログラムやデータとは対照的に)ユーザーランドのプログラムやデータが置かれる場所です。名前は変わっていないが、その意味は「ユーザー関連のすべて」から「ユーザーが使えるプログラムとデータ」へと狭まり、長くなっている。そのため、現在ではこのディレクトリを本来の「ユーザー」ではなく「ユーザー・システム・リソース」と呼ぶ人もいます。

/usr の意味が変わった理由

You know how Ken Thompson and Dennis Ritchie created Unix on a PDP-7 in 1969?
Well around 1971 they upgraded to a PDP-11 with a pair of RK05 disk packs (1.5 megabytes each) for storage.

When the operating system grew too big to fit on the first RK05 disk pack (their root filesystem) they let it leak into the second one, which is where all the user home directories lived (which is why the mount was called /usr). They replicated all the OS directories under there (/bin, /sbin, /lib, /tmp...) and wrote files to those new directories because their original disk was out of space. When they got a third disk, they mounted it on /home and relocated all the user directories to there so the OS could consume all the space on both disks and grow to THREE WHOLE MEGABYTES (ooooh!).

DeepL訳 1969年にケン・トンプソンとデニス・リッチーがPDP-7でUnixを作ったのをご存知だろうか。 1971年頃、彼らはPDP-11にアップグレードし、ストレージとしてRK05ディスク・パック(各1.5メガバイト)を2組搭載した。メガバイト)を搭載したPDP-11にアップグレードした。オペレーティング・システムが大きくなりすぎて、最初のRK05ディスク・パック(ルート・ファイルシステム)に収まらなくなったとき、彼らはそれを2番目のディスク・パックに流出させた。 その下にすべてのOSディレクトリ(/bin、/sbin、/lib、/tmp...)を複製し、元のディスクが容量不足だったため、それらの新しいディレクトリにファイルを書き込んだ。 3台目のディスクを手に入れたとき、彼らはそれを/homeにマウントし、すべてのユーザー・ディレクトリをそこに移した。OSは両方のディスクの容量を消費し、3メガバイトに成長した。

(以下略: リンク先へどうぞ)

補足情報

FreeBSD では以前(いつから? 少なくとも FreeBSD 9)から /home はシンボリックリンクで、/usr/home を指しており、FreeBSD 14 から、/usr/home はなくなり /home 以下にユーザーのホームディレクトリを作成するようになったようです。NetBSD (少なくとも 7.2) と OpenBSD(少なくとも 6.6) は以前から /home 以下に作成するようです。Solaris と OpenIndiana は /export/home 以下に作成するようです。AIX では古くは /u というディレクトリを使用していたようで、現在は /u/home ディレクトリへのシンボリックリンクのようです(参考)。

POSIX ではホームディレクトリの作成場所や /usr/etc ディレクトリなどは標準化されていません。ディレクトリ構造は Unix/Linux という OS を作成するときには必要な情報ですが、アプリケーションを動かすためには必要ない情報だからです(/dev/null のようなアプリケーションから使用する一部のファイルを除く)。POSIX は OS を作る標準規格ではなく、アプリケーションの移植性のための標準規格なので、OS の実装方法は標準規格から徹底的に削除されています。POSIX にとって OS の作り方は自由です(それこそ Windows のような OS でも良い)。

A description of the historical /usr/tmp was omitted, removing any concept of differences in emphasis between the / and /usr directories. The descriptions of /bin, /usr/bin, /lib, and /usr/lib were omitted because they are not useful for applications. In an early draft, a distinction was made between system and application directory usage, but this was not found to be useful.

DeepL訳 歴史的な/usr/tmpの記述は省略され、/ディレクトリと/usrディレクトリの重 点の違いに関する概念は削除された。bin、/usr/bin、/lib、/usr/libの記述は、アプリケーションにとって有用でないため、省略された。初期の草案では、システムディレクトリとアプリケーションディレクトリの使い方を区別していたが、これは有用ではないことがわかった。

そういや、私は /usr を user の略だと思いながら「ユー・エス・アール」って呼んでいますね。心の中では「うざぁ」って呼んでいますが。

その他の情報源

直接的な情報が書いてあったり書いていなかったりしますが読み物としてどうぞ。なにか見つけたら追加していきます。

In particular, in our own version of the system, there is a directory "/usr" which contains all user's directories, and which is stored on a relatively large, but slow moving head disk, while the othe files are on the fast but small fixed-head disk.

A cabinet containing RF11/RS11 controller and fixed-head disks. By this time / and swap space lived there, while /usr was on the RK03s.

238
126
8

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
238
126