【Linux】2、文件系统、Rootfs

news2024/10/2 8:41:07

文章目录

  • 一、文件系统
  • 二、Rootfs
    • 2.1 各目录约定
      • 2.1.1 /bin
      • 4.2 /boot
      • 4.3 /dev
      • 4.4 /etc
      • 4.5 /home
      • 4.6 /lib
      • 4.7 /media
      • 4.8 /mnt
      • 4.9 /opt
      • 4.10 /root
      • 4.11 /run
      • 4.12 /sbin
      • 4.13 /srv
      • 4.14 /tmp
      • 4.15 /usr
      • 4.16 /var

在这里插入图片描述

一、文件系统

Linux 的文件系统遵循 HFS 设计,有如下实现:

Ext (Extended Filesystem), Ext2, Ext3, Ext4
JFS (Journaling Filesystem)
ReiserFS
XFS (Extent Filesystem)
Btrfs (B Tree Filesystem)
Swap

二、Rootfs

rootfs 是什么

Rootfs 位于分层文件树的顶部(也称为‘/’)。Linux内核通过配置参数‘ROOT=’直接挂载 Rootfs。

根文件系统还具有 mount point(挂载点),我们也可在挂载点上挂载其他文件系统,以便将它们连接到此文件系统层次结构。它有许多目录,其中包含对引导系统和系统操作至关重要的文件。

2.1 各目录约定

2.1.1 /bin

The /bin directory contains binaries of essential user commands that can be used by all users of the system. Here we can find ready-to-execute Linux commands like ls, cp, and echo, and shells like bash and csh. Moreover, /bin also contains the ready-to-run executables that may be required in order to boot or repair a system.

4.2 /boot

In the /boot directory we can find files used for booting an operating system, usually kernel images, bootloader (for example LILO, GRUB) related files, configuration files, and map installer. Generally, we can find vmlinuz, System.map, initrd, and config files here. Among them, vmlinuz is our actual kernel. The bootloader loads this kernel and executes it. The System.map file has a list of kernel symbols and respective addresses. The initial ramdisk (initrd) file is useful in loading drivers that are necessary for the initial booting process. The config file contains a list of kernel options, a list of devices, and device options.

4.3 /dev

The /dev directory is where all device files are stored. The device files residing in this directory represent devices attached to our system. Applications can interact with them using system calls to perform I/O operations. The majority of the device drivers that correspond to the hardware devices are one of two types: block device drivers or character device drivers.

4.4 /etc

Configuration files specific to the local machine are contained in the /etc directory. This directory holds most global config files. However, larger software packages can have their own subdirectories under /etc. Some examples are /etc/X11, /etc/sgml, and /etc/xml.

4.5 /home

The /home directory is the default location to create home directories for different users. For example, let’s say there’s a user with the username “Sam“. Then, the default home directory of Sam will be /home/Sam. In other words, directories under /home provide a personal workspace to regular users who don’t have root privileges.

4.6 /lib

The /lib directory contains essential shared libraries for system boot. Device drivers necessary for system boot are placed under subdirectory /lib/modules/’kernel-version’. It also contains the libraries needed by binaries from /bin and /sbin to run the commands in the root filesystem.

4.7 /media

The /media directory contains subdirectories that are utilized as mount points when we connect any removable media devices to the system. We can find subdirectories or symbolic links to directories representing different removable media devices like CD-ROMs and USB sticks. For example, on inserting a CD into our Linux system, a directory will automatically be created inside the /media directory. We can use this to access the contents of the CD inside this directory.

4.8 /mnt

The /mnt directory is a mount point where we can mount a temporary filesystem that resides on a storage device like a hard-disk drive, USB stick, or CD-ROM. Unlike /media, where the system mounts removable media automatically, under /mnt we need to mount manually. This directory can be empty or may have subdirectories to mount individual devices.

4.9 /opt

The /opt directory contains optional software packages. In this context, optional software packages are those that are not part of the system — for instance, third-party software that we install as add-ons.

4.10 /root

The /root directory is the home directory of the root user of the system.

4.11 /run

The /run directory stores the system information data describing the system since its booting. Applications store their transient files like process IDs, socket descriptors, and more in this directory.

