doc/笔记/Linux挂载硬盘-linux-gua-zai-yin...

52 lines
884 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Linux挂载硬盘
date: 2023-05-31 12:02:12.526
updated: 2023-05-31 12:02:12.526
url: /archives/linux-gua-zai-ying-pan
categories:
- Linux
tags:
- Linux
---
查看所有硬盘信息(找到需要挂载硬盘的路径,如/dev/vdb)
```
fdisk -l
```
2.创建挂载目录
```
mkdir /data
```
3.手动挂载分区(vdb:想要挂载的分区 data:分区挂载的目录)
```
mount /dev/vdb /data
```
4.查看想要挂载分区的UUID
```
blkid /dev/vdb
```
5.修改开机挂载文件
```
vim /etc/fstab
```
6.文档末尾添加挂载信息
```
# 进入编辑模式:i 保存退出:Esc :wq 回车
# [分区UUID] [挂载目录] [分区格式] [默认配置] [开机不检查硬盘] [交换分区]
UUID=UUID /data ext4 defaults 0 0
```
7.取消挂载
```
umount /data
```
8.查看硬盘挂载情况
```
lsblk
```
```
df -h
```
转载链接https://www.jianshu.com/p/2a5b6aae5d7b