日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

重新整理了下mount/umount,免得老是不来新机忘记了

發(fā)布時(shí)間:2023/12/19 编程问答 60 豆豆
生活随笔 收集整理的這篇文章主要介紹了 重新整理了下mount/umount,免得老是不来新机忘记了 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
掛接就是將分離的文件系統(tǒng)附加到文件系統(tǒng)分成結(jié)構(gòu)中。文件系統(tǒng)要附加到某個(gè)掛接點(diǎn),也就是目錄。??
掛接和卸載文件系統(tǒng)發(fā)生在系統(tǒng)啟動(dòng)和關(guān)閉時(shí)。??
系統(tǒng)啟動(dòng)時(shí),將讀取/etc/vfstab文件。這個(gè)文件記錄系統(tǒng)要掛接的文件系統(tǒng)。因此/etc/vfstab文件中的文件系統(tǒng)將自動(dòng)掛接。也可以從命令行方式下人工掛接文件系統(tǒng)。??


不加參數(shù)的mount顯示系統(tǒng)目前已經(jīng)掛接的文件系統(tǒng)。??
# mount??
/ on /dev/dsk/c0t3d0s0 read/write/setuid/largefiles/logging on Mon Nov 18??
17:58:19 1998??
/usr on /dev/dsk/c0t3d0s6 read/write/setuid/largefiles/logging on Mon Nov 18??
17:58:19 1998??
/proc on /proc read/write/setuid on Mon Nov 18 17:58:19 1998??
/dev/fd on fd read/write/setuid on Mon Nov 18 17:58:19 1998??
/var on /dev/dsk/c0t3d0s1 nolargefiles/read/write/setuid on Mon Nov 18 17:58:19??
1998??
/opt on /dev/dsk/c0t3d0s5 setuid/read/write/largefiles on Mon Nov 18 17:58:20??
1998??
/tmp on swap read/write on Mon Nov 18 17:58:20 1998??
/pns on dbserver:/export/pse soft/nosuid/remote on Mon Nov 18 19:04:36 1998??

1.mount的選項(xiàng),可以用-o標(biāo)定mount的選項(xiàng)

nolargefiles參數(shù)將使文件系統(tǒng)中所有新建的文件小于2G字節(jié)。
remount 向mount表明它應(yīng)該向一個(gè)已經(jīng)加載的文件系統(tǒng)重新加載的文件系統(tǒng)重新加載。這通常用來(lái)改變文件系統(tǒng)的加載標(biāo)記,特別可用來(lái)將一個(gè)只讀的文件系統(tǒng)改成可讀寫(xiě)的文件系統(tǒng)。
ro 將文件系統(tǒng)加載為只讀
rw 將文件系統(tǒng)加載為可讀寫(xiě)
intr 允許殺死文件系統(tǒng)中正在等待的進(jìn)程。
??
# mount -o nolargefiles /dev/dsk/c0t3d0s7 /export/home??

文件系統(tǒng)中文件的大小不能超過(guò)2G,使用這個(gè)參數(shù)可能出現(xiàn)錯(cuò)誤,原因是由于文件系統(tǒng)包含了大于2G的文件,注意:是/dev/dsk/下的而不是/dev/rdsk下的,
因?yàn)?dev/rdsk下的設(shè)備是物理設(shè)備,/dev/dsk下的文件是連接到/dev/rdsk下的

要掛接在/etc/vfstab中已有的某個(gè)文件系統(tǒng)時(shí),只需要用命令??
# mount /export/home??

/etc/vfstab文件格式??
#device device mount FS fsck mount mount??
#to mount to fsck point type pass at boot ops??
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -??
/proc - /proc proc - no -??
fd - /dev/fd fd - no -??
swap - /tmp tmpfs - yes -??
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -??
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no -??
/dev/dsk/c0t3d0s3 /dev/rdsk/c0t3d0s3 /export ufs 5 yes -??
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /export/home ufs 5 yes -??
/dev/dsk/c0t3d0s5 /dev/rdsk/c0t3d0s5 /opt ufs 8 yes -??
/dev/dsk/c0t3d0s1 - - swap - no -??
注意:一般不用yes用no -


#mount -a 通知mount應(yīng)加載的所有文件系統(tǒng),等同于/usr/sbin/mountall
通常不由管理員使用而是在系統(tǒng)啟動(dòng)時(shí)候/etc/init.d/MOUNTFSYS自動(dòng)發(fā)出。

列出加載的文件系統(tǒng)
#mount


查看文件系統(tǒng)

umount卸載文件系統(tǒng)??
# umount /dev/dsk/c0t3d0s7??
或??
# umount /export/home??
如果文件系統(tǒng)中某個(gè)文件正在使用,則不能卸載這個(gè)文件系統(tǒng)。

當(dāng)一個(gè)設(shè)備busy狀態(tài)時(shí)
可以用
#umount -f /mount_point 強(qiáng)制卸載一個(gè)目錄 (容易丟失數(shù)據(jù))
或用如下:(推薦)

Using the fuser Command
To stop all processes from accessinga file system:
As root,list all the processes accessing the file system
#fuser -cu mount_point
2.Kill all processes accessing the file system.
#fuser -ck mount_point
3.Verify there are no processes accessing the file system.
#fuser -c mount_point
4.Unmount the file system.
# umount mount_point

總結(jié)

以上是生活随笔為你收集整理的重新整理了下mount/umount,免得老是不来新机忘记了的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。