4.12 /sbin

Similar to the /bin directory, the /sbin (system binaries) directory contains ready-to-run executables needed to boot our Linux system. However, unlike /bin binaries, /sbin contents are intended to be executed by the root user.

4.13 /srv

The /srv directory has service data. In other words, site-specific data served by our system is likely to be stored here. For instance, if we’re using an HTTP server to serve a website, then we may store files related to our website inside this directory.

4.14 /tmp

The /tmp directory contains files that are temporary. Many of these files are created by currently running processes on our system that store their temporary data under this directory. Therefore, a clearing out of this directory may happen at booting or at system shutdown.

4.15 /usr

The /usr directory contains executables and read-only data. In contrast with files that are used by the system, files under this directory are used by users. So, /usr/sbin and /usr/bin directories contain non-essential /bin and /sbin binaries, respectively. The default installation location for locally compiled applications is under /usr/local.

4.16 /var

The /var (variable) directory contains transient files and temporary files whose size may change. We can find a number of spools and log files here.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/686614.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

浅谈充电桩监控系统的必要性

关注acrelzxz,了解更多详情 摘要:针对当前电动汽车续航能力严重不足以及不能及时充电的问题,将电力电子变流技术、智能监控技术、REIP无线射频技术及CAN总线技术应用到电动汽车智能充电桩的设计与研究中。开展了无人值守的智能电动车充电桩的…

Android 使用webView打开网页可以实现自动播放音频

使用webview 自动播放音视频,场景如,流媒体自动部分,音视频通话等。会出现如下问题: 解决方案如下: 配置webview 如下,这样可以自动播放音频。 webView.getSettings().setMediaPlaybackRequiresUserGestur…

如何从视频里面提取音频,这4个方法非常好用!

今天,我要介绍4种提取视频中音频的方法,每一种都非常简单方便,让你轻松获取视频中的音频! 1.音视频分离 这是最简单直接的方法之一,你可以使用视频编辑软件将视频导入,并对其进行音频分离,就可…

[Spring Boot Starter系列]Spring Boot自动装配原理

目录 一、介绍 二、Spring Boot实现自动装配的简单流程(基于2.3.5.RELEASE版本) 三、总结 一、介绍 什么是Spring Boot的自动装配? 以下描述部分来自Spring Boot官网: Spring Boot自动配置尝试根据您添加的jar依赖项自动配置您…

《kafka 核心技术与实战》课程学习笔记(八)

无消息丢失配置怎么实现? Kafka 只对“已提交”的消息(committed message)做有限度的持久化保证。 第一个核心要素是“已提交的消息”。 当 Kafka 的若干个 Broker 成功地接收到一条消息并写入到日志文件后,它们会告诉生产者程序…

机器学习4:基本术语

机器学习涉及很多专业术语,为了避免混淆概念,我们在学习中,首先必须统一语言:即充分理解专业术语,并采用专业术语来描述机器学习相关的内容。本节将介绍几种基本的机器学习术语。 目录 1.标签 2.特征 3.示例 4.模…

shardingjdbc入门-自问自答

1:shardingjdbc 是什么,它能做什么,解决了什么问题? 现实的问题是mysql单表存储是有上线的,因为mysql采用的是 B 树类型的索引,在数据量超过阈值的时候,索引的持续变大,会导致访问磁盘的IO次数增…

【永久服务器】EUserv

1. 请先自行准备网络(我用的伦敦还可以)、以及visa卡,淘宝可以代付,我总共花了97人民币(10.94欧代付费) 现在只能申请一台,多了会被删除,也就是两欧元,然后选择visa卡 选…

正版软件 | RadiAnt DICOM Viewer - 医学图像的PACS DICOM浏览器

辐射蚂蚁DICOM查看器 2023.1 最新版。 新增功能: 长度比计算。椭球体/子弹体积计算。添加了在 DICOM 标记窗口中将特定项目着色和/或固定到顶部的选项。 改进和错误修复: 使用多个关键字(用 |) 分隔)搜索本地存档。…

0基础学习VR全景平台篇第49篇:高级功能-自定义LOGO

