- 论坛徽章:
- 0
|
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 |
|