Automount configuration in /etc/fstab

Write something like this to automatically mount system drive:

/dev/sda1    /media/win-c    ntfs-3g
auto,rw,suid,exec,async,users,locale=zh_CN.UTF-8 0 0

The windows NTFS drive cannot be displayed in “df” command. It should be displayed by using “sudo fdisk -l /dev/sda” command.

13/7/7 AM 09:51:39 The disk path such as /dev/sda1 had better be written as the UUID of that partition, for example,

UUID=A8B06D66B06D3C46       /media/win-c
ntfs-3g auto,rw,suid,exec,async,users,locale=zh_CN.UTF-8 0 0    

All the UUID can be listed by using ls -l /dev/disk/by-uuid/:

total 0
lrwxrwxrwx 1 root root 10 Jul  7 08:50 a34b828f-fded-4ac7-ae9b-b6d722a53479 -> ../../dm-2
lrwxrwxrwx 1 root root 10 Jul  7 08:50 A8B06D66B06D3C46 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul  7 08:50 bbbdc7a4-e27d-4fd4-815a-318685b3bf70 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Jul  7  2013 c70d26b7-413c-46ff-8e80-ccead0d43965 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Jul  7 08:50 DED06369D06346BD -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul  7  2013 f55427a0-a3c7-48c1-9ebf-8b2570ed4413 -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  7 08:50 FE4474AF44746C71 -> ../../sdb1 

The meaning for various options are as follows:

  • ntfs-3g:
  • auto/noauto: auto mount at boot
  • user/nouser: allow any user to manually mount the partition. By default, only super user is allowed to do this. However, if a user mounts a partition, he himself should unmount it.
  • users: if this option is used instead of user, then a user mounts a partition, another user can unmount it. In the manual of mount, it reads:

    users Allow every user to mount and unmount the filesystem. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid).

    From this, we can also see that the order of the options are important.

  • ro: mount the drive as read-only
  • rw: mount the drive as read and write
  • uid, gid: mount as a certain user and group.
  • umask/fmask/dmask: umask is used to mask the permission bits of files and folders. fmask only masks files, while dmask only masks folders.

From the manual of mount:

Mount options for ntfs
       iocharset=name
              Character set to use when returning file names.  Unlike VFAT, NTFS suppresses names that contain unconvertible characters. Deprecated. 

       nls=name
              New name for the option earlier called iocharset. 

       utf8   Use UTF-8 for converting file names. 

       uni_xlate={0|1|2}
              For  0  (or  `no‘ or `false‘), do not use escape sequences for unknown Unicode characters.  For 1 (or `yes‘ or `true‘) or 2, use vfat-style
              4-byte escape sequences starting with ":". Here 2 give a little-endian encoding and 1 a byteswapped bigendian encoding. 

       posix=[0|1]
              If enabled (posix=1), the filesystem distinguishes between upper and lower case. The 8.3 alias names are presented as hard links instead of
              being suppressed. This option is obsolete. 

       uid=value, gid=value and umask=value
              Set the file permission on the filesystem.  The umask value is given in octal.  By default, the files are owned by root and not readable by
              somebody else. 

About ntfs-3g:

ntfs-3g is an NTFS driver, which can create, remove, rename, move files, directories, hard links, and streams; it can read and write files, including streams and sparse files; it can handle special files like symbolic links, devices, and FIFOs; moreover it can also read and create transparently compressed files.

It can be written in a /etc/fstab entry like the above. According to its manual, it has its own options. Finally, the ntfs related fstab entries on my computer are:

UUID=A8B06D66B06D3C46       /media/win-c    ntfs-3g auto,rw,suid,nouser,uid=1000,gid=1002,umask=002,noexec,async,locale=zh_CN.UTF-8 0 0
UUID=FE4474AF44746C71       /media/win-d    ntfs-3g auto,rw,suid,nouser,uid=1000,gid=1002,umask=002,noexec,async,locale=zh_CN.UTF-8 0 0

Automount configuration in /etc/fstab,布布扣,bubuko.com

时间: 2024-10-27 06:43:11

Automount configuration in /etc/fstab的相关文章

funtoo 安装手册阅读 (博客第 100 篇文章纪念)

*/--> pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;}

磁盘自动分区

#!/bin/bash##########################################Function:    auto fdisk#Usage:       bash auto_fdisk.sh#Author:      Customer service department#Company:     Alibaba Cloud Computing#Version:     2.0######################################### count

自动分区、格式化、挂载脚本

功能:自动检测是否有尚未分区的数据盘,格式化新的数据盘并自动挂载 解决了什么问题:一键式检测是否有尚未分区的数据盘,并能对其格式化和自动挂载,省去了复杂的命令和步骤 执行方法:以root身份执行命令 wget http://mirrors.linuxeye.com/scripts/auto_fdisk.sh chmod +x auto_fdisk.sh ./auto_fdisk.sh 结果:出现如下即自动分区.格式化.挂载成功: 脚本内容如下: #!/bin/bash # Author: yeh

ubuntu开机出现waiting for network configuration

ubuntu启动时,出现waiting for network configuration,waiting up to 60 more seconds for network configuration等,进入桌面后网络图标也不见了 解决方法,首先在 /etc/network/interfaces 文件里面无关的都删去,留下lo这个 然后再到/etc/init/failsafe.conf文件里将sleep59改成5或10,sleep50意思是等待59秒

出现unmapped spring configuration files found

intell idea启动出现unmapped spring configuration files found提示. 把spring里面的内容都打勾.

Check if a configuration profile is installed on iOS

Configuration profiles can be downloaded to an iOS device through Safari to configure the device in a certain way. You can do things like force the user to set a passcode or set restrictions like not allowing them to install apps or not allowing acce

Apache Commons Configuration之一简介

1    简介 Commons Configuration软件类库提供通用配置接口,使Java应用程序从多种源读取配置文件.Commons Configuration提供简单类型访问和通过以下代码演示的多义配置参数: Double double = config.getDouble("number"); Integer integer = config.getInteger("number"); 配置参数可以从以下源加载: Properties文件 XML文档 Pr

System Center 2012 R2 CM系列之配置configuration manager防火墙设置

为了能够正常推送Configuration Manager 2012 R2客户端,必须添加防火墙例外设置,主要包括以下两个:A:文件和打印共享:B: Windows Management Instrumentation (WMI) 1. 打开并登录"BJ-DC-01"服务器,点击工具,打开组策略管理器 2. 右键相关域,点击创建"在这个域中创建GPO并在此处链接" 3. 新建GPO对话框中输入相应的GPO名称 4. 右键新创建的PGO,点击编辑,并打开组策略管理编辑

【CentOS】fstab挂载项错误,无法正常启动系统的解决方法

因/etc/fstab的配置错误,导致重启系统时,无法正常进入系统,会卡在以下的页面. 提示的错误信息类似: An   error   occurred  during   the  file   system   check. 解决方法: 1.在错误的启动界面处输入root的密码(不会有显示的,只管输入正确的密码即可) 2.然后会出现(Repair  filesystem)1#的提示符,在其后面输入运行:mount  -no  remount,rw   / 3.编辑/etc/fstab的文件,