![Linux-fstab-參數(shù)詳解_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/17/0c4284d8-1e5c-438b-8219-05fd7f03e637/0c4284d8-1e5c-438b-8219-05fd7f03e6371.gif)
![Linux-fstab-參數(shù)詳解_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/17/0c4284d8-1e5c-438b-8219-05fd7f03e637/0c4284d8-1e5c-438b-8219-05fd7f03e6372.gif)
![Linux-fstab-參數(shù)詳解_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/17/0c4284d8-1e5c-438b-8219-05fd7f03e637/0c4284d8-1e5c-438b-8219-05fd7f03e6373.gif)
![Linux-fstab-參數(shù)詳解_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/17/0c4284d8-1e5c-438b-8219-05fd7f03e637/0c4284d8-1e5c-438b-8219-05fd7f03e6374.gif)
![Linux-fstab-參數(shù)詳解_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/17/0c4284d8-1e5c-438b-8219-05fd7f03e637/0c4284d8-1e5c-438b-8219-05fd7f03e6375.gif)
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Linux fstab 參數(shù)詳解Linux fstab 參數(shù)詳解 Linux 下的加掛硬盤經(jīng)常使用。 在最后一步修改/etc/fstab 文件設(shè)置開機(jī)自動(dòng)掛載。今天用的時(shí)候,發(fā)現(xiàn)對(duì)這個(gè)文件中的最后2個(gè)參數(shù)不是很明白。 再次MAN了一下。 Linux 下掛載硬盤的 方法 rootqs-wg-db1 /# cat /etc/fstab LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=6
2、20 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 LABEL=SWAP-sda2 swap swap defaults 0 0 /dev/sda1 /u01 ext3 defaults 0 0 rootqs-wg-db1 /# man fstab FSTAB(5 Linux Programmer's Manual FSTAB(5 NAME fstab - static information about the filesystems SYNOPSIS #include <fstab.h> D
3、ESCRIPTION The file fstab contains descriptive information about the various file systems. fstab is only read by programs, and not written; It is the duty of the system administrator to properly create and maintain this file. Each filesystem is described on a separate line; fields on each line are s
4、eparated by tabs or spaces. Lines starting with '#' are comments. The order of records in fstab is important(fatab中記錄的順序很重要) because fsck(8, mount(8, and umount(8 sequentially iterate through fstab doing their thing. The first field(第一個(gè)字段), (fs_spec, describes the block special device or rem
5、ote filesystem to be mounted. For ordinary mounts it will hold (a link to a block special device node (as created by mknod(8 for the device to be mounted, like '/dev/cdrom' or '/dev/sdb7'. For NFS mounts one will have <host>:<dir>, e.g., 'knuth.aeb.nl:/'. For proc
6、fs, use 'proc'. Instead of giving the device explicitly, one may indicate the (ext2 or xfs filesystem that is to be mounted by its UUID or volume label (cf. e2label(8 or xfs_admin(8, writing LABEL=<label> or UUID=<uuid>, e.g., 'LABEL=Boot' or 'UUID=3e6be9de-8139-11d1-
7、9106-a43f08d823a6'. This will make the system more robust: adding or removing a SCSI disk changes the disk device name but not the filesystem volume label. The second field, (fs_file,(第二個(gè)字段) describes the mount point for the filesystem. For swap partitions, this field should be specified as '
8、;none'. If the name of the mount point contains spaces these can be escaped as '/040'. The third field, (fs_vfstype(第三個(gè)字段), describes the type of the filesystem. Linux supports lots of filesystem types(支持的文件類型), such as adfs, affs, autofs, coda, coherent, cramfs, devpts, efs, ext2, ext3,
9、 hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, and possibly others. For more details, see mount(8. For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denot
10、es a file or partition to be used for swapping, cf. swapon(8. An entry ignore causes the line to be ignored. This is useful to show disk partitions which are currently unused. The fourth field, (fs_mntops(第四個(gè)字段), describes the mount options associated with the filesystem. It is formatted as a comma
11、separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8. For documentation on all nfs-specific options have a look at nfs(5. Common for all types
12、 of file system are the options ''noauto'' (do not mount when "mount -a" is given, e.g., at boot time, ''user'' (allow a user to mount, ''owner'' (allow device owner to mount, ''pamconsole'' (allow a user at the console to mou
13、nt, and ''comment'' (e.g., for use by fstab-maintaining programs. The ''owner'', ''pamconsole'' and ''comment'' options are Linux-specific. For more details, see mount(8. The fifth field, (fs_freq,(第五個(gè)字段) is used for these filesystems b
14、y the dump(8 command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.(0表示不需要dump) The sixth field, (fs_passno(第六個(gè)字段), is used by the fsck(8 program to determine the or
15、der in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to
16、utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. (如果不指定或者為0, 該硬件在重啟時(shí)fsck將不檢查) The proper way to read records from fstab is to use the routines getmntent(3. FILES
17、 /etc/fstab SEE ALSO getmntent(3, mount(8, swapon(8, fs(5, nfs(5 HISTORY The ancestor of this fstab file format appeared in 4.0BSD. 網(wǎng)上找到一份中文版的: fs_specfs_filefs_typefs_optionsfs_dumpfs_pass /dev/hda1/ext2defaults 11 (1)fs_spec: 該字段定義希望加載的文件系統(tǒng)所在的設(shè)備或遠(yuǎn)程文件系統(tǒng),對(duì)于一般的本地塊設(shè)備情況來說:IDE設(shè)備一般描述為 /dev/hdaXN,X是IDE 設(shè)備
18、通道(a,b,orc,N代表分區(qū)號(hào);SCSI設(shè)備一描述為/dev/sdaXN。對(duì)于NFS情況,格式一般為:,例如: knuth.aeb.nl:/'。對(duì)于procfs,使用proc'來定義。 對(duì)文件系統(tǒng)的定義(fs spec,它描述了將被裝載的塊設(shè)備或遠(yuǎn)程文件系統(tǒng)。對(duì)于通常的mount操作而言,這個(gè)字段應(yīng)該包括一個(gè)將被裝載的塊設(shè)備的 設(shè)備結(jié)點(diǎn)(通過mknod 命令來創(chuàng)建或指向這類結(jié)點(diǎn)的連接(例如/dev/cdrom或/dev/sdb,對(duì)于NFS mount操作,這個(gè)字段應(yīng)該包含host:dir格式的信息,例如:knuth.aeb.nl:/,對(duì)于進(jìn)程文件系統(tǒng)procfs,使用pro
19、c。 除了顯示的使用設(shè)備名,你可以使用設(shè)備的UUID或設(shè)備的卷標(biāo)簽,例如,你可以在這個(gè)字段寫成“LABAL=root”或“UUID=3e6be9de -8139-11d1-9106-a43f08d823a6”,這將使系統(tǒng)更具伸縮性。例如,如果你的系統(tǒng)添加或移除了一個(gè)SCSI硬盤,這有可以改變你的設(shè)備名,但它不會(huì)修改你的卷標(biāo)簽。 (2)fs_file: 該字段描述希望的文件系統(tǒng)加載的目錄點(diǎn),對(duì)于swap設(shè)備,該字段為none;對(duì)于加載目錄名包含空格的情況,用40來表示空格。描述文件系統(tǒng)的載入點(diǎn),對(duì)于交換分區(qū)(swap,這個(gè)字段定義為none,如果在載入點(diǎn)的路徑中包含空格符,可以用“/040”來替
20、代空格符。 (3)fs_type:定義了該設(shè)備上的文件系統(tǒng),一般常見的文件類型為ext2(Linux設(shè)備的常用文件類型、vfat(Windows系統(tǒng)的fat32格式、NTFS、iso9600等.文件系統(tǒng)類型(fs vfstype,主要用來定義文件系統(tǒng)的類型。Linux系統(tǒng)支持大量的文件類型,包括sdfs,affs,autofs,jfs,minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs,,smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs等等。如果想了解你的kernel
21、目前支持哪些文件系統(tǒng),可以查看/proc/filesystems的內(nèi)容。如果這個(gè)字段定義為swap,這條紀(jì)錄將關(guān)聯(lián)到一個(gè)用于交換目的的文件或分區(qū)。如果這個(gè)字段定義為ignored,這行將被忽略。這對(duì)于顯示目前沒有使用的分區(qū)非常有用。 (4)fs_options:指定加載該設(shè)備的文件系統(tǒng)是需要使用的特定參數(shù)選項(xiàng),多個(gè)參數(shù)是由逗號(hào)分隔開來。文件系統(tǒng)選項(xiàng)(fs mntops在裝載文件系統(tǒng)時(shí)使用的裝載選項(xiàng)。多個(gè)選項(xiàng)之間用逗號(hào)做分隔符,這些選項(xiàng)列表包括了裝載類型以及對(duì)于該文件系統(tǒng)合適的其它裝載選項(xiàng)。對(duì)于非 NFS系統(tǒng)可用的裝載選項(xiàng)可以參看mount命令的說明,對(duì)于nfs系統(tǒng)的選項(xiàng)可以查看關(guān)于nfs的文檔。對(duì)于所有文件系統(tǒng)都適用的選項(xiàng)有noauto (當(dāng)使用mount a命令時(shí)不載入,user(允許用
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 游戲產(chǎn)業(yè)的社交媒體廣告投放與互動(dòng)性研究
- 電力系統(tǒng)中的電能質(zhì)量評(píng)估與監(jiān)控系統(tǒng)
- 湘教版數(shù)學(xué)八年級(jí)下冊(cè)《2.2.2平行四邊形的判定》聽評(píng)課記錄
- 現(xiàn)代辦公環(huán)境下的生產(chǎn)管理新模式
- 部編版八年級(jí)歷史上冊(cè)《第24課人民解放戰(zhàn)爭(zhēng)的勝利》表格式聽課評(píng)課記錄
- 第1節(jié) 負(fù)數(shù)的初步認(rèn)識(shí) 說課稿-2023-2024學(xué)年六年級(jí)下冊(cè)數(shù)學(xué)人教版
- 淺談新技術(shù)推動(dòng)下企業(yè)管理創(chuàng)新方向和重點(diǎn)領(lǐng)域探討報(bào)告報(bào)告解析
- 湘教版九年級(jí)數(shù)學(xué)下冊(cè)2.5直線與圓的位置關(guān)系2.5.2第2課時(shí)切線的性質(zhì)聽評(píng)課記錄
- 機(jī)房環(huán)境監(jiān)測(cè)與自動(dòng)控制系統(tǒng)建設(shè)
- 2025年度智慧農(nóng)業(yè)建設(shè)項(xiàng)目勞務(wù)分包合同
- 2025年常德職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年??及鎱⒖碱}庫含答案解析
- Unit2 No rules no order Section A Grammar 英文版說課稿2024-2025學(xué)年人教版(2024)七年級(jí)英語下冊(cè)
- 政治-湖北省湖部分名校(云學(xué)名校聯(lián)盟)2025屆高三1月聯(lián)考試題和答案
- 行政單位會(huì)計(jì)核算職責(zé)(4篇)
- 《義務(wù)教育道德與法治課程標(biāo)準(zhǔn)》解讀
- 2024年臨滄永德縣人民法院聘用制書記員招聘考試真題
- 2025年春新滬科版物理八年級(jí)下冊(cè)全冊(cè)教學(xué)課件
- 2025年國家廣播電視總局監(jiān)管中心招聘5人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 中醫(yī)院發(fā)展中醫(yī)重點(diǎn)???、學(xué)科加強(qiáng)中醫(yī)藥人才培養(yǎng)的具體措施
- 2025年中國私域電商行業(yè)市場(chǎng)運(yùn)行態(tài)勢(shì)、市場(chǎng)規(guī)模及發(fā)展趨勢(shì)研究報(bào)告
- 財(cái)務(wù)核算管理制度
評(píng)論
0/150
提交評(píng)論