惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
AI
AI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
F
Full Disclosure
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
Recorded Future
Recorded Future
N
News and Events Feed by Topic
雷峰网
雷峰网
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Project Zero
Project Zero
罗磊的独立博客
G
GRAHAM CLULEY
腾讯CDC
P
Privacy International News Feed
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
H
Heimdal Security Blog
L
LINUX DO - 热门话题
Forbes - Security
Forbes - Security
美团技术团队
MongoDB | Blog
MongoDB | Blog
Security Latest
Security Latest
M
MIT News - Artificial intelligence
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
宝玉的分享
宝玉的分享
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog

Posts on Changkun's Blog

Why High-Output Systems Are Often the First to Stop Growing Dark Forest Theory: A Formal Derivation Agents (or Humans) in Goal-Directed and Goalless Environments: On Pipelines, Priors, and the Rhythm Between Exploration and Exploitation At the Boundary of Self-Reference: From Stable Structures in Artificial Intelligence to the Self as a Recursive Model in an Open Dissipative System 2023 Reading List 2022 Reading List 2021 Reading List Are PSS/USS and RSS Actually the Same Thing? Performance Differences from Page Faults vs. Prefetching 2020 Year-End Review Migration with Zero Downtime 2020 Reading List The All in Go Stack Pointers Might Not Be Ideal for Parameters Eliminating A Source of Measurement Errors in Benchmarks Setup Wordpress in 10 Minutes 我为什么不再写博客了? 2019 年终总结 2018-2019 读书清单 Ten years of blogging Rethinking the Reflections on Communications and Trusts 2018 年终总结 Go source code study is open source Go source study: unsafe Pattern Go source study: sync.Pool Go runtime programming A Million WebSocket and Go Designing Asynchronous RESTful APIs 分布式杂谈01:CAP 理论的误解 Issues of Human-Bot Interaction 压缩法与深度网络的泛化性 Go in 1 Hour UMSLT04: The Past and Present of SGD UMSLT03: A Gentle Start of Learning Theory UMSLT02: A Breif History of Neural Networks UMSLT01: A Breif History of Regularization 不笑不足以为道 论文笔记:Generalization in Deep Learning 2017 年终总结 2017 读书清单 深度学习的泛化理论简介 删除 GitHub 上已经提交的敏感信息 硕士生涯的第一年就这样告一段落了 人肉计算(10): 系统参与激励 人肉计算(9): 陷阱的解法 别聊,一聊你就暴露 人肉计算(8): 人肉计算与数据科学中的陷阱 人肉计算(7): 社会行为分析 Hexo + GitHub + Travis CI + VPS 自动部署 人肉计算(6): 预测市场 人肉计算(5): 信用风险评级模型 读书与回报 瞎扯: 对现代企业理论与当下IT企业的商业模式和信息产业链的规律性的思考 人肉计算(4): 输入数据聚合与PageRank 又一次打整了一下博客 人肉计算(3): 输入数据聚合与链路预测 人肉计算(2): 意图博弈 GWAPs 人肉计算(1): 众包与群众智慧 对后辈同学在计算机专业上的答疑与解惑 在德国的医疗及住院体验 这可能不是一个技术博客了 实验楼楼赛第3期-Python-题解 迅速更换了 DISQUS Electron 深度实践总结 良好的编码体验的三个方面 2016 年终总结 2016 读书清单 最近在着手写的文章 微信小程序文档极致总结 谈谈过去三个月在实验楼的实习经历 Built a Desktop Client for My Blog Guacamole 源码分析与 VNC 中 RFB 协议的坑 《高速上手 C++11/14》正式发布 Docker 极速入门教程02 - 镜像与容器管理 Docker 极速入门教程01 - 基本概念和操作 阶段性沉默 ELK+Redis 最佳实践 终于全面启用了 HTTPS 苹果开源了LZFSE无损压缩 Hash 碰撞的一种思路 记一次完整的 Kaldi-TIMIT 示例运行 Kaldi 上的 TIMIT 例子 Kaldi 安装与部署 从科研写作谈起 Swift API 设计指南 有趣的人类 所以其实论文并没有什么鬼用 Githug 通关记录及指南 小结一下这学期的收获 2015 读书清单 2015 年终总结 负能量爆表 转眼就快两个月了 博客迁移记录 大三总结 这个世界,终究不会是我们的。 Linux 内核分析 之六:Linux 内核创建进程的过程 小说「泽缘」 Linux 内核分析 之五:system_call中断处理过程的简要分析 大创项目的标题真是每年都在考验同学们的想象力啊
Linux学习笔记 4 Linux文件系统基本操作
Changkun Ou · 2013-12-08 · via Posts on Changkun's Blog

