青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Welcome to ErranLi's Blog!

  C++博客 :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
  106 Posts :: 1 Stories :: 97 Comments :: 0 Trackbacks

常用鏈接

留言簿(12)

搜索

  •  

積分與排名

  • 積分 - 178336
  • 排名 - 152

最新評論

閱讀排行榜

How to edit and understand /etc/fstab - 1.1 >

There's a file called /etc/fstab in your Linux system. Learn what its contents mean and how it's used in conjunction with the mount command. When you learn to understand the fstab file, you'll be able to edit its contents yourself, too.

In this tuXfile I assume you already know how to mount filesystems and partitions with the mount command. If you don't, I suggest reading the Mounting tuXfile before reading this one.

Author: Nana L?ngstedt < nana.langstedt at gmail.com >
tuXfile created: 12 October 2003
Last updated: 5 September 2009


< What is fstab and why it's useful >

fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The file is located under /etc, so the full path to this file is /etc/fstab.

/etc/fstab contains information of where your partitions and storage devices should be mounted and how. If you can't access your Windows partition from Linux, aren't able to mount your CD or write to your floppy as a normal user, or have problems with your CD-RW, you probably have a misconfigured /etc/fstab file. So, you can usually fix your mounting problems by editing your fstab file.

/etc/fstab is just a plain text file, so you can open and edit it with any text editor you're familiar with. However, note that you must have the root privileges before editing fstab. So, in order to edit the file, you must either log in as root or use the su command to become root.


< Overview of the file >

Of course everybody has a bit different /etc/fstab file because the partitions, devices and their properties are different on different systems. But the basic structure of fstab is always the same. Here's an example of the contents of /etc/fstab:

/dev/hda2 / ext2 defaults 1 1
/dev/hdb1 /home ext2 defaults 1 2
/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
/dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0
proc /proc proc defaults 0 0
/dev/hda1 swap swap pri=42 0 0

What does all this gibberish mean? As you see, every line (or row) contains the information of one device or partition. The first column contains the device name, the second one its mount point, third its filesystem type, fourth the mount options, fifth (a number) dump options, and sixth (another number) filesystem check options. Let's take a closer look at this stuff.


< 1st and 2nd columns: Device and default mount point >

The first and second columns should be pretty straightforward. They tell the mount command exactly the same things that you tell mount when you mount stuff manually: what is the device or partition, and what is the mount point. The mount point specified for a device in /etc/fstab is its default mount point. That is the directory where the device will be mounted if you don't specify any other mount point when mounting the device.

Like you already learned from the Mounting tuXfile, most Linux distros create special directories for mount points. Most distros create them under /mnt, but some (at least SuSE) under /media. As you probably noticed when looking at the example fstab, I use SuSE's mount points as an example.

What does all this mean? If I type the following command:
$ mount /dev/fd0
... my floppy will be mounted in /media/floppy, because that's the default mount point specified in /etc/fstab. If there is no entry for /dev/fd0 in my fstab when I issue the command above, mount gets very confused because it doesn't know where to mount the floppy.

You can freely change the default mount points listed in /etc/fstab if you're not satisfied with the defaults your distro has given you. Just make sure the mount point is a directory that already exists on your system. If it doesn't, simply create it.

Some partitions and devices are also automatically mounted when your Linux system boots up. For example, have a look at the example fstab above. There are lines that look like this:

/dev/hda2 / ext2 defaults 1 1
/dev/hdb1 /home ext2 defaults 1 2

As you've learned, these lines mean that /dev/hda2 will be mounted to / and /dev/hdb1 to /home. This is done automatically when your Linux system boots up... if it wouldn't, you'd have a hard time using your cool Linux system because all the programs you use are in / and you wouldn't be able to run them if / wasn't mounted! But how does the system know where you want to mount /dev/hda2 and /dev/hdb1? By looking at the /etc/fstab file of course.


< 3rd column: Filesystem type >

The third column in /etc/fstab specifies the filesystem type of the device or partition. Many different filesystems are supported but we'll take a look at the most common ones only.

