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

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久久久久久老狼 | 午夜视频一区| 国产精品久久久久久久电影| 亚洲人体一区| 亚洲国产一区在线观看| 久久一区二区精品| 有码中文亚洲精品| 午夜一区不卡| 亚洲免费网址| 国产婷婷97碰碰久久人人蜜臀| 亚洲一区二区三区高清 | 狼人社综合社区| 欧美亚洲免费| 韩国av一区二区三区四区| 麻豆精品在线视频| 美女任你摸久久| 中国女人久久久| 亚洲性感激情| 激情欧美一区| 亚洲国产黄色| 欧美私人网站| 午夜精品一区二区三区电影天堂 | 久久国产天堂福利天堂| 国内精品一区二区| 欧美激情一区二区久久久| 欧美久久精品午夜青青大伊人| 亚洲性av在线| 久久综合久久综合这里只有精品| 91久久精品一区| 亚洲性视频h| 亚洲伦理网站| 久久久久久久久综合| 一区二区国产日产| 欧美中文字幕在线| 亚洲视频精品在线| 美女主播一区| 久久久久成人网| 欧美深夜福利| 久久精品一区四区| 欧美午夜激情在线| 免费观看久久久4p| 国产区精品视频| 亚洲社区在线观看| 欧美国产视频一区二区| 国产免费观看久久黄| 亚洲精品偷拍| 日韩视频中文| 欧美成人精品在线| 欧美国产综合视频| 在线看国产一区| 狂野欧美性猛交xxxx巴西| 久久av一区二区| 国产欧美日韩不卡免费| 亚洲网站在线| 久久久亚洲精品一区二区三区| 国产精品久久久久毛片大屁完整版 | 亚洲国产精品久久久久婷婷884| 国产欧美69| 欧美专区福利在线| 久久性天堂网| 最新国产の精品合集bt伙计| 蜜臀91精品一区二区三区| 欧美日本国产在线| 久久99在线观看| 国产一区在线免费观看| 欧美一区2区三区4区公司二百| 亚洲欧美三级在线| 国产亚洲一区在线| 久久躁狠狠躁夜夜爽| 亚洲第一在线| 亚洲三级性片| 国产精品乱码妇女bbbb| 午夜精品电影| 亚洲国产婷婷香蕉久久久久久99 | 久久影音先锋| 日韩香蕉视频| 激情成人av| 欧美日韩三区四区| 久久久久**毛片大全| 亚洲精品国产无天堂网2021| 欧美在线视频免费播放| 亚洲欧洲在线播放| 国产精品嫩草99a| 亚洲一区美女视频在线观看免费| 午夜精品久久久久久 | 91久久线看在观草草青青| 国产综合第一页| 一区二区国产日产| 免费不卡视频| 久久精品99无色码中文字幕| 亚洲免费不卡| 亚洲成人原创| 国产亚洲精品久久飘花 | 亚洲一区二区精品在线| 亚洲精品影院在线观看| 欧美成人免费全部| 久久人91精品久久久久久不卡| 一区二区三区国产在线| 亚洲精品视频二区| 亚洲电影一级黄| 伊人狠狠色丁香综合尤物| 国产精品丝袜久久久久久app| 久久久999精品免费| 亚洲欧美日本伦理| 午夜精品久久久久久久| 欧美日本一区二区三区 | 久久久久久久高潮| 久久资源av| 欧美+亚洲+精品+三区| 免费成人小视频| 欧美一级二区| 亚洲欧美自拍偷拍| 久久久精彩视频| 久久午夜精品一区二区| 免费观看在线综合| 亚洲电影在线免费观看| 亚洲精华国产欧美| 亚洲视频久久| 久久综合久色欧美综合狠狠| 久久资源在线| 欧美系列电影免费观看| 国产色综合网| 99综合在线| 久久久成人网| 一片黄亚洲嫩模| 久久久青草青青国产亚洲免观| 欧美激情二区三区| 欧美三区在线视频| 精久久久久久| 久久午夜精品| 99一区二区| 久久一区二区精品| 国产精品亚洲а∨天堂免在线| 悠悠资源网亚洲青| 午夜精品一区二区在线观看| 欧美激情一二三区| 欧美亚洲一区| 国产精品美女午夜av| 亚洲人成亚洲人成在线观看| 久久久久国产精品人| 一本久道久久综合中文字幕| 麻豆成人在线观看| 国产一区二区三区久久久久久久久 | 欧美一级二级三级蜜桃| 亚洲激情av| 美日韩丰满少妇在线观看| 国产精品人人爽人人做我的可爱| 91久久在线播放| 欧美大尺度在线| 久久久久综合| 亚洲国产清纯| 亚洲国产乱码最新视频| 久久天天狠狠| 亚洲国产免费| 另类专区欧美制服同性| 国产在线麻豆精品观看| 欧美在线视频免费观看| 亚洲尤物在线视频观看| 国产亚洲成精品久久| 午夜精品视频| 久久精品国产第一区二区三区最新章节| 国产精品久久久一区麻豆最新章节| 中日韩男男gay无套| 亚洲少妇在线| 激情久久婷婷| 亚洲国产欧美在线| 国产精品久久久久77777| 欧美一级大片在线观看| 免费看亚洲片| 亚洲精品一区二区三区婷婷月| 亚洲精品在线二区| 国产欧美日韩一区二区三区在线| 欧美在线视屏| 欧美高清视频免费观看| 亚洲欧美日韩综合一区| 久久久久久久久蜜桃| 夜夜嗨av一区二区三区网站四季av| 亚洲视频电影在线| 红桃视频一区| 亚洲一卡二卡三卡四卡五卡| 韩国三级电影一区二区| 日韩视频亚洲视频| 激情欧美日韩一区| 亚洲精品中文字幕在线| 麻豆精品在线观看| 欧美午夜视频在线| 欧美激情亚洲激情| 狠狠色狠狠色综合日日小说| 久久综合网络一区二区| 国产精品第一页第二页第三页| 欧美国产亚洲精品久久久8v| 国产午夜精品全部视频播放| 亚洲综合精品四区| 91久久久久久| 免费观看成人www动漫视频| 午夜一区二区三视频在线观看| 欧美精品福利在线| 亚洲国产一区二区三区在线播 |