How to Check Device UUID or File System UUID. (文档 ID 1505398.1) 如何检测设备的UUID或者文件系统的UUID |
In this Document
APPLIES TO:使用版本 Linux OS - Version Oracle Linux 5.0 and later In Linux, sometimes the name of devices or file systems are not persistent which will bring system in trouble, in such situation specify UUID (universally unique identifier) is the solution to identify the only unique component in the system. 在Linux中,有时设备或文件系统的名称不是永久的,这将使系统陷入麻烦,在这种情况下,指定UUID(通用唯一标识符)是识别系统中唯一唯一组件的解决方案。 1. Device uuid In OL5.x: # scsi_id -u -g -s /block/sda In OL6.x: # scsi_id --whitelisted /dev/sdd Or: # udevadm info --query=all --path=/sys/block/sda For multipath devices: # multipath -ll -v 360080e500024a048000004044f3c64ee dm-0 SUN,LCSM100_F Note: the device uuid is fixed value, the uuid of dm-mp device should be identical with the uuid of its paths. In most of situation could not be modified【修改,加减adj,v】 unless the device supports dynamic uuid feature. 注意:设备uuid是固定值,dm-mp设备的uuid应该与其路径的uuid相同。 在大多数情况下不能修改,除非设备支持动态uuid功能。 Usage: The device uuid often being used to persistent the device name or dm-mpath name, following example bind the wwid with name oraasm1 persistently. 设备uuid通常用于持久化设备名称或dm-mpath名称,下面的示例将名称为oraasm1的wwid持久地绑定。 multipath { Note: the partition (such as sda1 sdb1) does not have uuid. 注意:分区(如sda1 sdb1)没有uuid。 2. File system uuid In OL5.x: # blkid /dev/sda1 /dev/sda1: LABEL="/boot1" UUID="ae298adb-1b94-42a0-9dc9-a121c7561a5b" TYPE="ext3" SEC_TYPE="ext2" Note: the /dev/sdxx must be formated as file system. Usage: Could specify uuid in /etc/fstab to bind the device with mount directory persistently. 可以在/ etc / fstab中指定uuid以永久性地将设备与安装目录绑定。 UUID=xxx-xxx-xxx-xxx /mount_dir ext3 defaults 1 2 Note: file system uuid will be changed after re-create file system. 注意:文件系统uuid将在重新创建文件系统后更改。 3. LVM2 uuid # pvs -v Usage: In some case need recover some pv device, use the --uuid and --restorefile arguments of the pvcreate command to restore the physical volume. The following command restores the physical volume label with the backuped metadata. 在某些情况下,需要恢复一些pv设备,请使用pvcreate命令的--uuid和--restorefile参数来恢复物理卷。 以下命令使用备份的元数据恢复物理卷标签。 # pvcreate --uuid "0YnHNn-1COx-dohx-bwPf-aLyl-pO8F-f5PI5R" --restorefile /etc/lvm/archive/vg0_00000-1324010847.vg /dev/sda2 Note: lvm2 uuid will be changed after re-create. |
Lvm2 uuid 将在重建后更改