Solaris系統(tǒng)管理培訓(xùn)(第十四章:文件系統(tǒng)掛接)
2024-07-26 00:29:52
供稿:網(wǎng)友
掛接就是將分離的文件系統(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
nolargefiles參數(shù)將使文件系統(tǒng)中所有新建的文件小于2G字節(jié)。
# mount -o nolargefiles /dev/dsk/c0t3d0s7 /export/home
使用這個(gè)參數(shù)可能出現(xiàn)錯(cuò)誤,原因是由于文件系統(tǒng)包含了大于2G的文件
要掛接在/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 -
umount卸載文件系統(tǒng)
# umount /dev/dsk/c0t3d0s7
或
# umount /export/home
如果文件系統(tǒng)中某個(gè)文件正在使用,則不能卸載這個(gè)文件系統(tǒng)。
總結(jié):如何增加一個(gè)新的硬盤
1. Set up hardware, including setting switches and attaching cables.
Follow the instructions included with the new disk. 2. Reboot the system using the command boot -r. This command will restart the system using the reconfigure (-r) option.
3. Partition the disk.
4. Create the new file systems as required.
5. Edit the /etc/vfstab file as required.
6. Reboot the system.
光驅(qū)、軟驅(qū)的使用
Solaris有個(gè)服務(wù)進(jìn)程管理光驅(qū)和軟驅(qū),當(dāng)光盤或軟盤放入機(jī)器中,系統(tǒng)會(huì)自動(dòng)的掛接上,掛接的目錄是:
Media Location
CD-ROM /cdrom/cdrom_name
Diskette /floppy/floppy_name
如:
#cd /cdrom/cdrom0
管理進(jìn)程叫卷管理服務(wù)器,其腳本位于/etc/init.d/volmgt。