Published at发布于:   |   PV/UV: /   |   Reading阅读: 1 min

Linux文件系统支持:

ext2(默认不带日志)、<span style="line-height: 1.6em;">ext3(默认带日志)、</span><span style="line-height: 1.6em;">ext4、</span><span style="line-height: 1.6em;">fat(MS-DOS)、</span><span style="line-height: 1.6em;">vfat、</span><span style="line-height: 1.6em;">nfs、</span><span style="line-height: 1.6em;">iso9660、</span><span style="line-height: 1.6em;">proc、</span><span style="line-height: 1.6em;">gfs(global file system)、</span><span style="line-height: 1.6em;">jfs、</span><span style="line-height: 1.6em;">...</span>

&nbsp;

创建文件系统:

mke2fs -t ext4 /dev/sdb1

常用参数:

-b block size 指定文件系统块大小

-c 建立文件系统时,检查损坏块

-L label 指定卷标

-j 建立文件系统日志

&nbsp;

mkfs 支持参数较少 不能精细化控制

mkfs ext3 /dev/sda3

mkfs ext4 /dev/sda3

mkfs vfat /dev/sda3

&nbsp;

dumpe2fs 查看文件系统的详细信息

dumpe2fs /dev/sda3

&nbsp;

ezlabel 为文件系统添加标签

ezlabel /dev/sda2 显示sda2系统标签

ezlabel /dev/sda2 HH 设置标签为HH

&nbsp;

fsck 检查并修复损坏的文件系统

-y 不提示进行修复

-t 对损坏较严重的文件系统进行检查修复时,需要使用此参数来指定修复文件系统的类型

对于识别为文件的损坏数据(文件系统无记录)fsck会将文件放入lost+found目录系统启动时会对磁盘进行fsck操作

&nbsp;

JOURNAL日志 拥有较强的稳定性,在出现错误时可以进行恢复

带日志的文件系统:

(1)将准备执行的事务的具体内容写入日志

(2)进行操作

(3)成功后,具体内容从日志中删除

优点:出现意外可查看日志

缺点:丧失一定性能

&nbsp;

fdisk 只有超级用户才可以使用

fdisk -l 列出所有安装的磁盘及其分区信息

fdisk /dev/sda 对目标磁盘进行分区操作,分区后使用partprobe让内核更新分区信息,否则重启后才能识别

/proc/partitions 文件也可以用来查看分区信息

分区:

主分区:n -&gt; p -&gt; 1 -&gt; +size(K,M,G)

扩展分区:n -&gt; e -&gt; 2 -&gt; +size(K,M,G)

逻辑分区:n -&gt; l -&gt; enter -&gt; +size(K,M,G)

(分区号从5开始)

修改id: t

保存MBR: w

分区后需要创建文件系统才能使用。

&nbsp;

挂载、使用文件系统:磁盘或分区建好后,需挂在到一个目录才能使用

Windows或Mac会进行自动挂载,创建好文件系统后会自动挂载到系统上

Linux需要手工进行挂载或配置系统进行自动挂载

/dev/sda3 ext3 -挂载-&gt; /mnt

&nbsp;

mount 将格式化好的磁盘或分区挂载到一个目录上

mount /dev/sda3 /mnt

不带参数的mount会显示所有已挂载的文件系统

-t 指定文件系统的类型

-o 指定挂载选项

ro, rw read-only只读,read-write读写,默认rw

sync 代表不使用缓存,对所有操作直接写入磁盘

async 使用缓存(默认,提高性能)

noatime 代表每次访问文件时,不更新文件的访问时间(提高性能)

atime 代表每次访问文件时,更新文件的访问时间

remount 重新挂载文件系统

&quot;,&quot;表示连接参数

&nbsp;

umount 卸载挂载的文件系统

umount 文件系统/挂载点

umount /dev/sda3 == umount /mnt

出现device is busy报错:使用fuser -m /mnt查看使用进程 或者 lsof / mnt 查看使用文件

&nbsp;

自动挂载

配置文件/etc/fstab用来定义需要自动挂载的文件系统

fstab每一行代表一个挂载配置 格式:

&nbsp;/dev/sda3 &nbsp; /mnt &nbsp; &nbsp;ext4 &nbsp; defaults &nbsp; &nbsp; &nbsp; 0 0

要挂载的设备 挂载点 文件系统 &nbsp;挂载选项 &nbsp;dump,fsck相关选项

可以使用LABEL取代/dev/sda3

mount -a 挂载所有fstab中定义的自动挂载项