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

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一区二区三区| 亚洲视频精选| 亚洲片国产一区一级在线观看| 久久综合色综合88| 亚洲激情在线激情| 亚洲日本一区二区| 欧美性jizz18性欧美| 欧美一区二区大片| 久久精品色图| 亚洲欧洲在线免费| 99riav1国产精品视频| 国产精品久久久久国产精品日日| 欧美一区三区二区在线观看| 欧美一区视频| 亚洲精品国产系列| 一本久道久久久| 国产亚洲福利| 亚洲国产91| 国产精品久久久久9999| 麻豆国产精品777777在线| 欧美精品在线免费播放| 亚洲自拍偷拍麻豆| 久久视频在线免费观看| 中日韩午夜理伦电影免费| 先锋资源久久| 亚洲狠狠婷婷| 亚洲欧美日韩精品久久亚洲区| 亚洲第一精品影视| 亚洲欧美久久久| 亚洲人体影院| 午夜精品剧场| 一区二区不卡在线视频 午夜欧美不卡'| 亚洲午夜精品久久久久久app| 亚洲第一综合天堂另类专| 99精品国产一区二区青青牛奶| 国产一区导航| 亚洲视频欧美视频| 亚洲福利av| 欧美一区二区三区男人的天堂| 亚洲精品一区二区网址| 欧美淫片网站| 午夜精品久久久久99热蜜桃导演| 久久综合久久综合这里只有精品| 欧美一区二区三区四区在线观看| 欧美成人免费观看| 免费h精品视频在线播放| 国产精品网站一区| 亚洲精品国产精品国自产在线| 国产曰批免费观看久久久| 一区二区日韩精品| a4yy欧美一区二区三区| 美日韩丰满少妇在线观看| 久久精品首页| 国产美女精品人人做人人爽| 99天天综合性| 在线视频亚洲| 欧美美女福利视频| 亚洲国产免费看| 亚洲电影一级黄| 久久久另类综合| 免费观看久久久4p| 国产一区激情| 性色一区二区三区| 久久精品国产免费观看| 国产麻豆午夜三级精品| 亚洲欧美美女| 久久精品日韩欧美| 国内精品久久久久影院 日本资源| 亚洲伊人久久综合| 欧美一级成年大片在线观看| 国产精品一区二区三区乱码| 亚洲一区久久久| 亚欧成人在线| 国产一区二区电影在线观看 | 久久深夜福利免费观看| 国产欧美日韩一区二区三区| 性伦欧美刺激片在线观看| 亚洲免费视频成人| 国产精品免费看| 香蕉久久夜色精品国产使用方法| 久久成人国产| 在线电影国产精品| 毛片精品免费在线观看| 亚洲韩国一区二区三区| 一区二区久久久久| 国产欧美日韩亚洲精品| 久久久另类综合| 亚洲精品亚洲人成人网| 午夜精品99久久免费| 国产一区二区三区最好精华液| 久久人人97超碰精品888| 亚洲欧洲综合另类| 欧美影院精品一区| 亚洲国产精品视频| 欧美午夜视频| 久久久精品国产一区二区三区 | 91久久精品久久国产性色也91 | 国产在线播放一区二区三区| 久久亚洲色图| 中文成人激情娱乐网| 久久久午夜精品| 99xxxx成人网| 国产曰批免费观看久久久| 蜜臀av国产精品久久久久| 一本不卡影院| 牛人盗摄一区二区三区视频| 亚洲视频碰碰| 在线观看视频一区| 国产精品久久国产三级国电话系列 | 亚洲国产精品va在线看黑人动漫| 国内精品视频一区| 欧美日韩国产影院| 久久久久国色av免费观看性色| 亚洲人成亚洲人成在线观看图片| 午夜精品国产| 一本色道久久综合亚洲精品小说| 国产一区二区久久久| 欧美日韩精品福利| 久久综合伊人77777麻豆| 亚洲与欧洲av电影| 亚洲人久久久| 欧美国产视频在线观看| 久久成人一区| 亚洲午夜激情| 99一区二区| 亚洲激情婷婷| 激情小说亚洲一区| 国产欧美一区二区三区久久| 欧美日韩视频第一区| 免费观看在线综合色| 久久黄色小说| 欧美一区二视频在线免费观看| 一区二区高清在线| 日韩一级大片在线| 亚洲国内自拍| 亚洲国产成人精品女人久久久| 久久午夜精品| 久久午夜电影| 久久日韩粉嫩一区二区三区| 久久精品国内一区二区三区| 午夜国产不卡在线观看视频| 中文在线资源观看网站视频免费不卡| 亚洲黄色毛片| 亚洲美女视频在线观看| 亚洲国产精品久久久久婷婷老年| 韩国三级电影久久久久久| 国产一区二区日韩精品| 国产亚洲成av人片在线观看桃 | 国产亚洲成av人片在线观看桃 | 欧美日韩在线免费| 欧美日韩国产色视频| 欧美日产国产成人免费图片| 欧美人在线视频| 欧美色区777第一页| 国产精品入口日韩视频大尺度| 国产精品成人播放| 国产精品一区二区在线观看不卡| 国产九区一区在线| 国产在线成人| 亚洲国产精品一区二区第一页| 亚洲人成人99网站| 亚洲欧洲日本一区二区三区| 99精品国产一区二区青青牛奶| 亚洲特黄一级片| 午夜亚洲视频| 久久久噜噜噜久久中文字幕色伊伊| 久久男人资源视频| 欧美激情aⅴ一区二区三区| 亚洲人www| 亚洲一区二区三区免费视频| 久久精品免视看| 欧美激情一区二区三区蜜桃视频 | 欧美黄在线观看| 国产精品黄色在线观看| 国产在线观看精品一区二区三区| 亚洲国产精品一区二区www在线| 99精品国产热久久91蜜凸| 香蕉国产精品偷在线观看不卡| 猫咪成人在线观看| 日韩视频免费| 久久精品在线观看| 欧美日韩一区二区精品| 国产一在线精品一区在线观看| 亚洲精品乱码久久久久久黑人 | 亚洲一区二区三区777| 久久精品夜色噜噜亚洲a∨ | 亚洲欧美99| 免费国产一区二区| 一道本一区二区| 久久一区视频| 国产精品尤物福利片在线观看| 亚洲国产一二三| 久久9热精品视频| 亚洲精品乱码视频| 久久琪琪电影院| 国产欧美一区二区精品仙草咪 | 亚洲高清自拍| 欧美在线亚洲一区| 日韩视频在线观看一区二区|