Chinaunix首页 | 论坛 | 博客
  • 博客访问: 978350
  • 博文数量: 184
  • 博客积分: 10030
  • 博客等级: 上将
  • 技术积分: 1532
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-27 18:32
文章分类

全部博文(184)

文章存档

2009年(1)

2008年(63)

2007年(39)

2006年(79)

2005年(2)

我的朋友

分类: LINUX

2008-07-03 19:11:18

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/sda1ID_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"
阅读(1712) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~