# 檔案系統 - 在Linux中對檔案的操作需要透過sys call - Linux中的檔案系統分成多個層次 - 最外層是共通的virtual file system - 底下可以有不同檔案系統的實作 例如ext4, xfs, ...不同檔案系統的效能和特性,特色各有不一 - kernel還會管理buffer cache, page cache, data cache等等來加快操作速度 - O_SYNC, O_DIRECT 等參數會繞過這些cache,可以保障系統crash時資料的一致性,但也會降低效能 - 一般在kernel內實作檔案系統,但也有方法可以在用戶態實作 [FUSE](https://zh.wikipedia.org/zh-tw/FUSE) ## man 7 hier - 在Linux中所有東西都可以表現為檔案系統 - 硬體裝置 /dev - 程式資訊 /proc - IPC (unix domain socket) - SHM - 根目錄有哪些常見的資料夾? https://linux.vbird.org/linux_basic/centos7/0210filepermission.php ## man 8 mount mount可以將各種不同類型的裝置掛載到檔案系統上 - 硬碟分割區 - NFS - ramfs, tmpfs - procfs - ... ## file type Symbol File types - Regular file b Block device file c Character device file d Directory l Symbolic link s UNIX domain socket p Named pipe ## misc - /etc/fstab控制開機時會自動掛哪些裝置 - lsof 可以看哪些檔案被打開 - file 指令可以檢查檔案類型,如果是一般檔案會根據檔案內容猜測是什麼檔案 - 什麼是symbolic link? soft link和hard link差異 - 什麼是inode 用完會怎樣
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up