分类: 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 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 -> ../../sda1Or if you wanna check on more details on the device,
sudo vol_id /dev/sda1ID_FS_USAGE=filesystemor this
blkid /dev/sda1/dev/sda1: UUID="4706-0137" TYPE="vfat"