Change in UUID while upgrade

本文详细介绍了从RHEL5.3升级到RHEL6过程中遇到的UUID变化问题,特别是在fstab文件中对磁盘分区的引用。提供了两种解决方案:一是使用LABEL代替UUID进行引用;二是通过kickstart脚本保存并恢复UUID。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值