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学院为您提供精彩教程。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |