[Linux]Ubuntu下正确挂载NTFS磁盘的方法

1. 查看当前用户id和组id,记下uid和gid

scue@Link:~$ id
uid=1000(scue) gid=1000(scue) 组=1000(scue),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare),125(vboxusers),1001(usbfs)

2. 查看当前磁盘的UUID和分区表信息,记下需要挂载的"Study"和"Enjoy"分区的UUID值

scue@Link:~$ sudo blkid
[sudo] password for scue: 
/dev/sda1: LABEL="Win7" UUID="EA1C02691C0230DD" TYPE="ntfs" 
/dev/sda2: LABEL="Ubuntu" UUID="4794e078-23dc-4e51-b248-3129a446cbfa" TYPE="ext4" 
/dev/sda3: LABEL="XP3" UUID="2A94DA3494DA01ED" TYPE="ntfs" 
/dev/sda5: LABEL="Study" UUID="20C5750E61E16D51" TYPE="ntfs" 
/dev/sda6: LABEL="Swap" UUID="0ae1b4b2-7295-4839-a7c7-772dc0dc863b" TYPE="swap" 
/dev/sda7: LABEL="Deepin" UUID="461c5230-b9ac-45ab-adbf-3823c9c3dda2" TYPE="ext4" 
/dev/sda8: LABEL="Storage" UUID="4B8660A12AC75B45" TYPE="ntfs" 
/dev/sda9: LABEL="Source" UUID="0988bb9d-02ad-4290-9f60-7954605a8115" TYPE="ext4" 
/dev/sda10: LABEL="Enjoy" UUID="0E5E668D4576BBEE" TYPE="ntfs" 

3. 打开/etc/fstab,并编辑(不熟悉VIM的可以使用gedit)

sudo vim /etc/fstab

# NTFS 在文本的最下方加入以下信息

#Entry "Study" for /dev/sda5 :
UUID="20C5750E61E16D51"     /media/Study    ntfs-3g defaults,locale=zh_CN.UTF-8,gid=1000,uid=1000,umask=002 0   0

#Entry "Enjoy" for /dev/sda7 :
UUID="0E5E668D4576BBEE"     /media/Enjoy    ntfs-3g defaults,locale=zh_CN.UTF-8,gid=1000,uid=1000,umask=002 0   0

# UUID由blkid命令显示得出,根据你的硬盘分区而定; # uid
=1000表示以scue用户挂载,根据你的id命令显示结果而定; # gid=1000表示以scue群组挂载,根据你的id命令显示结果而定
# umask
=002表示其他用户没有写入权限,相当于以775权限挂载分区;
posted @ 2012-10-28 21:35  scue  阅读(7508)  评论(0编辑  收藏  举报