免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1031 | 回复: 0
打印 上一主题 下一主题

fstab with UUID [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-03 19:11 |只看该作者 |倒序浏览

When linux system starts, auto mounting partition will be done by
refering to /etc/fstab. The file /etc/fstab will list down how you like
the system to mount your partition. For examples,
#               
   /dev/sda1      /media/sda1     vfat    default,umask=077,gid=46  0       0
/dev/sda1 is the device, the number will be change depend on the
order of your hard disk that inject to your motherboard. /media/sda1 is
the mount point, where the place you access the data of your disk
storage. vfat is the file system’s type. Next is the list of mount
options, carry on is dump and pass option.
Mount with device path has problems when you have multiple hard
disk, and the order of hard disk changed may cause the file system
failed to mount. Therefore later days of fstab entries has been
modified to identify by uuid,
UUID=4706-0137      /media/sda1     vfat    defaults,umask=007,gid=46         0       0
UUID stands for Universally Unique Identifier, it gives each
filesystem a unique identifier. With uuid, you no need to worry about
the reordering of hard disk anymore.
So how to check the device’s uuid?
You can find all detected device by uuid with ls
ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 4706-0137 -> ../../sda1
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 497c771b-63fe-461f-ad7d-0bef9a6ba718 -> ../../sda5
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 ce7b6c5d-c66a-4fc8-9638-72f62820f422 -> ../../sda3
Or if you wanna check on more details on the device,
sudo vol_id /dev/sda1
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT32
ID_FS_UUID=4706-0137
ID_FS_LABEL=
ID_FS_LABEL_SAFE=
or this
blkid /dev/sda1
/dev/sda1: UUID="4706-0137" TYPE="vfat"
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12467/showart_1072233.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP