Files
doc/docs/tutorial-extras/4-diskmount.md
2022-09-26 14:34:19 +08:00

42 lines
862 B
Markdown
Raw 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.
---
sidebar_position: 4
---
# 磁盘挂载
插入一个u盘、tf卡或usb硬盘可实现自动挂载。
## 磁盘分区与格式化
强烈建议将你的磁盘格式化为ext4的文件系统。
在海纳思系统中普遍使用的是ext4的文件系统。
磁盘分区命令:
```bash
fdisk /dev/sda
```
```html
输入 o 设置新分区为 msdos 格式
输入 n 建立新分区
接着输入 p 建立主分区
接着默认 2048 字节扇区头和自动的扇区尾
(按回车即默认)
输入 w 将上面的操作保存
```
磁盘格式化命令:
```bash
mkfs.ext4 /dev/sda1
```
## 自动挂载
海纳思内置提供了自动挂载外置磁盘的脚本
输入以下命令可以手动卸载和挂载
```bash
automount -u
automount -a
```
系统会将你的磁盘自动挂载到 ```/mnt/sda1``` 或者 ```/mnt/mmcblk1p1```