ext2 and ext3 Very likely your Linux partitions are Ext3. Ext2 used to be the standard filesystem for Linux, but these days, Ext3 and ReiserFS are usually the default filesystems for almost every new Linux distro. Ext3 is a newer filesystem type that differs from Ext2 in that it's journaled, meaning that if you turn the computer off without properly shutting down, you shouldn't lose any data and your system shouldn't spend ages doing filesystem checks the next time you boot up.

reiserfs Your Linux partitions may very well be formatted as ReiserFS. Like Ext3, ReiserFS is a journaled filesystem, but it's much more advanced than Ext3. Many Linux distros (including SuSE) have started using ReiserFS as their default filesystem for Linux partitions.

swap The filesystem name is self-explanatory. The filesystem type "swap" is used in your swap partitions.

vfat and ntfs Your USB stick is most likely formatted as Vfat (more widely known as FAT32). Your Windows partitions are probably either Vfat or NTFS. The 9x series (95, 98, ME) all use Vfat, and the NT series (NT, 2000, XP, Vista, 7) use NTFS but they may be formatted as Vfat, too.

auto No, this isn't a filesystem type :-) The option "auto" simply means that the filesystem type is detected automatically. If you take a look at the example fstab above, you'll see that the floppy and CD-ROM both have "auto" as their filesystem type. Why? Their filesystem type may vary. One floppy might be formatted for Windows and the other for Linux's Ext2. That's why it's wise to let the system automatically detect the filesystem type of media such as floppies and cdroms.


< 4th column: Mount options >

The fourth column in fstab lists all the mount options for the device or partition. This is also the most confusing column in the fstab file, but knowing what some of the most common options mean, saves you from a big headache. Yes, there are many options available, but I'll take a look at the most widely used ones only. For more information, check out the man page of mount.

auto and noauto With the auto option, the device will be mounted automatically (at bootup, just like I told you a bit earlier, or when you issue the mount -a command). auto is the default option. If you don't want the device to be mounted automatically, use the noauto option in /etc/fstab. With noauto, the device can be mounted only explicitly.

user and nouser These are very useful options. The user option allows normal users to mount the device, whereas nouser lets only the root to mount the device. nouser is the default, which is a major cause of headache for new Linux users. If you're not able to mount your cdrom, floppy, Windows partition, or something else as a normal user, add the user option into /etc/fstab.

exec and noexec exec lets you execute binaries that are on that partition, whereas noexec doesn't let you do that. noexec might be useful for a partition that contains binaries you don't want to execute on your system, or that can't even be executed on your system. This might be the case of a Windows partition.

exec is the default option, which is a good thing. Imagine what would happen if you accidentally used the noexec option with your Linux root partition...

ro Mount the filesystem read-only.

rw Mount the filesystem read-write. Again, using this option might cure the headache of many new Linux users who are tearing their hair off because they can't write to their floppies, Windows partitions, or something else.

sync and async How the input and output to the filesystem should be done. sync means it's done synchronously. If you look at the example fstab, you'll notice that this is the option used with the floppy. In plain English, this means that when you, for example, copy a file to the floppy, the changes are physically written to the floppy at the same time you issue the copy command.

However, if you have the async option in /etc/fstab, input and output is done asynchronously. Now when you copy a file to the floppy, the changes may be physically written to it long time after issuing the command. This isn't bad, and may sometimes be favorable, but can cause some nasty accidents: if you just remove the floppy without unmounting it first, the copied file may not physically exist on the floppy yet!

async is the default. However, it may be wise to use sync with the floppy, especially if you're used to the way it's done in Windows and have a tendency to remove floppies before unmounting them first.

defaults Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.


< 5th and 6th columns: Dump and fsck options >

Dump and, uh, what options? Well, dump is a backup utility and fsck is a filesystem check utility. I won't discuss them in great length here (they would both need their own tuXfile), but I'll mention them, because otherwise you'd spend the rest of the day wondering what on God's green Earth do these things mean.

The 5th column in /etc/fstab is the dump option. Dump checks it and uses the number to decide if a filesystem should be backed up. If it's zero, dump will ignore that filesystem. If you take a look at the example fstab, you'll notice that the 5th column is zero in most cases.

