《LINUX入門:Linux磁盤管理之關于掛載的理解》要點:
本文介紹了LINUX入門:Linux磁盤管理之關于掛載的理解,希望對您有用。如果有疑問,可以聯系我們。
前面說到文件系統,文件系統系統是操作位便利操作系統管理而創建的一種數據存儲數據結構.當系統創建完成文件系統后,系統怎么被用戶使用,Linux內核對外提供統一的接口,用戶通過這個來對文件系統操作,內核內部再針對不同文件系統處理.
Linux文件系統:根本文件類型和inode?
?Linux使用mount的方式來使用儲存設備,掛載時候會識別文件系統類型,參考下man贊助和wiki百科介紹:
? ? ? ?
All? files?accessible?
in
?a?Unix?system?are?arranged?
in
?one?big?tree,?the
? ? ? ?
file
?hierarchy,?rooted?at?/.? These?files?can?be?spread?out?over?several
? ? ? ?
devices.?The?
mount
?command
?serves?to?attach?the?filesystem?found?on?some
? ? ? ?
device?to?the?big?
file
?tree.? Conversely,? the?
umount
(8)?
command
? will
? ? ? ?
detach?it?again.
?
?? ? ? ?
The?standard?form?of?the?
mount
?command
,?is
?
?? ? ? ? ? ? ?
mount
?-t?
type
?device?
dir
? ? ? ?
This?tells?the?kernel?to?attach?the?filesystem?found?on?device?(
which
?is
? ? ? ?
of?
type
?type
)?at?the?directory?
dir
.? The?previous?contents?(
if
?any)? and
? ? ? ?
owner? and? mode?of?
dir
?become?invisible,?and?as?long?as?this?filesystem
? ? ? ?
remains?mounted,?the?pathname?
dir
?refers?to?the?root?of? the? filesystem
? ? ? ?
on?device.
?Linux所有可以拜訪的文件都被排列為一個/開始的樹形層級結構,mount是把文件系統附加到樹形結構上.這個操作將告訴內核把設備附加到一個目錄上.
?
Mounting?takes?place?before?a?computer?can?use?any?kind?of?storage?device?(such?as?a?hard?
drive,?CD-ROM,?or?network?share).?The?user?or?their?operating?system?must?
make
?it?accessible
through?the?computer’s?
file
?system.?A?user?can?only?access?files?on?mounted?media.
?計算機想要使用任何類型的存儲設備 (如硬盤, CD-ROM, 網絡設備) 之前使用掛載, 操作系統將這個設備納入本身的文件系統中去.
?關于掛載點:
?通常的掛載點都是目錄,然則也可以是一個文件:
[root@localhost?tmp]
#?cat?>?m1<<eof
>?this?is?first?line?of?file1
>?eof
[root@localhost?tmp]
#?cat?>m2<<eof
>?this?is?file2
>?eof
[root@localhost?tmp]
#?mount?--bind?m1?m2
[root@localhost?tmp]
#?cat?m2
this?is?first?line?of?file1
?mount --bind:
?用于綁定式掛載,掛載一般無法掛載的,好比ISO鏡像文件,對文件mkfs的文件,普通文件或者目錄.
對于ISO鏡像和創建了文件系統的文件可以--bind /dev/loop設備,通過當地回環設備綁定再將回環設備掛載到系統一個目錄下,mount -o loop內部使用的就是這種做法.
?對于--bind目錄主要不支持軟連接或者不想變動目錄內容想使用其他目錄來文件來替換當前文件來做測試的情況.
?--bind文件和文件,在不改動的目標文件的情況下,測試現在新文件的效果.
本文永遠更新鏈接地址:
《LINUX入門:Linux磁盤管理之關于掛載的理解》是否對您有啟發,歡迎查看更多與《LINUX入門:Linux磁盤管理之關于掛載的理解》相關教程,學精學透。維易PHP學院為您提供精彩教程。