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

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 泡面 @ 幸福

nodejs&wsl&vscode&docker开发环境搭建 python中list数组指定类型 windows10安装Trading View出错解决办法 windows or linux 64位安装ta-lib包 在centos7开启SSH服务 在centos7升级nodejs到最新版本 一张自画的RBAC用户、组、角色、权限、指令、资源图 JSON树形格式从子级获取所有父级ID JSON数据格式生成无限级树结构 MYSQL查询上级和下级 码云push时提示 DeployKey does not support push code fatal: Could not read from remote repository. git常用命令 thinkjs框架发布上线PM2管理,静态资源访问配置 登陆服务器提示“You need to run "nvm install N/A" to install it before using it.” CentOS 7.x 用shell增加、删除端口 CentOS 7.X 安全手记 Centos 7.x nginx隐藏版本号 CentOS 7.4上网速度慢,修改DNS! Centos7.4 安装Docker
centos7磁盘挂载及取消
泡面 @ 幸福 · 2018-12-15 · via 博客园 - 泡面 @ 幸福

磁盘挂载
查看已经挂载磁盘数

cat /proc/scsi/scsi | grep Host
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Host: scsi2 Channel: 00 Id: 00 Lun: 00
# 或者
ll /dev/disk/by-path | grep -v part
lrwxrwxrwx. 1 root root 9 Dec 2 00:25 pci-0000:00:1f.2-ata-2.0 -> ../../sda
lrwxrwxrwx. 1 root root 9 Dec 2 00:25 pci-0000:00:1f.2-ata-2.0 -> ../../sdb
判断磁盘名

ll /dev/disk/by-path/
取到了'../../sdb',
则磁盘名为:/dev/disk/by-path/../../sdb,即 /dev/sdb
删除/dev/sdb所有分区

fdisk /dev/sdb
Command (m for help): p(查看当前分区状态)
Command (m for help): d(删除分区)
Partition number (1-3): 3(选择要删除的分区)
Command (m for help): d(删除分区)
Partition number (1-2): 2(选择要删除的分区)
Command (m for help): d(因为只剩下一个分区,无需选择直接删除)
Command (m for help): p(查看当前分区状态)
Command (m for help): w(回车保存新的分区)
格式化磁盘

fdisk /dev/sdb
Command(m for help): n(回车新建分区)
p primary partition(1-4): p(回车新建主分区)
Partition number (1-4): 1(分区号1-4之间选择1)
First cylinder(2048-xxxxx,default 2048):(开始柱面 回车默认选择最小值)
Last cylinder(2048-xxxxx,default xxxxx):(结束柱面 选择上一步中的xxxxx)
Command(m for help): p(查看调整后分区表)
Command(m for help): w(回车保存新的分区)
如果提示“Partition table entries are not in disk order”则执行

fdisk /dev/sdb
Command(m for help): x(进入专家模式)
Command(m for help): f(修复分区表)
Command(m for help): p(查看调整后分区表)
Command(m for help): w(回车保存新的分区)
创建磁盘分区

mkfs.ext4 /dev/sdb1
Writing superblocks and filesystem accounting information:(回车)
挂载分区中的磁盘到目录/file1

# 创建目录/file1
# 挂载/dev/sdb1 到目录 /file1
mkdir /file1
mount /dev/sdb1 /file1
将挂载信息写入fstab,让系统自动挂载

# 参数说明
设备名: /dev/sdb1(一个磁盘分区)
挂载点: /file1(系统上的一个目录)
设备类型: ext4(可通过'man fstab'查询支持类型)
挂载参数: defaults(参数默认即可)
dump-freq: 0
pass-num: 0
echo "/dev/sdb1 /file1 ext4 defaults 0 0" >> /etc/fstab
查看挂载写入情况

cat /etc/fstab
取消挂载
安装psmisc

yum install psmisc -y
取消目录占用

fuser -k /file1
fuser -k /dev/sdb1
取消挂载点

umount /file1
umount /dev/sdb1
删除/dev/sdb所有分区

fdisk /dev/sdb
Command (m for help): p(查看当前分区状态)
Command (m for help): d(删除分区)
Partition number (1-2): 1(选择要删除的分区)
Command (m for help): d(删除分区)
Partition number (1-2): 2(选择要删除的分区)
Command (m for help): p(查看当前分区状态)
Command (m for help): w(回车保存新的分区)

https://yq.aliyun.com/articles/601273