The 6th column is a fsck option. fsck looks at the number in the 6th column to determine in which order the filesystems should be checked. If it's zero, fsck won't check the filesystem.


< Example /etc/fstab entries >

As an example, we'll take a look at a couple of fstab entries that have been a source of endless frustration for new Linux users: floppy and CD-ROM (although these days floppies aren't that important anymore).

/dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0

This line means that the floppy is mounted to /media/floppy by default and that its filesystem type is detected automatically. This is useful because the type of the floppy may wary. Note especially the rw and user options: they must be there if you want to be able to mount and write to the floppy as a normal user. If you have trouble with this, check your fstab file to see if these options are there. Also note the sync option. It can be async just as well, but it's sync because of reasons discussed a bit earlier.

/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0

Note, again, the user option that enables you to mount the CD as a normal user. The CD-ROM has the ro option because it's no use mounting a CD-ROM read-write because you wouldn't be able to write to it anyway. Also note the exec option. It's especially useful if you'd like to be able to execute something from your CD.

Also note that the noauto option is used with the floppy and CD-ROM. This means that they won't be automatically mounted when your Linux system boots up. This is useful for removable media, because sometimes there won't be any floppy or CD-ROM when you boot up your system, so there isn't any reason to try to mount something that doesn't even exist.


Linux help > File systems and directories > How to edit /etc/fstab

