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

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| 狠狠色噜噜狠狠狠狠色吗综合| 久久久噜噜噜久久狠狠50岁| 久久久噜噜噜久久狠狠50岁| 在线成人激情黄色| 亚洲精品一区二区三区在线观看| 欧美日韩1080p| 午夜精品视频网站| 久久久999国产| 日韩小视频在线观看| 一区二区三区成人精品| 国产亚洲激情| 亚洲第一综合天堂另类专| 欧美日韩精品免费在线观看视频| 亚洲一区二区三区在线| 久久精品99国产精品日本| 亚洲精品免费观看| 亚洲欧美春色| 91久久夜色精品国产九色| 一区二区三区日韩欧美| 在线播放不卡| 亚洲一区免费在线观看| 亚洲国产91精品在线观看| 日韩午夜在线观看视频| 狠狠综合久久av一区二区老牛| 欧美成人日韩| 国产日韩欧美高清免费| 亚洲国产成人在线视频| 国产女主播一区二区| 亚洲第一网站| 国产一区二三区| 99精品国产一区二区青青牛奶| 国产一区二区日韩| 一区二区三区欧美在线| 亚洲国产精品久久久久婷婷老年| 宅男66日本亚洲欧美视频| 亚洲高清视频在线| 欧美亚洲在线播放| 亚洲一区二区免费| 欧美高清日韩| 欧美国产一区二区| 国产日韩一级二级三级| 99国内精品久久| 亚洲精品偷拍| 欧美aa在线视频| 麻豆91精品91久久久的内涵| 国产精品久久一级| 日韩一级片网址| 亚洲乱码久久| 欧美大片91| 欧美国产精品中文字幕| 136国产福利精品导航网址应用| 亚洲视频精选在线| 亚洲综合清纯丝袜自拍| 欧美精品三级日韩久久| 美女视频黄 久久| 国精品一区二区| 午夜一区二区三区在线观看| 亚洲综合导航| 国产精品欧美久久| 亚洲一区二区精品在线| 亚洲欧美大片| 国产精品美女久久| 香蕉尹人综合在线观看| 欧美一级欧美一级在线播放| 国产精品久久久久久久久久免费 | 欧美一区二区播放| 国产精品国产三级国产aⅴ无密码| 亚洲裸体在线观看| 一区二区三区国产在线观看| 欧美日韩1区2区| 亚洲视频免费看| 久久成人综合视频| 狠狠色综合网| 欧美成人激情视频| 亚洲精品永久免费| 亚洲欧美日韩另类| 国产亚洲欧美aaaa| 猛男gaygay欧美视频| 亚洲精品免费电影| 午夜精品影院在线观看| 国产日产精品一区二区三区四区的观看方式 | 久久久无码精品亚洲日韩按摩| 久久久久久午夜| 亚洲第一久久影院| 欧美日韩国产区一| 午夜精品福利在线| 欧美寡妇偷汉性猛交| 99在线热播精品免费99热| 国产精品久久久久久久久久免费| 亚洲欧美区自拍先锋| 久久阴道视频| 一区二区欧美激情| 国产欧美丝祙| 久久综合影音| 亚洲天堂男人| 免费久久精品视频| 亚洲视频中文| 狠狠色综合播放一区二区| 欧美黄色大片网站| 午夜精品国产更新| 亚洲破处大片| 久久久久久999| 日韩亚洲精品在线| 国内外成人在线视频| 欧美精品一区二区三区很污很色的| 中国女人久久久| 免费不卡在线视频| 小处雏高清一区二区三区| 亚洲国产cao| 国产日本欧美一区二区三区在线| 欧美成人首页| 久久精品女人| 亚洲欧美日韩在线高清直播| 亚洲国产va精品久久久不卡综合| 欧美一区二区三区视频在线| 一二三区精品| 亚洲日本欧美| 亚洲高清影视| 伊人久久大香线蕉av超碰演员| 国产精品jizz在线观看美国 | 午夜一级在线看亚洲| 亚洲免费av网站| 欧美激情一区二区三区蜜桃视频| 久久精品99国产精品日本| 亚洲私人影院| 在线视频中文亚洲| 一本久道久久综合狠狠爱| 亚洲欧洲偷拍精品| 亚洲国产精品999| 极品少妇一区二区| 狠狠色丁香久久婷婷综合_中| 国产欧美视频在线观看| 国产精品进线69影院| 欧美亚州在线观看| 国产精品成人一区二区三区吃奶| 欧美日韩大陆在线| 欧美日韩一区二区在线观看| 欧美剧在线观看| 欧美国产日韩xxxxx| 欧美激情第4页| 欧美另类高清视频在线| 欧美日韩www| 国产精品99一区二区| 国产精品欧美风情| 国产精品永久入口久久久| 国产精品一区久久久久| 国产偷自视频区视频一区二区| 国产日韩精品入口| 国产综合精品| 伊人久久大香线蕉综合热线| 影音先锋日韩资源| 亚洲精品视频免费| 亚洲图片欧洲图片日韩av| 性8sex亚洲区入口| 久久国产免费| 免费视频最近日韩| 亚洲欧洲日韩在线| 亚洲五月婷婷| 久久黄色级2电影| 欧美xart系列高清| 欧美午夜电影完整版| 国产欧美日韩另类一区| 在线日韩一区二区| 一本久道综合久久精品| 香蕉久久精品日日躁夜夜躁| 久久香蕉国产线看观看av| 亚洲国产日韩欧美在线99| 日韩网站在线看片你懂的| 亚洲女同同性videoxma| 老司机午夜精品视频在线观看| 欧美国产欧美亚洲国产日韩mv天天看完整 | 亚洲图片你懂的| 久久激情中文| 欧美日韩国产91| 国产一区二区按摩在线观看| 亚洲激情视频在线播放| 香蕉亚洲视频| 亚洲国产精品久久人人爱蜜臀 | 亚洲国产精品一区二区www| 在线一区二区三区四区| 久久久久成人精品| 欧美天堂在线观看| 亚洲电影免费观看高清完整版| 夜夜嗨av一区二区三区免费区| 久久久www免费人成黑人精品 | 久久精品免费电影| 亚洲黄色影院| 欧美中文在线观看国产| 欧美日韩精品不卡| 亚洲成色www久久网站| 先锋影音国产精品| 亚洲精品在线免费观看视频| 久久精品国产亚洲aⅴ|