Change in UUID while upgrade

https://access.redhat.com/solutions/173583

 SOLUTION 已验证 - 已更新 2014年一月3日01:41 - 

English 

环境

  • RHEL 5.3, upgrading to RHEL 6

问题

  • Before upgrade:

  • Entry in /etc/fstab file:

Raw

/dev/sda2: LABEL="/partB" UUID="a69619e1-649a-43e6-85bf-c072f8c39e14" SEC_TYPE="ext2" TYPE="ext3”
  • Output of sudo blkid command:

Raw

/dev/sda2: LABEL="/partB" UUID="a69619e1-649a-43e6-85bf-c072f8c39e14" SEC_TYPE="ext2" TYPE="ext3”
  • During upgrade:

  • Entry in /etc/fstab file:

Raw

/dev/sda2: LABEL="/partB" UUID="a69619e1-649a-43e6-85bf-c072f8c39e14" SEC_TYPE="ext2" TYPE="ext3”
  • Output of sudo blkid command:

Raw

/dev/sda2: LABEL="/partB" UUID="1c9eb856-2976-4f4d-a500-b6f3e1accdc8" SEC_TYPE="ext2" TYPE="ext3"

决议

  • In order to resolve this issue changes for partition /dev/sda2 in /etc/fstab file. Instead of reffering it from UUID we are now referring it by using LABEL(as in RHEL5):

Raw

LABEL=/partB /partB ext4 defaults 1 0
  • After this change upgrade proceeds further.

  • Or

  • To preserve UUID, try using a kickstart %pre script to save the current UUID (using blkid) and then restore it in the kickstart %post script (using tune2fs).

Raw

%pre
blkid -o export /dev/sda2 | grep UUID | sed 's/^UUID=//' > /tmp/sda2-uuid
%end

%post --nochroot
tune2fs -U $(cat /tmp/sda2-uuid) /dev/sda2
%end

根源

  • It was learned that the customer's upgrade process actually does a mkfs which is expected to change the UUID. This is not an Issue but an expected behavior.

诊断步骤

  • Before upgrade:

Raw

# BLKID_DEBUG=0xffff blkid /dev/sda2
  • During upgrade:

Raw

# BLKID_DEBUG=0xffff blkid /dev/sda2
  • It was also understood that during upgrade, mkfs was being run on the partition which
    is expected to generate a new UUID.

猜你喜欢

转载自blog.csdn.net/msdnchina/article/details/89280685
今日推荐