重新整理了下mount/umount,免得老是不来新机忘记了
生活随笔
收集整理的這篇文章主要介紹了
重新整理了下mount/umount,免得老是不来新机忘记了
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
掛接就是將分離的文件系統附加到文件系統分成結構中。文件系統要附加到某個掛接點,也就是目錄。??
掛接和卸載文件系統發生在系統啟動和關閉時。??
系統啟動時,將讀取/etc/vfstab文件。這個文件記錄系統要掛接的文件系統。因此/etc/vfstab文件中的文件系統將自動掛接。也可以從命令行方式下人工掛接文件系統。??
不加參數的mount顯示系統目前已經掛接的文件系統。??
# 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的選項,可以用-o標定mount的選項
nolargefiles參數將使文件系統中所有新建的文件小于2G字節。
remount 向mount表明它應該向一個已經加載的文件系統重新加載的文件系統重新加載。這通常用來改變文件系統的加載標記,特別可用來將一個只讀的文件系統改成可讀寫的文件系統。
ro 將文件系統加載為只讀
rw 將文件系統加載為可讀寫
intr 允許殺死文件系統中正在等待的進程。
??
# mount -o nolargefiles /dev/dsk/c0t3d0s7 /export/home??
文件系統中文件的大小不能超過2G,使用這個參數可能出現錯誤,原因是由于文件系統包含了大于2G的文件,注意:是/dev/dsk/下的而不是/dev/rdsk下的,
因為/dev/rdsk下的設備是物理設備,/dev/dsk下的文件是連接到/dev/rdsk下的
要掛接在/etc/vfstab中已有的某個文件系統時,只需要用命令??
# 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應加載的所有文件系統,等同于/usr/sbin/mountall
通常不由管理員使用而是在系統啟動時候/etc/init.d/MOUNTFSYS自動發出。
列出加載的文件系統
#mount
查看文件系統
umount卸載文件系統??
# umount /dev/dsk/c0t3d0s7??
或??
# umount /export/home??
如果文件系統中某個文件正在使用,則不能卸載這個文件系統。
當一個設備busy狀態時
可以用
#umount -f /mount_point 強制卸載一個目錄 (容易丟失數據)
或用如下:(推薦)
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
掛接和卸載文件系統發生在系統啟動和關閉時。??
系統啟動時,將讀取/etc/vfstab文件。這個文件記錄系統要掛接的文件系統。因此/etc/vfstab文件中的文件系統將自動掛接。也可以從命令行方式下人工掛接文件系統。??
不加參數的mount顯示系統目前已經掛接的文件系統。??
# 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的選項,可以用-o標定mount的選項
nolargefiles參數將使文件系統中所有新建的文件小于2G字節。
remount 向mount表明它應該向一個已經加載的文件系統重新加載的文件系統重新加載。這通常用來改變文件系統的加載標記,特別可用來將一個只讀的文件系統改成可讀寫的文件系統。
ro 將文件系統加載為只讀
rw 將文件系統加載為可讀寫
intr 允許殺死文件系統中正在等待的進程。
??
# mount -o nolargefiles /dev/dsk/c0t3d0s7 /export/home??
文件系統中文件的大小不能超過2G,使用這個參數可能出現錯誤,原因是由于文件系統包含了大于2G的文件,注意:是/dev/dsk/下的而不是/dev/rdsk下的,
因為/dev/rdsk下的設備是物理設備,/dev/dsk下的文件是連接到/dev/rdsk下的
要掛接在/etc/vfstab中已有的某個文件系統時,只需要用命令??
# 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應加載的所有文件系統,等同于/usr/sbin/mountall
通常不由管理員使用而是在系統啟動時候/etc/init.d/MOUNTFSYS自動發出。
列出加載的文件系統
#mount
查看文件系統
umount卸載文件系統??
# umount /dev/dsk/c0t3d0s7??
或??
# umount /export/home??
如果文件系統中某個文件正在使用,則不能卸載這個文件系統。
當一個設備busy狀態時
可以用
#umount -f /mount_point 強制卸載一個目錄 (容易丟失數據)
或用如下:(推薦)
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
總結
以上是生活随笔為你收集整理的重新整理了下mount/umount,免得老是不来新机忘记了的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原创--DataGrid自动分页例子,通
- 下一篇: TurboMail手机客户端—强大的附件