add post: 硬盘分区
All checks were successful
Build and Upload / Explore-Gitea-Actions (push) Successful in 2m26s
All checks were successful
Build and Upload / Explore-Gitea-Actions (push) Successful in 2m26s
This commit is contained in:
parent
53a8680ac1
commit
2b43d949a1
2
build.sh
2
build.sh
@ -6,6 +6,6 @@ rm -rf public
|
||||
|
||||
./hugo build
|
||||
|
||||
ssh -i ./id_rsa root@116.204.65.205 "rm -rf /opt/1panel/apps/openresty/openresty/www/sites/blog.xn--ghqz22d40r52n.com/index/*"
|
||||
# ssh -i ./id_rsa root@116.204.65.205 "rm -rf /opt/1panel/apps/openresty/openresty/www/sites/blog.xn--ghqz22d40r52n.com/index/*"
|
||||
|
||||
scp -r -i ./id_rsa ./public/* root@116.204.65.205:/opt/1panel/apps/openresty/openresty/www/sites/blog.xn--ghqz22d40r52n.com/index/
|
71
content/post/linux-fdisk/index.md
Normal file
71
content/post/linux-fdisk/index.md
Normal file
@ -0,0 +1,71 @@
|
||||
---
|
||||
title: Linux 硬盘分区
|
||||
description: 在Linux系统中使用fdisk初始化并对硬盘分区
|
||||
date: 2025-03-28
|
||||
slug: linux-fdisk
|
||||
image: split-disk.png
|
||||
keywords:
|
||||
- linux
|
||||
- fdisk
|
||||
categories:
|
||||
- Linux
|
||||
tags:
|
||||
- linux
|
||||
- operation
|
||||
---
|
||||
|
||||
|
||||
# 创建分区
|
||||
|
||||
查看硬盘设备:
|
||||
|
||||
```bash
|
||||
fdisk -l
|
||||
```
|
||||
|
||||
|
||||
操作设备:
|
||||
|
||||
```bash
|
||||
fdisk /dev/sdb
|
||||
```
|
||||
|
||||
|
||||
进入交互式环境:
|
||||
|
||||
```bash
|
||||
Command (m for help):
|
||||
```
|
||||
|
||||
|
||||
创建分区,键入 n 后,按提示操作
|
||||
|
||||
```bash
|
||||
Command (m for help): n
|
||||
```
|
||||
|
||||
|
||||
写入更新,键入w ,完成后会退出交互式环境。
|
||||
|
||||
# 格式化分区
|
||||
|
||||
```bash
|
||||
mkfs.ext4 /dev/sdb1
|
||||
```
|
||||
|
||||
|
||||
# 挂载分区
|
||||
|
||||
```bash
|
||||
mount /dev/sdb1 /data
|
||||
```
|
||||
|
||||
|
||||
写入 /etc/fstab ,以开机自动挂载:
|
||||
/etc/fstab 文件内添加一行:
|
||||
|
||||
```bash
|
||||
/dev/vdb1 /data ext4 defaults 0 0
|
||||
```
|
||||
|
||||
|
BIN
content/post/linux-fdisk/split-disk.png
Normal file
BIN
content/post/linux-fdisk/split-disk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 KiB |
Loading…
x
Reference in New Issue
Block a user