磁盘管理。
一、添加新硬盘添加三个类型的硬盘每个类型硬盘内存不一样方便知道二、分区fdisk2.1fdisk指令作用指令作用a调整磁盘的启动分区p显示当权磁盘分区信息d删除磁盘分区t更改分区类型l显示所有支持的分区类型u切换分区大小的显示单位m查看所有指令的帮助信息n创建新分区q不保存更改退出 fdisk 命令w保存更改退出 fdisk 命令g新建一个空的 GPT 分区表o新建一个空的 DOSMBR分区表2.1.1。MBR格式对 /dev/sda 磁盘进行分区PPPElll容量自定[rootZXY ~]# fdisk /dev/sda Welcome to fdisk (util-linux 2.40.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS (MBR) disklabel with disk identifier 0x990495ff. Command (m for help): o # 新建 MBR 分区表 Created a new DOS (MBR) disklabel with disk identifier 0xc3b2ba40. Command (m for help): n # 新建分区 Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p # p主分区 e扩展分区 Partition number (1-4, default 1): # 分区号 First sector (2048-44040191, default 2048): # 起始扇区号 Last sector, /-sectors or /-size{K,M,G,T,P} (2048-44040191, default 44040191): 2G # 结束扇区号 Created a new partition 1 of type Linux and of size 2 GiB. Command (m for help): n # 新建 Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p # 主分区 Partition number (2-4, default 2): # 默认编号 First sector (4196352-44040191, default 4196352): Last sector, /-sectors or /-size{K,M,G,T,P} (4196352-44040191, default 44040191): 2G Created a new partition 2 of type Linux and of size 2 GiB. Command (m for help): n Partition type p primary (2 primary, 0 extended, 2 free) e extended (container for logical partitions) Select (default p): p Partition number (3,4, default 3): First sector (8390656-44040191, default 8390656): Last sector, /-sectors or /-size{K,M,G,T,P} (8390656-44040191, default 44040191): 3G Created a new partition 3 of type Linux and of size 3 GiB. Command (m for help): n Partition type p primary (3 primary, 0 extended, 1 free) e extended (container for logical partitions) Select (default e): e # 扩展分区 Selected partition 4 First sector (14682112-44040191, default 14682112): Last sector, /-sectors or /-size{K,M,G,T,P} (14682112-44040191, default 44040191): # 结束扇区号直接回车表示默认直接把剩余所有空间分配给该分区 Created a new partition 4 of type Extended and of size 14 GiB. Command (m for help): n All primary partitions are in use. Adding logical partition 5 First sector (14684160-44040191, default 14684160): Last sector, /-sectors or /-size{K,M,G,T,P} (14684160-44040191, default 44040191): 3G Created a new partition 5 of type Linux and of size 3 GiB. Command (m for help): n All primary partitions are in use. Adding logical partition 6 First sector (20977664-44040191, default 20977664): Last sector, /-sectors or /-size{K,M,G,T,P} (20977664-44040191, default 44040191): 3G Created a new partition 6 of type Linux and of size 3 GiB. Command (m for help): n All primary partitions are in use. Adding logical partition 7 First sector (27271168-44040191, default 27271168): Last sector, /-sectors or /-size{K,M,G,T,P} (27271168-44040191, default 44040191): Created a new partition 7 of type Linux and of size 8 GiB. Command (m for help): p # 打印当前分区信息 Disk /dev/sda: 21 GiB, 22548578304 bytes, 44040192 sectors Disk model: VMware Virtual S Units: sectors of 1 * 512 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xc3b2ba40 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 4196351 4194304 2G 83 Linux /dev/sda2 4196352 8390655 4194304 2G 83 Linux /dev/sda3 8390656 14682111 6291456 3G 83 Linux /dev/sda4 14682112 44040191 29358080 14G 5 Extended /dev/sda5 14684160 20975615 6291456 3G 83 Linux /dev/sda6 20977664 27269119 6291456 3G 83 Linux /dev/sda7 27271168 44040191 16769024 8G 83 Linux Command (m for help): w # 保存并退出 The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.2.1.2.GPT格式对 /dev/sdb 进行gdisk 分区三个分区容量自定[rootZXY ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.40.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS (MBR) disklabel with disk identifier 0x76f4ae84. Command (m for help): g # 创建 GPT 格式分区表 Created a new GPT disklabel (GUID: CA42BD46-2412-4200-9885-6C329228F30C). Command (m for help): n # 新建 Partition number (1-128, default 1): # 分区编号 First sector (2048-41943006, default 2048): # 起始扇区号 Last sector, /-sectors or /-size{K,M,G,T,P} (2048-41943006, default 41940991): 4G # 结束扇区号 Created a new partition 1 of type Linux filesystem and of size 4 GiB. Command (m for help): n Partition number (2-128, default 2): First sector (8390656-41943006, default 8390656): Last sector, /-sectors or /-size{K,M,G,T,P} (8390656-41943006, default 41940991): 3G Created a new partition 2 of type Linux filesystem and of size 3 GiB. Command (m for help): n Partition number (3-128, default 3): First sector (14682112-41943006, default 14682112): Last sector, /-sectors or /-size{K,M,G,T,P} (14682112-41943006, default 41940991): # 结束扇区号默认代表把剩余所有空间分配给该分区 Created a new partition 3 of type Linux filesystem and of size 13 GiB. Command (m for help): p # 打印当前分区信息 Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors Disk model: VMware Virtual S Units: sectors of 1 * 512 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: CA42BD46-2412-4200-9885-6C329228F30C Device Start End Sectors Size Type /dev/sdb1 2048 8390655 8388608 4G Linux filesystem /dev/sdb2 8390656 14682111 6291456 3G Linux filesystem /dev/sdb3 14682112 41940991 27258880 13G Linux filesystem Command (m for help): w # 保存并退出 The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.三、格式化3.1mkfs[rootZXY ~]# mkfs # 注意不要加空格点击两次 tab 键 mkfs mkfs.ext2 mkfs.ext4 mkfs.minix mkfs.vfat mkfs.cramfs mkfs.ext3 mkfs.fat mkfs.msdos mkfs.xfs选项参数功能-f强制格式化覆盖已存在的文件系统-c建立文件系统前先检查坏块-v输出建立文件系统的详细信息-d指定核心数# 查看当前分区情况 [rootZXY ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 21G 0 disk ├─sda1 8:1 0 2G 0 part ├─sda2 8:2 0 2G 0 part ├─sda3 8:3 0 3G 0 part ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 3G 0 part ├─sda6 8:6 0 3G 0 part └─sda7 8:7 0 8G 0 part # 格式化 [rootrhcsa ~]# mkfs.xfs /dev/sda1 [rootrhcsa ~]# mkfs.ext4 /dev/sda2 # 格式化成功过后可以看到该分区的 FSTYPE文件系统 和 UUID [rootrhcsa ~]# lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda ├─sda1 xfs 9457ccee-7b50-459f-819d-ce16963e666f ├─sda2 ext4 1.0 8ef7c3cf-fc4e-4cb4-98cc-e287d7ef0167 ├─sda3 ├─sda4 ├─sda5 ├─sda6 └─sda7四、挂载4.1.mount选项参数功能-a将配置文件 /etc/fstab 的所有未挂载的磁盘都挂载上来-t指定文件系统类型-o指定挂载文件系统时的自定义参数# 名称挂载 /dev/sda1 [rootZXY ~]# mkdir /guazai1 # 创建挂载点 [rootZXY ~]# mount /dev/sda1 /guazai1/ [rootZXY ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 21G 0 disk ├─sda1 8:1 0 2G 0 part /guazai1 ├─sda2 8:2 0 2G 0 part ├─sda3 8:3 0 3G 0 part ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 3G 0 part ├─sda6 8:6 0 3G 0 part └─sda7 8:7 0 8G 0 part ... # UUID 挂载 /dev/sda2 [rootZXY ~]# mkdir /guazai2 [rootZXY ~]# blkid /dev/sda2 /dev/sda2: UUID8ef7c3cf-fc4e-4cb4-98cc-e287d7ef0167 BLOCK_SIZE4096 TYPEext4 PARTUUIDc3b2ba40-02 [rootZXY ~]# mount UUID8ef7c3cf-fc4e-4cb4-98cc-e287d7ef0167 /guazai2 [rootZXY ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 21G 0 disk ├─sda1 8:1 0 2G 0 part /guazai1 ├─sda2 8:2 0 2G 0 part /guazai2 ├─sda3 8:3 0 3G 0 part ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 3G 0 part ├─sda6 8:6 0 3G 0 part └─sda7 8:7 0 8G 0 part ...