posted on 2010-06-24 15:45 erran 閱讀(712) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            午夜精品久久99蜜桃的功能介绍| 欧美激情视频一区二区三区不卡| 免费看黄裸体一级大秀欧美| 欧美人与禽性xxxxx杂性| 国产精品极品美女粉嫩高清在线| 国产在线视频欧美| 日韩视频一区二区在线观看| 欧美亚洲三级| 欧美成人第一页| 亚洲色诱最新| 麻豆国产精品777777在线| 国产精品xxxav免费视频| 精品1区2区| 亚洲一级电影| 免费黄网站欧美| 一本色道久久综合亚洲二区三区| 久久久99免费视频| 国产精品成av人在线视午夜片| 在线观看欧美日韩国产| 亚洲一区二区高清| 欧美国产先锋| 性xx色xx综合久久久xx| 欧美人在线观看| 在线观看欧美| 欧美在线黄色| 99精品国产99久久久久久福利| 久久久久久夜| 国内偷自视频区视频综合| 午夜欧美精品| 欧美顶级少妇做爰| 国产精品少妇自拍| 亚洲精品一区中文| 久久久久久日产精品| 99国产精品久久久久久久久久| 久久亚洲综合| 国产在线精品成人一区二区三区 | 亚洲欧美一区二区三区久久| 欧美韩国日本一区| 久久精品国产精品 | 国产日韩欧美另类| 一区二区三区www| 欧美韩日一区二区三区| 亚洲欧美日韩一区二区三区在线| 欧美精品福利视频| 亚洲黄色小视频| 老巨人导航500精品| 午夜在线电影亚洲一区| 国产精品美女久久久| 一区二区精品在线| 亚洲国产网站| 国产美女精品一区二区三区| 9色精品在线| 另类天堂视频在线观看| 国产亚洲精品7777| 香蕉成人伊视频在线观看| 亚洲人成毛片在线播放| 男同欧美伦乱| 亚洲激情第一页| 欧美好骚综合网| 另类天堂av| 亚洲国产成人在线| 欧美国产先锋| 毛片av中文字幕一区二区| 在线观看亚洲精品| 免费成人av在线看| 久久婷婷国产综合精品青草| 欲香欲色天天天综合和网| 免费观看成人| 老鸭窝毛片一区二区三区| 亚洲电影欧美电影有声小说| 美女黄毛**国产精品啪啪| 久久久人成影片一区二区三区| 激情综合视频| 久久综合精品国产一区二区三区| 久久精品国产亚洲aⅴ| 极品少妇一区二区| 免费看黄裸体一级大秀欧美| 蜜臀91精品一区二区三区| 亚洲国产精品小视频| 亚洲国产日韩在线一区模特| 久久综合网hezyo| 亚洲二区在线视频| 亚洲电影免费在线| 欧美精品v日韩精品v国产精品| 日韩视频免费观看高清在线视频| 亚洲乱码精品一二三四区日韩在线| 欧美日韩大片| 午夜国产不卡在线观看视频| 亚洲欧美精品在线观看| 国产亚洲毛片| 欧美成人在线影院| 欧美日韩成人一区二区| 午夜欧美精品久久久久久久| 午夜久久久久久| 亚洲高清av| 亚洲精品一区二区三区av| 国产精品免费网站| 久久久之久亚州精品露出| 美女脱光内衣内裤视频久久网站| 在线视频日韩| 欧美亚洲视频一区二区| 亚洲电影观看| 一本色道久久综合亚洲精品高清 | 日韩一级在线观看| 亚洲视频大全| 一区在线电影| 亚洲卡通欧美制服中文| 国产伦精品一区二区三区在线观看 | 久久精品亚洲国产奇米99| 亚洲电影免费观看高清| 亚洲精品一线二线三线无人区| 国产精品一区二区久激情瑜伽| 久久综合久久综合这里只有精品| 免费欧美日韩国产三级电影| 亚洲欧美日韩精品久久奇米色影视| 久久激情综合网| 一本色道久久综合亚洲精品不 | 久久福利精品| 一区二区三区**美女毛片| 欧美一区二区视频网站| 日韩视频一区二区三区| 性欧美大战久久久久久久免费观看| 亚洲大片av| 亚洲午夜未删减在线观看| 亚洲高清一二三区| 亚洲在线一区二区三区| 亚洲人成亚洲人成在线观看图片| 亚洲尤物视频网| 亚洲精品九九| 久久久精品一品道一区| 亚洲永久在线| 欧美91视频| 久久久亚洲国产天美传媒修理工| 欧美日韩第一区| 欧美不卡一卡二卡免费版| 国产精品日韩欧美大师| 亚洲国产成人porn| 韩国av一区二区三区四区| 性色av一区二区怡红| 99riav国产精品| 午夜日韩福利| 一区二区三区欧美日韩| 久久久精品动漫| 亚洲欧美综合v| 欧美精品粉嫩高潮一区二区 | 99在线|亚洲一区二区| 激情一区二区三区| 亚洲一区国产一区| 一区二区三区国产在线观看| 麻豆精品在线视频| 久久久久国产免费免费| 国产精品二区影院| 亚洲欧洲综合| 亚洲人成网在线播放| 久久精品国产清高在天天线| 亚洲综合大片69999| 欧美激情综合网| 欧美国产视频在线| 亚洲成在人线av| 久久精品国产一区二区电影| 欧美一区免费视频| 国产精品视频免费在线观看| 夜夜狂射影院欧美极品| 一区二区三区精品久久久| 你懂的亚洲视频| 牛牛国产精品| 亚洲国产成人av好男人在线观看| 久久国产精品99精品国产| 久久激情久久| 日韩视频在线观看免费| 欧美亚洲三区| 久久成人国产精品| 国产精自产拍久久久久久| 亚洲视频二区| 午夜精品在线观看| 国产精品视频网址| 亚洲无玛一区| 欧美一区二区三区四区视频| 国产乱码精品一区二区三区不卡| 亚洲无线视频| 欧美一区二区三区四区在线观看地址| 国产精品久久久久一区二区三区| 亚洲色诱最新| 欧美一区二区久久久| 国产亚洲精久久久久久| 久久精品免费电影| 男男成人高潮片免费网站| 91久久亚洲| 欧美日韩成人一区二区| 在线综合+亚洲+欧美中文字幕| 亚洲欧美国产77777| 国产精品一区二区三区观看| 欧美一二三区精品| 久久影视精品| 最新国产成人在线观看| 欧美日韩美女| 亚洲一区二区三区高清不卡| 久久久精品日韩欧美| 亚洲国产合集| 欧美日韩成人一区|