ºìÁªLinuxÃÅ»§
Linux°ïÖú
µ±Ç°Î»ÖÃ: ºìÁªLinuxÃÅ»§ > Ubuntu

Ubuntu쵀UUID

·¢²¼Ê±¼ä:2007-10-22 17:20:41À´Ô´:ºìÁª×÷Õß:nguin
UUID£¬È«³ÆUniversally Unique Identifier

ËüÊÇÒ»¸ö128룬16×Ö½ÚµÄÖµ£¬²¢È·±£ÔÚʱ¼äºÍ¿Õ¼äÉÏΨһ¡£Ëü°ÑÓ²¼þµØÖ·¡¢Ê±¼äÒÔ¼°Ëæ»úÊý½áºÏÔÚÒ»ÏÂÆðÀ´È·±£ÆäΨһÐԵġ£Ò»°ãÇé¿öÏ£¬Éú³ÉËã·¨ÓüÆËã»úÍø¿¨µÄµØÖ·ºÍÒ»¸ö60λµÄtimestampÉú³É£¬Ê±¼äÊÇÒÔ100nsΪʱ¼ä¼ä¸ô¡£ÀýÈ磬һ̨300PL 6862µÄ¼ÆËã»ú£¬Ö÷°å¼¯³ÉµÄÍø¿¨µÄMACµØַΪ00-04-AC-2E-B7-DC£¬¶øUUIDµÄ×îºóÁù¸ö×Ö½ÚÒ²»áÊÇ0004AC2EB7DC¡£

UbuntuÏÖÔÚĬÈÏʹÓÃUUIDÖµ±íʾӲÅÌ·ÖÇø£¬ÔÚ/etc/fstabÖÐÎÒÃǺÜÈÝÒ׿´µ½£º

# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
# /dev/hda1
UUID=6286feb3-3037-4893-b0f1-8c9edba3c447 / ext3 defaults,errors=remount-ro 0 1
# /dev/hda5
UUID=45bdb727-57db-46c2-8b33-e2dc813c0e18 /media/mydoc ext3 defaults 0 2
# /dev/hda7
UUID=1bfc17a2-b39c-451b-8ce8-2b3bc13bf6e8 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0

ÔÚGRUBÆô¶¯ÏîÖÐÒ²ÓÐÕâÑùµÄ±íʾ
kernel /boot/vmlinuz-2.6.20-14-generic root=UUID=6286feb3-3037-4893-b0f1-8c9edba3c447 ro
quiet splash locale=zh_CN

ÓëÒÔǰʹÓÃhda*Ïà±È£¬Ê¹ÓÃUUIDµÄºÃ´¦ÊÇÖ»Òª·ÖÇø´óСûÓе÷Õû£¬ËüµÄUUIDÖµ¾ÍÊǹ̶¨µÄ£¬Ò²¾ÍÊÇ˵£¬¼´Ê¹°ÑÆäËû·ÖÇøȫɾµô£¬Ò²²»Ó°ÏìÕâÒ»·ÖÇøµÄ¹ÒÔØ¡£

ÄÇô£¬Èç¹û·ÖÇø¸Ä±äÁËÔõô°ì£¿ÓÐʱºîÐèÒªµ÷Õû·ÖÇø´óС£¬ÕâÑùËüµÄUUIDÖµÒ²¾Í·¢ÉúÁ˱仯£¬´ËʱÐèÒªÔÚ/etc/fstabÖн«¸Ã·ÖÇøµÄUUIDÖµÐÞ¸ÄΪµ±Ç°Öµ£¬·ñÔòÎÞ·¨×Ô¶¯¹ÒÔØ¡£

²éѯ·ÖÇøUUIDÖµ¿ÉÒÔʹÓÃÏÂÃæµÄÃüÁ
ls -al /dev/disk/by-uuid

½á¹ûÊÇÈçϵÄÐÎʽ£º

×ÜÓÃÁ¿ 0

drwxr-xr-x 2 root root 100 2007-04-06 20:09 .
drwxr-xr-x 5 root root 100 2007-04-06 20:09 ..
lrwxrwxrwx 1 root root 10 2007-04-06 20:09 1bfc17a2-b39c-451b-8ce8-2b3bc13bf6e8 -> ../../sda6
lrwxrwxrwx 1 root root 10 2007-04-06 20:09 6286feb3-3037-4893-b0f1-8c9edba3c447 -> ../../sda1
lrwxrwxrwx 1 root root 10 2007-04-06 20:09 8c6640b5-9c65-44d7-8f09-771b8c589922 -> ../../sda5

ÕâÊÇÎÒµÄÓ²ÅÌ·ÖÇøµÄUUID£¬¿É¼û£¬sda5µ÷Õû´óСºó£¬UUID·¢ÉúÁ˱仯£¬½«fstabÖжÔÓ¦µÄ²¿·Ö¸Ãµô£¬OK¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