[Raspberry Pi] 設定開機自動掛載 exFAT 格式行動硬碟
1. 接上行動硬碟,檢查一下被分配到哪個裝置代號
1 | # 查看分割表狀態 |
1 | Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors |
2. 將硬碟分割表設定成 GPT
,並建立一個完整的磁碟分割
1 | # 設定分割表 |
- 輸入
g
設定成GPT
分割表1
2Command (m for help): g
Created a new GPT disklabel (GUID: 2BD8CEBF-23A4-4C49-B0E5-3D8A45B6E883). - 輸入
n
建立新磁碟分區1
2
3
4
5
6
7
8
9
10
11Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-3907029134, default 2048): 2048
Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029134, default 3907029134): 3907029134
Created a new partition 1 of type 'Linux filesystem' and of size 1.8 TiB.
Partition #1 contains a exfat signature.
Do you want to remove the signature? [Y]es/[N]o: Y
The signature will be removed by a write command. - 輸入
p
檢查分區狀況,沒問題後輸入w
寫入1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17Command (m for help): p
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2BD8CEBF-23A4-4C49-B0E5-3D8A45B6E883
Device Start End Sectors Size Type
/dev/sda1 2048 3907029134 3907027087 1.8T Linux filesystem
Filesystem/RAID signature on partition 1 will be wiped.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
3. 將硬碟掛載到 /media/external-hd
下,並設定開機自動掛載
1 | # 安裝 exFAT 相關套件 |
4. 檢查掛載狀況
1 | ubuntu@raspberry-pi:~$ lsblk |