Linux绯荤粺寮€鏈鸿嚜鍔ㄦ寕杞芥枃浠秄stab浠嬬粛
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux绯荤粺寮€鏈鸿嚜鍔ㄦ寕杞芥枃浠秄stab浠嬬粛相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e7%94%a8%e6%88%b7%e5%90%8d' title='鐢ㄦ埛鍚?>鐢ㄦ埛鍚?/a> roc 鍐冲畾 shm data 鏃堕棿 echo 鏁版嵁 systems
Linux绯荤粺寮€鏈鸿嚜鍔ㄦ寕杞芥枃浠秄stab浠嬬粛Linux绯荤粺寮€鏈鸿嚜鍔ㄦ寕杞芥枃浠秄stab浠嬬粛
涓€銆乫stab绠€浠?/h1>
fstab鏂囦欢涓寘鍚簡鍚勭鍚勬牱鐨勬枃浠剁郴缁熸弿杩颁俊鎭紝瀹冨彲浠ヨ鐗规畩鐨勫伐鍏蜂慨鏀癸紝fstab涓瘡涓€涓枃浠剁郴缁熸弿杩板崰涓€琛岋紝姣忎竴琛屾槸TAB鎴栫┖鏍煎垎闅斻€?/p>
浜屻€乫stab鏂囦欢鍐呭浠嬬粛
[root@Centos ~]# cat /etc/fstab
/etc/fstab
Created by anaconda on Sun Aug 7 05:42:06 2016
Accessible filesystems, by reference, are maintained under 鈥?dev/disk鈥?br/>See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=4eff9bdb-7e0b-4d25-8931-dc776537bc73 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
绗竴鍒楅渶瑕佹寕杞界殑璁惧锛?dev/sda锛夋垨杩滅▼鏂囦欢绯荤粺(nfs)
绗簩鍒楁槸鏂囦欢绯荤粺鐨勬寕杞界偣
绗笁鍒楁槸闇€瑕佹寕杞界殑鏂囦欢绯荤粺
绗洓鍒楁寕杞芥墍闇€甯︽湁鍙傛暟
async 姝ゅ弬鏁拌〃鏄庢墍娑夊強鐨勬枃浠剁郴缁烮/O閮芥槸寮傛澶勭悊锛屼笉浼氬悓姝ュ啓鍏ョ鐩樿兘鎻愰珮鎬ц兘锛岀敓浜х幆澧冧竴鑸笉鐢?br/>atime 姝ゅ弬鏁拌〃鏄庡湪姣忎竴娆℃暟鎹闂椂锛屽悓姝ユ洿鏂版瘡娆$殑璁块棶鐨刬node鏃堕棿锛屾槸榛樿鍙傛暟锛屽疄闄呯敓浜х幆澧冧腑楂樺苟鍙戞儏鍐典笉寤鸿浣跨敤
auto 鑳藉琚嚜鍔ㄦ寕杞介€氳繃-a 閫夐」
defaults 缂虹渷鍊硷紙rw,suid,dev,auto锛?br/>noatime涓嶅悓姝ユ洿鏂版枃浠剁郴缁熻闂甶node鏃堕棿锛屾彁楂業/O鎬ц兘锛屽疄闄呯敓浜х幆澧冨父鐢?br/>noauto涓嶈嚜鍔ㄨ繘琛屾寕杞?br/>noexec涓嶅彲鎵ц鍙墽琛岀▼搴?br/>绗簲鍒楀喅瀹氭枃浠剁郴缁熸槸鍚﹂渶瑕侀€氳繃dump,閫氬父璁剧疆涓?鎴?
绗叚鍒楁帶鍒舵枃浠舵槸鍚﹂渶瑕佸紑鏈鸿繘琛宖sck妫€鏌?br/>0涓轰笉闇€瑕侊紝鏍瑰垎鍖轰竴鑸缃负1锛?boot鍒嗗尯涓€鑸缃负2
涓夈€侀厤缃甪stab鏂囦欢
[root@Centos ~]# vi /etc/fstab
/etc/fstab
Created by anaconda on Sun Aug 7 05:42:06 2016
Accessible filesystems, by reference, are maintained under 鈥?dev/disk鈥?br/>/dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
192.168.1.2:/data/bbs /mnt nfs defaults 0 0
淇濆瓨閫€鍑哄嵆鍙?/p>
鍥涳細閰嶇疆娴嬭瘯
鍓嶉潰涔熸彁鍒拌繃锛屾垜浠彲浠ユ妸寮€鏈鸿嚜鍔ㄥ惎鍔ㄧ殑鏂囦欢鏀惧湪/etc/rc.local涓嬮潰
鍥犳鍦ㄦ祴璇曟閰嶇疆涔嬪墠锛屾垜浠厛鏉ユ祴璇曚笅/etc/rc.local鑳藉惁杈惧埌寮€鏈鸿嚜鍔ㄦ寕杞界殑闇€姹?br/>[root@localhost ~]# cat /etc/rc.local
#!/bin/sh
This script will be executed after all the other init scripts.
You can put your own initialization stuff in here if you don鈥榯
want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
[root@localhost ~]# echo "/bin/mount -t nfs 192.168.1.2:/data/bbs /mnt">>/etc/rc.local
[root@localhost ~]# tail -1 /etc/rc.local
/bin/mount -t nfs 192.168.1.2:/data/bbs /mnt
[root@localhost ~]# reboot
閲嶅惎绯荤粺娴嬭瘯寮€鏈烘寕杞芥儏鍐?br/>[root@localhost /]# df -h 鏌ョ湅鏄惁鎸傝浇鎴愬姛
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 18G 3.3G 14G 20% /
tmpfs 491M 0 491M 0% /dev/shm
/dev/sda1 485M 35M 426M 8% /boot
192.168.1.2:/data/bbs 50G 3.5G 44G 8% /mnt
缁忔祴璇曞彲浠ュ疄鐜板紑鏈鸿嚜鍔ㄦ寕杞?/p>
鎺ヤ笅鏉ユ垜浠皢鑷姩鎸傝浇鍛戒护鏀惧湪/etc/fstab涓嬮潰娴嬭瘯涓?br/>杩欓噷娉ㄦ槑涓嬶紝鍦ㄩ厤缃?etc/fstab鏂囦欢鍓嶈寰楀浠?br/>[root@localhost ~]# cp /etc/fstab /etc/fstab.ori.bak.20160818
[root@localhost /]# vi /etc/fstab
/etc/fstab
Created by anaconda on Fri Aug 19 20:33:46 2016
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
192.168.1.2:/data/bbs /mnt nfs defaults 0 0
"/etc/fstab" 16L, 833C written
[root@localhost /]# tail -1 /etc/fstab 妫€鏌ラ厤缃?br/>192.168.1.2:/data/bbs /mnt nfs defaults 0 0
閰嶇疆瀹屾垚锛岄噸鍚郴缁?br/>[root@localhost /]# reboot
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 18G 3.3G 14G 20% /
tmpfs 491M 72K 491M 1% /dev/shm
/dev/sda1 485M 35M 426M 8% /boot
192.168.1.2:/data/bbs 50G 3.5G 44G 8% /mnt
鍚屾牱涔熷彲浠ュ紑鏈鸿嚜鍔ㄦ寕杞芥垚鍔?/p>
浣嗘槸瀹為檯鐢熶骇鐜涓紝杩欑鍋氭硶鏄笉寤鸿鐨勶紝鍥犱负濡傛灉褰揘FS鏈嶅姟绔浜庝笉鍙敤鐘舵€侊紝閭d箞瀹㈡埛绔紑鏈哄悗鍙兘浼氬鑷存棤娉曞惎鍔ㄧ殑椋庨櫓锛屽洜寮€鏈哄惎鍔ㄧ殑椤哄簭鏄?etc/fatab鍏堝惎鍔紝/etc/rc.local鍚庡惎鍔紝鍥犳瑕佸疄闄呯敓浜х幆澧冧腑锛岃褰㈡垚涓€瀹氳鑼冿紝瑕佷箞灏嗗惎鍔ㄥ唴瀹规斁鍏?etc/rc.local锛岃涔堝皢鍚姩鍐呭鏀惧叆/etc/fatab涓€?/h3>
浜旓細fstab鏁呴殰瀵艰嚧寮€鏈烘棤娉曞惎鍔ㄨВ鍐虫柟娉?/h1>
鏁呴殰鐜鎿嶄綔绯荤粺鏄疌entos 6.5
寮€鏈哄姞杞藉悗鍑虹幇濡備笅鎻愮ず锛屾彁绀哄紑鏈烘鏌ユ椂鍑虹幇涓€涓敊璇?br/>
绯荤粺鍔犺浇閿欒锛屾棤娉曞惎鍔ㄤ簡
鏂规硶涓€锛?/h1>
鎻愮ず杈撳叆root瀵嗙爜鎴朿ontrol-D 缁х画锛岃繖閲屾垜浠緭鍏ョ鐞嗗憳瀵嗙爜
缂栬緫/etc/fstab鏃讹紝鎻愮ず鏃犳硶鍐欏叆
鎺ヤ笅鏉ユ墽琛屼笅闈㈠懡浠よ繘琛屼慨鏀?br/>[root@localhost ~]# mount -o rw,remount /
[root@localhost ~]# cp /etc/fstab.ori.bak.20160818 /etc/fstab
[root@localhost ~]# reboot
鍙互姝e父鍚姩浜?/p>
鏂规硶浜岋細
鍒╃敤绯荤粺鍏夌洏寮曞杩涜鎭㈠锛屽厛璁剧疆濂戒粠鍏夐┍鍚姩
閲嶅惎绯荤粺鍚庨€夋嫨鏁戞彺妯″紡
杩涘叆鍚庨€夋嫨浜屼釜榛樿閫夐」
閫夋嫨涓嶄粠缃戝崱鍚姩
閫夋嫨鍚姩shell
浠庝笂闈㈠緱鐭ョ洰褰曡鎸傝浇鍦?mnt/sysimage涓嬮潰锛屽洜姝ゆ墽琛屽墠闈㈢殑澶囦唤鏂囦欢杩涜鎭㈠鍗冲彲
閲嶅惎绯荤粺锛屽皢鍚姩璁剧疆涓虹鐩樺惎鍔?br/>
杈撳叆鐢ㄦ埛鍚嶄笌瀵嗙爜锛屾垚鍔熺櫥闄嗙郴缁燂紝鎭㈠鎴愬姛銆?br/>
以上是关于Linux绯荤粺寮€鏈鸿嚜鍔ㄦ寕杞芥枃浠秄stab浠嬬粛的主要内容,如果未能解决你的问题,请参考以下文章
涔濇湀涓汉鑰冩牳锛氬浣曡瘑鍒獿inux绯荤粺涓寚瀹氭枃浠?/etc/fstab)鐨勫叧鑱斿寘
Linux绯荤粺鍩虹鐭ヨ瘑鐩綍銆佸厓鏁版嵁銆佽蒋纭摼鎺ャ€佹枃浠剁鐞嗗懡浠ゃ€乿im鏌ユ壘鏇挎崲銆乿imtab缂╄繘