(1) mount:
(a) path=/bin/mount in RedHat 6.2
(b) ldd指令--在RedHat6.2中:是用來看dynamic execute file所用到的libary和shared object
經由: ldd --help可得知可搭配下列參數
mount:(經由ldd指令所得)libc.so.6 => /lib/libc.so.6 (0x4001d000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
(c) mount指令的功用:
在unix系統中,我們都是以file來作存取,所以各種device也可以用file的概念來存取! 而"mount"的目的:可以讓我們把各種不同type的file mount到某一個目錄,且都是在一個tree上!
(這樣可以達到將某個儲存裝置,指定成系統的某個目錄!)
ex:硬碟,軟碟機,or光碟機 --> 讓我們可以利用cd /xxx的方式,進入到目錄,對資料作存取! **只允許root可以做mount的動作!
[note]:
1./etc/fstab這個檔案:包含了目前有哪些device是被mounted?以及一些infomation
ex:
當fstab包含了user option on a line(each line:描述某一個device), 那麼任何使用者都可以mount the corresponding system!
即在fstab中出現: /dev/cdrom /cd iso9600 ro.user.noauto.unhide
=>所以一般user只要下: mount /dev/cdrom or mount /cd 就可以mount了!
2.而目前mounted的file systems的資訊是存放在 /etc/mtab這個檔案中!
3.系統所支援的file system type是列在: linux/fs/filesystems.c
4.偵測filesystem時: read /etc/filesystems; /proc/filesystems
(d) mount指令的 general format:
=>mount -t type [option] device dir
其中--
1.type: 欲mount到系統上的file type,以下舉一些常見的type說明~~nfs : network file system的檔案格式
iso9660 : CD-ROM的ISO9660檔案格式
ms-dos : ms-dos的檔案系統格式
ext2 : Linux的檔案系統格式
ufs : freebsd的檔案格式2.option:
-W:output version
-r:設定此目錄為read only
-w:設定此目錄可以read/write
-v:verbose mode
-h:print help message
-a:mount 所有在fstab中所提過的file system's types
-U uid :mount某個partition,請給定這個partition一個uid
3.device :
第一部軟碟機 /device/fd0 光碟機 /device/cdrom 硬碟: 必須看當初切割時,是怎麼處理的: 會分為: hda1, hda2, hda5...etc... (if同一顆硬碟同時安裝window和linux時) |
|
(e) | example: |
mount /dev/cdrom /mnt/cdrom ->將光碟機mount到 /mnt/cdrom這個目錄 mount -t ext2 /dev/hdb1 /mnt/linux2 ->將第二顆硬碟中灌linux的部份,mount到/mnt/linux2 |