Background
I have added a second hard disk (500GB) to this RHEL VM. And then format, created volume group (storerhel2) and logical volume (store) for it. I then mounted it to a newly created directory (/newStore). It showed as under sdb. Everything worked fine.
lsblk -f
sdb
└─sdb1 LVM2_member tcsmci-DJhs-19V8-UrKR-SOkI-hE1L-TuCqg3
└─storerhel2-store xfs eec69c87-8dd5-46c1-b402-1efe67d0489b /newStore
dmesg | grep sg | grep -i attached
[ 29.711244] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 29.711471] sd 0:0:1:0: Attached scsi generic sg1 type 0
[ 29.711731] sr 3:0:0:0: Attached scsi generic sg2 type 5
I have then unmounted the disk from the VM, removed the hard disk on ESXi. After that, I re-added it back to the VM. But this time, it showed that the hard disk was under sdc instead of sdb. Also, the volume group was not recognized.
lsblk -f
sdc
└─sdc1 LVM2_member tcsmci-DJhs-19V8-UrKR-SOkI-hE1L-TuCqg3
dmesg | grep sg | grep -i attached
[ 29.711244] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 29.711471] sd 0:0:1:0: Attached scsi generic sg1 type 0
[ 29.711731] sr 3:0:0:0: Attached scsi generic sg2 type 5
[ 675.053285] sd 0:0:1:0: Attached scsi generic sg1 type 0
When I tried to mount it again to the original directory, it showed error.
mount /dev/mapper/storerhel2-store /newStore
mount: /dev/mapper/storerhel2-store: can't read superblock
However, when I rebooted it, the hard disk was successfully mounted again as it was written in fstab.
cat /etc/fstab
/dev/mapper/storerhel2-store /newStore xfs inode64,logbsize=256k,noatime,nobarrier 0 0
Question
How do I mount the hard disk again without rebooting the VM? I have tried identifying the scsi devices to rescan the disks (see the links below), same error. Has anyone ever come across the situation?
Please share your knowledge! Thank you!
Reference
https://kerneltalks.com/disk-management/how-to-rescan-disk-in-linux-after-extending-vmware-disk/