Skip to content

Commit eaf6e05

Browse files
committed
docs: add hardware
1 parent 9a5574c commit eaf6e05

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

chapters.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- file-system.md: 文件系统
44
- cron.md: Cron 定时任务
55
- systemd.md: SystemD
6+
- hardware.md: 硬件管理
67
- xargs.md: xargs 命令
78
- distro/: 发行版
89
- distro/arch.md: Arch Linux

docs/hardware.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Linux 硬件管理
2+
3+
## 挂载外部硬盘
4+
5+
系统接入外部硬盘后,先用 fdisk 命令找出硬盘编号。
6+
7+
```bash
8+
$ sudo fdisk -l
9+
```
10+
11+
这里假定硬盘编号是`/dev/sdc`
12+
13+
然后,创建一个挂载点目录`/mnt/sdd`
14+
15+
```bash
16+
$ sudo mkdir /mnt/sdd
17+
```
18+
19+
接着,使用 mount 命令将外部硬盘挂载到该目录。
20+
21+
```bash
22+
$ sudo mount /dev/sdc /mnt/sdc
23+
```
24+
25+
如果挂载的硬盘为 NTFS 格式,需要用 mount 命令的`-t`参数指定挂载类型。
26+
27+
```bash
28+
# 只读
29+
$ sudo mount -t ntfs /dev/sdc /mnt/sdc
30+
31+
# 读写
32+
$ sudo mount -t ntfs-3g /dev/sdc /mnt/sdc
33+
```
34+
35+
最后,使用 df 命令查看是否挂载成功。
36+
37+
```bash
38+
$ df -h
39+
```
40+

0 commit comments

Comments
 (0)