Open janagoudarniroop opened 3 weeks ago
@sudeeshjohn Could you help in this issue.
Locate the disk where the OS is installed and select the partition with type 41
using the fdisk -l <disk>
command. For instance, if you need to identify the PReP Boot partition on a disk image
[root@scnlonprema temp]# losetup -f disk.raw
[root@scnlonprema temp]#
[root@scnlonprema temp]# losetup
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 0 0 /data/OVAs/temp/disk.raw 0 512
/dev/loop0 0 0 1 0 /srv/node/drives/swift.img 0 512
[root@scnlonprema temp]# partprobe /dev/loop1
[root@scnlonprema temp]#
[root@scnlonprema temp]# fdisk -l /dev/loop1
Disk /dev/loop1: 11 GiB, 11811160064 bytes, 23068672 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x14fc63d2
Device Boot Start End Sectors Size Id Type
/dev/loop1p1 * 2048 10239 8192 4M 41 PPC PReP Boot
/dev/loop1p2 10240 23068638 23058399 11G 83 Linux
[root@scnlonprema temp]#
What happened: We are attempting to update and reinstall GRUB2 on a PReP boot partition for our system but need assistance in identifying the correct PReP device. The process involves:
Identifying the correct PReP partition using lsblk or fdisk.
-Updating GRUB2 (dnf update grub2). -Installing GRUB2 on the identified PReP partition (grub2-install /dev/[prep-partition]). -Setting the boot list with bootlist -m normal -o /dev/[prep-partition]. We require guidance on reliably identifying the PReP partition to complete the installation.
Find the PReP partition with /dev/mapper
prep_partition=$(fdisk -l | grep -i ppc | grep -i mapper | awk '{print $1}')
Check if a PReP partition was found
if [ -z "$prep_partition" ]; then echo "No PReP partition found with /dev/mapper." exit 1 else echo "PReP partition found: $prep_partition" fi
Update grub2
echo "Updating grub2..." dnf update -y grub2
Install grub2 on the identified PReP partition
echo "Installing grub2 on $prep_partition..." grub2-install "$prep_partition"
Execute bootlist command
echo "Setting boot list..." bootlist -m normal -o
What you expected to happen:
The pvsadm is not able to pick the correct disk .
How to reproduce it (as minimally and precisely as possible):
This is how the layout looks when we create a power vs server on top of bare-metal server: Last login: Mon Aug 19 01:39:11 on hvc0 [root@localhost ~]# [root@localhost ~]# fdisk -l Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x14fc63d2
Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 10239 8192 4M 41 PPC PReP Boot /dev/sda2 10240 20971519 20961280 10G 83 Linux
and we need to use /dev/sda1 to re-install the grub.
So what should the disk name we need to use in template script when we are trying to build the image using pvsadm tool?
This is the disk layout when we try to print the partitions using these below commands in our template script.
Anything else we need to know?:
Environment:
pvsadm version
): pvsadm version Version: v0.1.15cat /etc/os-release
): [root@build-server-8-8-sap ~]# cat /etc/os-release NAME="Red Hat Enterprise Linux" VERSION="8.8 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.8" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.8 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos" HOME_URL="https://www.redhat.com/" DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8" BUG_REPORT_URL="https://bugzilla.redhat.com/"REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.8 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.8"
[root@build-server-8-8-sap ~]#
uname -a
): [root@build-server-8-8-sap ~]# uname -a Linux build-server-8-8-sap.power-iaas.cloud.ibm.com 4.18.0-477.51.1.el8_8.ppc64le #1 SMP Fri Mar 1 11:20:14 EST 2024 ppc64le ppc64le ppc64le GNU/Linux