相关新闻

3步搞定全面战争MOD开发:RPFM终极效率提升指南

3步搞定全面战争MOD开发:RPFM终极效率提升指南

3步搞定全面战争MOD开发:RPFM终极效率提升指南 【免费下载链接】rpfm Rusted PackFile Manager (RPFM) is a... reimplementation in Rust and Qt6 of PackFile Manager (PFM), one of the best modding tools for Total War Games. 项目地址: https://gitcode.co…

2026/7/11 2:33:54阅读更多 →
应届生求职,证书到底能不能加分?

应届生求职,证书到底能不能加分?

“证书无用论”在应届生群体中流传已久。但2025年的就业数据给出了截然不同的答案——持有相关证书的求职者在面试成功率和薪资待遇方面显著优于没有证书的应聘者。智联招聘数据显示,超过65%的雇主在筛选简历时会优先考虑持有相关证书的候选人。拥有1-2个高含金量证…

2026/7/11 2:28:53阅读更多 →
Termux OpenSSH 配置:8022端口安全加固与密钥认证5步指南

Termux OpenSSH 配置:8022端口安全加固与密钥认证5步指南

Termux OpenSSH 安全加固实战:从基础配置到企业级防护在移动设备上搭建可远程访问的开发环境已成为现代工程师的刚需,而Termux作为Android平台最强大的终端模拟器,配合OpenSSH服务能够将手机变身为便携式Linux工作站。但默认配置下的SSH服务存…