功能位置示意 一、本功能将用在哪里? 自定义logo功能,可以在全景作品中自定义植入商企logo,让全景自带推广属性,使宣传效果事半功倍。 备注:不同皮肤自定义logo显示位置不同。 点击这里 查看案例 二、如何使用本功能…

智云通CRM:引领企业数字化转型的利器

在如今的商业竞争中,客户管理是企业成功的关键因素之一。然而,传统的客户管理方式已经无法满足企业日益增长的需求,企业需要一个强大的工具来帮助他们更好地管理客户关系,并实现数字化转型。智云通CRM系统作为最佳解决方案&#x…

Spring Boot 如何防止重复请求?| 超级详细,建议收藏

1. 前言🔥 在日常业务开发中,处理重复请求应该是我们需要经常注意的,在某些情况下是可能重复发送的,如果是查询类操作并无大碍,但其中有些请求是涉及写入操作的,一旦重复了,很可能会导致很严重的后果&#…

【Python】模块导入 ② ( 模块导入语法 | 导入完整模块 | import 导入完整模块 | from 导入完整模块 )

文章目录 一、导入完整模块 - import 导入完整模块1、import 导入完整模块2、代码示例 - 导入 time 时间模块 二、导入完整模块 - from 导入完整模块1、from 导入完整模块2、代码示例 - from 导入完整模块 一、导入完整模块 - import 导入完整模块 1、import 导入完整模块 使用…

Mybatis背景简介及其优缺点

文章目录 1. JDBC简介1.1 jdbc架构图1.2 jdbc例子1.3 jdbc缺点 2. Mybatis2.1 iBATIS是什么2.2 Mybatis是什么2.3 和其他持久层框架的本质区别2.4 Mybatis和Hibernate的共同点2.5 Mybatis的优缺点2.5.1 Mybatis的优点2.5.2 Mybatis的缺点 2.6 Hibernate的优缺点2.6.1 Hibernate…

工作流引擎技术选型

一、主流开源框架介绍 1、工作流相关文档 1.Camunda 官方文档:https://camunda.com/ 中文文档:介绍 | docs.camunda.org 2.Activiti 官方文档:https://www.activiti.org/ 中文文档:[activiti6用户手册 3.Snaker 官方文档&…

【PCIE体系结构十四】电气物理层之发送端FFE

👉个人主页:highman110 👉作者简介:一名硬件工程师,持续学习,不断记录,保持思考,输出干货内容 参考书籍:《PCI.EXPRESS系统体系结构标准教材 Mindshare》 参考文章&…

Docker 安装 Nginx,并实现负载均衡

1、获取 nginx 的镜像 # 默认是latest版本docker pull nginx 2、运行 nginx 容器 docker run --name nginx-80 -p 80:80 --rm -d nginx# --name nginx-80 设定容器的名称# -p 80:80 端口进行映射,将本地的80端口映射到容器内部的80端口# --rm 表示容器退出后直接…

云安全技术——Hyper-V虚拟化技术

目录 5-1 了解Hyper-V 5-2 安装Hyper-V 5-3创建虚拟机 Hyper-V虚拟化技术 实验目的 了解 Windows 虚拟化的概念 了解 Hyper-V的背景及发展 了解 Hyper-V 的功能特性 了解 Hyper-V的体系架构 实验要求 能描述 Hyper-V 的功能特性 能在 Windows 2012 R2系统下部署 Hyper-V 能使…

SpringBoot整合MyBatis分页

SpringBoot整合MyBatis分页 一、pagehelper分页1、添加相关依赖2、添加相关配置3、添加分页配置4、添加代码5、测试 二、拦截器分页1、添加相关配置2、添加拦截器代码和配置3、添加代码4、测试4、测试 本文目标: SpringBoot整合Mybatis分页的两种方式,一…

Python基础八

目录 一、Python条件控制语句 1.执行过程 2.if 语句 if中常用的操作运算符: if 嵌套 3.match...case语句 二、Python循环控制语句 1.while循环 while无限循环 while 循环使用 else 语句 2.for 循环语句 for...in...循环 for循环使用else语句 for...in range()…