/etc/fstab
Filesystem Table, default in 644 mode
Structure
# <file system> <mount point> <type> <options> <dump> <pass>
fstab 主要有六個欄位:
- File System: 需要掛載的裝置(硬碟、Partitions、外接光碟機等等)。
- Mount Point: 要掛載的目錄。
- Type: 檔案系統型別,像是 ext4、xfs 等等。
- Options: 開機自動載入時的相關細部設定,例如限制讀寫許可權等等。
- Backup Operation(Dump): 備份設定,1 為備份, 0 為否。
- File System Check Order(Pass): 用來判斷是否在掛載前執行 fsck,有三種選項:
- 0: 不檢查 Filesystem
- 1: 最高優先檢查 Filesystem,通常用於根目錄的 Partition
- 2: 最後檢查 Filesystem
<file system> <mount point> <type> <options> <dump> <pass>
/dev/sda / ext4 errors=remount-ro 0 1
UUID=68434ede-ef44-4f3b-8ede-e5a27a68857e /mogdata/dev3268 ext4 rw,noatime,nodiratime 2 2
UUID=039ac52a-7c7f-486d-abff-ffa789b6eb34 /mogdata/dev3274 ext4 rw,noatime,nodiratime 2 2
- UUID(Universally Unique Identifier)標識檔案系統,以確保即使雲端硬碟的掛載順序發生變化仍然可以正確地自動掛載資料
Deploy
After editing, run systemctl daemon-reload
to update systemd