2026/7/11 2:28:53阅读更多 →
数学建模国赛优化题解析:从5个经典赛题看规划模型建模思路与求解器选择

数学建模国赛优化题解析:从5个经典赛题看规划模型建模思路与求解器选择

数学建模国赛优化题实战解析:5大经典赛题建模思路与求解器选择指南数学建模竞赛中的优化问题往往让参赛者既兴奋又头疼——兴奋的是这类问题通常有明确的解决路径,头疼的是如何在有限时间内完成从问题理解到模型求解的全过程。本文将通过解析国赛中5个典…

2026/7/11 3:43:59阅读更多 →
嵌入式电源管理:ADP5350 PMIC设计与STM32应用

嵌入式电源管理:ADP5350 PMIC设计与STM32应用

1. 项目背景与核心需求在嵌入式系统设计中,电源管理往往是最容易被忽视却又至关重要的环节。一个典型的工业级嵌入式设备可能需要同时处理:主控芯片的多种电压需求(如STM32F215RE需要1.8V内核电压和3.3V IO电压)外围传感器的供电管…

2026/7/11 3:43:59阅读更多 →
OpenCode开源AI编程系统:本地化、可调试、可编排的开发增强方案

OpenCode开源AI编程系统:本地化、可调试、可编排的开发增强方案

1. 项目概述:这不是又一个AI编程插件,而是一套可掌控、可定制、可进化的本地化开发增强体系OpenCode 和 Oh My OpenCode 这组名字听起来像某个极客深夜在GitHub上随手敲下的仓库名——没有华丽包装,不靠营销话术,但当你真正把它装…

2026/7/11 3:43:59阅读更多 →
毫米波雷达在桥梁智能防撞预警系统中的核心作用

毫米波雷达在桥梁智能防撞预警系统中的核心作用

毫米波雷达在桥梁智能防撞预警系统中的核心作用 毫米波雷达是整套系统第一核心主感知设备,是唯一可全天候远距离持续跟踪所有船舶、输出运动参数的底层传感器,AIS、视频、热成像均为辅助校验设备,无法替代雷达。 一、全域全天候目标探测 不受…

2026/7/11 3:43:59阅读更多 →
手机端运行Gemma 4B int4量化模型实战指南

手机端运行Gemma 4B int4量化模型实战指南

1. 项目概述:当“大模型”不再只是服务器和显卡的专利“在手机上跑大模型?”——五年前问出这个问题,大概率会收获一个礼貌的微笑加一句“你先买台A100集群试试”。三年前,有人拿骁龙8 Gen2跑7B量化模型,结果是发热降频…

2026/7/11 3:43:59阅读更多 →
PID参数整定实战:3种工程方法(试凑、临界比例、一般法)对比与避坑指南

PID参数整定实战:3种工程方法(试凑、临界比例、一般法)对比与避坑指南

PID参数整定实战:3种工程方法对比与避坑指南在工业控制领域,PID控制器凭借其结构简单、鲁棒性强等优势,已成为应用最广泛的调节器类型。然而,真正让工程师们头疼的往往不是理解PID原理,而是如何在实际系统中快速准确地…

