moonlightwatch 2b43d949a1
All checks were successful
Build and Upload / Explore-Gitea-Actions (push) Successful in 2m26s
add post: 硬盘分区
2025-03-28 10:39:21 +08:00

809 B
Raw Permalink Blame History

title, description, date, slug, image, keywords, categories, tags
title description date slug image keywords categories tags
Linux 硬盘分区 在Linux系统中使用fdisk初始化并对硬盘分区 2025-03-28 linux-fdisk split-disk.png
linux
fdisk
Linux
linux
operation

创建分区

查看硬盘设备:

fdisk -l

操作设备:

fdisk /dev/sdb

进入交互式环境:

Command (m for help):

创建分区,键入 n 后,按提示操作

Command (m for help): n

写入更新键入w ,完成后会退出交互式环境。

格式化分区

mkfs.ext4 /dev/sdb1

挂载分区

mount /dev/sdb1 /data

写入 /etc/fstab ,以开机自动挂载: /etc/fstab 文件内添加一行:

/dev/vdb1 /data ext4 defaults 0 0