{"id":3015,"date":"2025-10-16T00:02:25","date_gmt":"2025-10-15T15:02:25","guid":{"rendered":"https:\/\/blog.id774.net\/entry\/?p=3015"},"modified":"2025-10-16T00:09:23","modified_gmt":"2025-10-15T15:09:23","slug":"tmp-%e3%81%a8-var-tmp-%e3%81%ae%e5%ad%98%e5%9c%a8%e4%bf%9d%e8%a8%bc%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/blog.id774.net\/entry\/2025\/10\/16\/3015\/","title":{"rendered":"\/tmp \u3068 \/var\/tmp \u306e\u5b58\u5728\u4fdd\u8a3c\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u672c\u7a3f\u306f\u3001<a href=\"https:\/\/blog.id774.net\/entry\/2025\/08\/31\/2974\/\">Debian 13<\/a> &#8220;<a href=\"https:\/\/blog.id774.net\/entry\/2025\/08\/13\/2940\/\">Trixie<\/a>&#8221; \u3092\u4e2d\u5fc3\u306b\u3001<a href=\"https:\/\/blog.id774.net\/entry\/2025\/10\/07\/3012\/\">\/tmp<\/a> \u304a\u3088\u3073 \/var\/tmp \u306e\u5b58\u5728\u304c\u3069\u306e\u3088\u3046\u306b\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u3001FHS \u6a19\u6e96\u3001systemd \u306e\u5b9f\u88c5\u3001\u305d\u3057\u3066\u4f8b\u5916\u7684\u306a\u30b1\u30fc\u30b9\u3092\u542b\u3081\u3066\u6574\u7406\u3057\u305f\u3082\u306e\u3067\u3042\u308b\u3002\u7d50\u8ad6\u3068\u3057\u3066\u3001\u3053\u308c\u3089\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u901a\u5e38\u306e GNU\/Linux \u74b0\u5883\u306b\u304a\u3044\u3066\u5e38\u306b\u5b58\u5728\u304c\u4fdd\u8a3c\u3055\u308c\u3066\u304a\u308a\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u5b58\u5728\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u5fc5\u8981\u306f\u306a\u3044\u3002<\/p>\n<hr>\n<h2>1. \u5f79\u5272\u306e\u9055\u3044<\/h2>\n<p>\/tmp \u306f\u77ed\u671f\u9593\u3067\u6d88\u3048\u3066\u3088\u3044\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u305f\u3081\u306e\u9818\u57df\u3067\u3042\u308a\u3001\u518d\u8d77\u52d5\u3059\u308c\u3070\u5185\u5bb9\u306f\u5931\u308f\u308c\u308b\u3002\u4e00\u65b9\u3067 \/var\/tmp \u306f\u3001\u518d\u8d77\u52d5\u5f8c\u3082\u4fdd\u6301\u3059\u3079\u304d\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u305f\u3081\u306e\u9818\u57df\u3067\u3042\u308b\u3002\u4e21\u8005\u306f <a href=\"https:\/\/refspecs.linuxfoundation.org\/fhs.shtml\">Filesystem Hierarchy Standard<\/a> (FHS) \u306b\u3088\u3063\u3066\u660e\u78ba\u306b\u533a\u5225\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<table>\n<tr>\n<th>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/th>\n<th>\u7528\u9014<\/th>\n<th>\u6c38\u7d9a\u6027<\/th>\n<th>\u30de\u30a6\u30f3\u30c8\u5834\u6240<\/th>\n<\/tr>\n<tr>\n<td>\/tmp<\/td>\n<td>\u77ed\u671f\u7684\u306a\u4e00\u6642\u30d5\u30a1\u30a4\u30eb<\/td>\n<td>\u63ee\u767a\u6027\uff08\u518d\u8d77\u52d5\u3067\u6d88\u5931\uff09<\/td>\n<td>tmpfs\uff08RAM\u4e0a\uff09<\/td>\n<\/tr>\n<tr>\n<td>\/var\/tmp<\/td>\n<td>\u518d\u8d77\u52d5\u5f8c\u3082\u4fdd\u6301\u3059\u3079\u304d\u4e00\u6642\u30d5\u30a1\u30a4\u30eb<\/td>\n<td>\u6c38\u7d9a\u6027\u3042\u308a<\/td>\n<td>\u30c7\u30a3\u30b9\u30af\u4e0a\uff08\u901a\u5e38\u306f ext4\uff09<\/td>\n<\/tr>\n<\/table>\n<hr>\n<h2>2. FHS \u306b\u3088\u308b\u4ed5\u69d8\u4e0a\u306e\u4fdd\u8a3c<\/h2>\n<p>FHS 3.0 \u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li><strong>\/tmp<\/strong>: \u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u7f6e\u304d\u5834\u3068\u3057\u3066\u5e38\u306b\u5b58\u5728\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002\u518d\u8d77\u52d5\u6642\u306b\u5185\u5bb9\u304c\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3059\u308b\u3002<\/li>\n<li><strong>\/var\/tmp<\/strong>: \u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u7f6e\u304d\u5834\u3068\u3057\u3066\u5e38\u306b\u5b58\u5728\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002\u518d\u8d77\u52d5\u5f8c\u3082\u4fdd\u6301\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/li>\n<\/ul>\n<p>\u3059\u306a\u308f\u3061\u3001<strong>\/tmp \u3068 \/var\/tmp \u306e\u4e21\u65b9\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u306f FHS \u306b\u6e96\u62e0\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3051\u308b\u5fc5\u9808\u8981\u4ef6<\/strong>\u3067\u3042\u308a\u3001\u5b58\u5728\u3057\u306a\u3044\u72b6\u614b\u306f\u898f\u683c\u9055\u53cd\u3067\u3042\u308b\u3002<\/p>\n<hr>\n<h2>3. Debian 13 (systemd) \u306b\u304a\u3051\u308b\u5b9f\u88c5\u4e0a\u306e\u4fdd\u8a3c<\/h2>\n<p>Debian 13 \u3067\u306f\u3001systemd \u304c\u8d77\u52d5\u6642\u306b\u3053\u308c\u3089\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u81ea\u52d5\u7684\u306b\u751f\u6210\u30fb\u7dad\u6301\u3059\u308b\u3002\u305d\u306e\u4ed5\u7d44\u307f\u306f \/usr\/lib\/tmpfiles.d\/tmp.conf \u306b\u3088\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">d \/tmp &nbsp; &nbsp; 1777 root root 10d<br \/>\nd \/var\/tmp 1777 root root 30d<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u3053\u308c\u306f\u3001\/tmp \u304a\u3088\u3073 \/var\/tmp \u304c\u5b58\u5728\u3057\u306a\u3051\u308c\u3070\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3002\u3055\u3089\u306b\u3001\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\uff081777\uff09\u3068\u6240\u6709\u8005\uff08root:root\uff09\u3082\u540c\u6642\u306b\u8a2d\u5b9a\u3055\u308c\u308b\u3002<\/p>\n<p>\u307e\u305f\u300110d, 30d \u306f\u6700\u7d42\u30a2\u30af\u30bb\u30b9\u6642\u523b\u3092\u57fa\u6e96\u306b\u3057\u305f\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u30dd\u30ea\u30b7\u30fc\u3067\u3042\u308a\u3001\/tmp \u306f 10 \u65e5\u3001\/var\/tmp \u306f 30 \u65e5\u672a\u4f7f\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u3092<a href=\"https:\/\/blog.id774.net\/entry\/2025\/10\/07\/3012\/\">\u81ea\u52d5\u524a\u9664\u3059\u308b<\/a>\u3002\u524a\u9664\u3057\u3066\u3082\u518d\u8d77\u52d5\u6642\u306b\u518d\u751f\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u6052\u5e38\u7684\u306b\u5b58\u5728\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3002<\/p>\n<hr>\n<h2>4. \u30de\u30a6\u30f3\u30c8\u3068\u81ea\u52d5\u751f\u6210\u306e\u95a2\u4fc2<\/h2>\n<table>\n<tr>\n<th>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/th>\n<th>\u5b9f\u4f53<\/th>\n<th>\u7ba1\u7406\u65b9\u5f0f<\/th>\n<\/tr>\n<tr>\n<td>\/tmp<\/td>\n<td>tmpfs\uff08RAM\u4e0a\uff09<\/td>\n<td>systemd \u306e tmp.mount \u306b\u3088\u308a<a href=\"https:\/\/blog.id774.net\/entry\/2025\/09\/01\/2977\/\">\u81ea\u52d5\u30de\u30a6\u30f3\u30c8<\/a>\u3055\u308c\u3001\u5b58\u5728\u3092\u4fdd\u8a3c<\/td>\n<\/tr>\n<tr>\n<td>\/var\/tmp<\/td>\n<td>\u30c7\u30a3\u30b9\u30af\u4e0a\uff08\/var \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\uff09<\/td>\n<td>systemd-tmpfiles \u306b\u3088\u308a\u5b58\u5728\u3068\u30e2\u30fc\u30c9\u304c\u4fdd\u8a3c<\/td>\n<\/tr>\n<\/table>\n<hr>\n<h2>5. \u5b58\u5728\u3057\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308b\u7279\u6b8a\u74b0\u5883<\/h2>\n<p>\u4f8b\u5916\u7684\u306b\u3001systemd \u304c\u52d5\u4f5c\u3057\u306a\u3044\u6700\u5c0f\u74b0\u5883\u3067\u306f \/tmp \u3084 \/var\/tmp \u304c\u4f5c\u3089\u308c\u306a\u3044\u3053\u3068\u304c\u3042\u308b\u3002\u4ee3\u8868\u7684\u306a\u3082\u306e\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3042\u308b\u3002<\/p>\n<table>\n<tr>\n<th>\u74b0\u5883<\/th>\n<th>\u72b6\u6cc1<\/th>\n<\/tr>\n<tr>\n<td>chroot \/ minimal rootfs<\/td>\n<td>debootstrap &#8211;variant=minbase \u306a\u3069\u3067\u4f5c\u6210\u3057\u305f\u6700\u5c0f rootfs \u3067\u306f\u81ea\u52d5\u4f5c\u6210\u3055\u308c\u306a\u3044\u3002<\/td>\n<\/tr>\n<tr>\n<td>initramfs \/ BusyBox \u74b0\u5883<\/td>\n<td>\u30ab\u30fc\u30cd\u30eb\u521d\u671f\u5316\u4e2d\u306e\u4e00\u6642RAM\u74b0\u5883\u3067\u3001systemd\u304c\u52d5\u4f5c\u3057\u306a\u3044\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u7d44\u8fbc\u307fLinux \/ Buildroot\u7cfb<\/td>\n<td>FHS\u5168\u4f53\u3092\u5b9f\u88c5\u3057\u306a\u3044\u69cb\u6210\u304c\u3042\u308b\u3002<\/td>\n<\/tr>\n<\/table>\n<hr>\n<h2>6. \u5b58\u5728\u3057\u306a\u3044 GNU\/Linux \u306f\u3042\u308b\u304b<\/h2>\n<p><strong>\/tmp \u307e\u305f\u306f \/var\/tmp \u304c\u5b58\u5728\u3057\u306a\u3044\u6a19\u6e96\u7684\u306a GNU\/Linux \u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306f\u5b58\u5728\u3057\u306a\u3044\u3002<\/strong><\/p>\n<p>\u5b58\u5728\u3057\u306a\u3044\u3068\u3059\u308c\u3070\u3001\u305d\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7279\u6b8a\u4f8b\u306b\u9650\u3089\u308c\u308b\u3002<\/p>\n<ul>\n<li>\u6700\u5c0f rootfs\uff08\u69cb\u7bc9\u9014\u4e2d\uff09<\/li>\n<li>initramfs \u5185\u90e8\u74b0\u5883<\/li>\n<li>\u7d44\u8fbc\u307f\u5411\u3051\u6700\u5c0f\u69cb\u6210<\/li>\n<li>\u5b9f\u9a13\u7684\u30d3\u30eb\u30c9\u74b0\u5883\uff08Linux From Scratch \u9014\u4e2d\uff09<\/li>\n<\/ul>\n<p>\u4e00\u822c\u7684\u306a Debian\u3001Ubuntu\u3001Fedora\u3001RHEL\u3001Arch\u3001openSUSE \u306a\u3069\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u4e21\u8005\u3068\u3082\u78ba\u5b9f\u306b\u5b58\u5728\u3059\u308b\u3002\u4e00\u90e8\u306e\u8efd\u91cf\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\uff08\u4f8b\uff1aAlpine Linux\uff09\u3067\u306f\u3001\/var\/tmp \u304c \/tmp \u3078\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308b\u304c\u3001\u3053\u308c\u306f\u8efd\u91cf\u5316\u306e\u305f\u3081\u306e\u8a2d\u8a08\u3067\u3042\u308a\u3001\u975e\u6e96\u62e0\u3067\u306f\u3042\u308b\u304c\u6b20\u843d\u3067\u306f\u306a\u3044\u3002<\/p>\n<hr>\n<h2>7. \u8aa4\u524a\u9664\u6642\u306e\u6319\u52d5<\/h2>\n<table>\n<tr>\n<th>\u72b6\u6cc1<\/th>\n<th>\u7d50\u679c<\/th>\n<\/tr>\n<tr>\n<td>\/tmp \u3092\u524a\u9664<\/td>\n<td>\u518d\u8d77\u52d5\u6642\u306b systemd \u304c tmpfs \u3092\u518d\u30de\u30a6\u30f3\u30c8\u3057\u81ea\u52d5\u751f\u6210\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/var\/tmp \u3092\u524a\u9664<\/td>\n<td>systemd-tmpfiles \u306b\u3088\u308a mode 1777 \u3067\u81ea\u52d5\u518d\u751f\u6210\u3055\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u4e21\u65b9\u524a\u9664<\/td>\n<td>\u8d77\u52d5\u30d7\u30ed\u30bb\u30b9\u4e2d\u306b\u518d\u751f\u6210\u3055\u308c\u3001\u30d6\u30fc\u30c8\u5b8c\u4e86\u5f8c\u306b\u306f\u6b63\u5e38\u306b\u5b58\u5728\u3059\u308b\u3002<\/td>\n<\/tr>\n<\/table>\n<hr>\n<h2>8. \u7d50\u8ad6<\/h2>\n<p>Debian 13 \u306b\u304a\u3044\u3066 \/tmp \u3068 \/var\/tmp \u306f\u3068\u3082\u306b <strong>FHS \u306b\u3088\u3063\u3066\u5fc5\u9808\u3068\u3055\u308c\u3001systemd \u306b\u3088\u3063\u3066\u5b9f\u88c5\u4e0a\u3082\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u308b\u3002<\/strong> \u524a\u9664\u3057\u3066\u3082\u518d\u8d77\u52d5\u6642\u306b\u518d\u751f\u6210\u3055\u308c\u3001\u5b58\u5728\u3057\u306a\u3044\u307e\u307e\u30d6\u30fc\u30c8\u304c\u5b8c\u4e86\u3059\u308b\u3053\u3068\u306f\u306a\u3044\u3002\u4f8b\u5916\u7684\u306b systemd \u975e\u7a3c\u50cd\u306e\u6700\u5c0f\u74b0\u5883\u3067\u306f\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u304c\u3001\u305d\u308c\u306f\u4e00\u822c\u7684\u306a\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u306a\u3044\u3002<\/p>\n<p><strong>\u901a\u5e38\u306e Debian 13 \u3067\u306f \/tmp \u3082 \/var\/tmp \u3082\u5e38\u306b\u5b58\u5728\u304c\u4fdd\u8a3c\u3055\u308c\u3066\u304a\u308a\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3044\u3066\u5b58\u5728\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u5fc5\u8981\u306f\u306a\u3044\u3002<\/strong><\/p>\n<p>\u3053\u308c\u3089\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001FHS \u304c\u6c42\u3081\u308b\u6700\u5c0f\u69cb\u6210\u306e\u4e00\u90e8\u3067\u3042\u308a\u3001systemd \u306b\u3088\u3063\u3066\u5b8c\u5168\u306b\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3067\u3042\u308b\u3002\/tmp \u3084 \/var\/tmp \u306b\u5bfe\u3057\u3066 mkdir \u3084 test -d \u3092\u884c\u3046\u51e6\u7406\u306f\u4e0d\u8981\u3067\u3042\u308a\u3001\u3080\u3057\u308d\u8aa4\u3063\u305f\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3067\u4f5c\u6210\u3055\u308c\u308b\u5371\u967a\u304c\u3042\u308b\u3002Debian 13 \u4ee5\u964d\u306e\u74b0\u5883\u3067\u306f\u3001\u5b58\u5728\u306f\u524d\u63d0\u6761\u4ef6\u3068\u3057\u3066\u4fe1\u983c\u3057\u3066\u3088\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7a3f\u306f\u3001Debian 13 &#8220;Trixie&#8221; \u3092\u4e2d\u5fc3\u306b\u3001\/tmp \u304a\u3088\u3073 \/var\/tmp \u306e\u5b58\u5728\u304c\u3069\u306e\u3088\u3046\u306b\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u3001FHS \u6a19\u6e96\u3001systemd \u306e\u5b9f\u88c5\u3001\u305d\u3057\u3066\u4f8b\u5916\u7684\u306a\u30b1\u30fc\u30b9\u3092\u542b\u3081\u3066 &#8230; <a title=\"\/tmp \u3068 \/var\/tmp \u306e\u5b58\u5728\u4fdd\u8a3c\u306b\u3064\u3044\u3066\" class=\"read-more\" href=\"https:\/\/blog.id774.net\/entry\/2025\/10\/16\/3015\/\" aria-label=\"\/tmp \u3068 \/var\/tmp \u306e\u5b58\u5728\u4fdd\u8a3c\u306b\u3064\u3044\u3066 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-3015","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/comments?post=3015"}],"version-history":[{"count":0,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3015\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/media?parent=3015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/categories?post=3015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/tags?post=3015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}