2026/7/11 3:38:58阅读更多 →
从GitHub安全案例解析常见漏洞与防护实践

从GitHub安全案例解析常见漏洞与防护实践

1. 项目概述:从GitHub Trending看安全实战 最近在GitHub Trending上看到一个项目,叫 skills4/skills ,它因为一些安全漏洞案例被大家讨论。这其实是一个挺典型的场景:一个旨在展示或教授某种技能的仓库,本身却成了安…

2026/7/10 12:10:00阅读更多 →
MLT 2026启示:因果推理与概率建模驱动下一代LLM应用

MLT 2026启示:因果推理与概率建模驱动下一代LLM应用

# MLT 2026启示:因果推理与概率建模驱动下一代LLM应用## 一、背景与挑战:从“黑箱预测”到“可信推理”2026年6月,第7届机器学习与趋势国际会议(MLT 2026)将在悉尼召开。会议议程中,“因果与可解释机器学习…

2026/7/10 12:29:21阅读更多 →
通达OA SQL注入漏洞深度剖析:从手工注入到自动化利用与防御

通达OA SQL注入漏洞深度剖析:从手工注入到自动化利用与防御

1. 项目概述与漏洞背景最近在梳理一些历史OA系统的安全风险时,通达OA v11.6版本中的一个老漏洞又进入了我的视线。这个漏洞位于/general/bi_design/appcenter/report_bi.func.php文件中,是一个典型的SQL注入点。虽然这个漏洞的利用方式看起来并不复杂&am…

2026/7/10 4:59:05阅读更多 →
Premiere Pro 2025安装失败原因与AGSIS验证绕过指南

Premiere Pro 2025安装失败原因与AGSIS验证绕过指南

1. 为什么2025版PR安装比以往更“磨人”?——从弹窗警告到路径陷阱的真实处境 Premiere Pro 2025版不是简单的一次版本迭代,它是一道分水岭。我从去年底开始帮影视工作室、高校剪辑实验室和自由职业者部署2025环境,累计处理了137台设备&#…

2026/7/11 0:03:43阅读更多 →
5款实用macOS系统优化工具:让你的Mac运行更流畅更高效

5款实用macOS系统优化工具:让你的Mac运行更流畅更高效

5款实用macOS系统优化工具:让你的Mac运行更流畅更高效 【免费下载链接】open-source-mac-os-apps 🚀 Awesome list of open source applications for macOS. https://t.me/s/opensourcemacosapps 项目地址: https://gitcode.com/gh_mirrors/op/open-so…

2026/7/11 0:03:43阅读更多 →
5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南

5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南

5分钟完全掌握:ComfyUI ControlNet预处理器终极使用指南 【免费下载链接】comfyui_controlnet_aux ComfyUIs ControlNet Auxiliary Preprocessors 项目地址: https://gitcode.com/gh_mirrors/co/comfyui_controlnet_aux 想要让AI图像生成真正听从你的指挥吗&…

2026/7/11 0:03:43阅读更多 →
YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

如果你在部署 YOLOv8 时,发现推理速度只有可怜的 1-2 FPS,而别人的演示视频却能跑到 30 FPS 以上,那么问题很可能不在模型本身,而在于你的整个处理链路。很多开发者拿到一个训练好的 YOLOv8 模型后,会直接使用官方示例…

2026/7/10 13:39:09阅读更多 →
Coze与Dify对比指南:低代码AI应用开发从入门到实战

Coze与Dify对比指南:低代码AI应用开发从入门到实战

1. 从零到一:为什么你需要了解 Coze 和 Dify?如果你对 AI 应用开发感兴趣,但一看到“大模型”、“智能体”、“工作流”这些词就头疼,觉得门槛太高,那这篇文章就是为你准备的。很多开发者,包括我自己&#…

2026/7/10 22:20:33阅读更多 →
AI生图工具怎么选?2026年6月版实测对比

AI生图工具怎么选?2026年6月版实测对比

做自媒体的朋友应该都有体会:配图一直是个让人头疼的问题。2026年,AI生图工具已经非常成熟了,但工具太多反而不知道怎么选。以下是截至2026年6月我对主流AI生图工具的实测对比。Midjourney V8.1:速度之王2026年6月11日&#xff0c…

2026/7/10 17:29:22阅读更多 →