System Administration
Showing results for 
Search instead for 
Did you mean: 

pvcreate issue using mondorestore

Go to solution
Super Advisor

pvcreate issue using mondorestore

I had to replace my system disk and am trying to use mondorestore to recover the disk...

I've gone into interactive mode using mondorestore and partitioned the new hard drive:
# fdisk -l /dev/sda

Disk /dev/sda: 292.3 GB, 292326211584 bytes
255 heads, 63 sectors/track, 35539 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 33 265041 83 Linux
/dev/sda2 34 35539 285201945 8e Linux LVM

when I then try to use pvcreate on the /dev/sda2 partition I get the following:

# lvm pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?

Anyone know why I would be getting this??
Honored Contributor

Re: pvcreate issue using mondorestore

Does "cat /proc/partitions" indicate that the kernel has recognized the existence of /dev/sda2?

If you've just created the partition(s), you may have to do something to make the kernel to reload the partition table of that disk. Fdisk accesses the disk directly, so it will always see the partition table that is currently on the disk. But the kernel needs to be told that changes have been made. Some kernel versions won't reread the partition table if the disk currently has partitions mounted.

RHEL 5 includes the "partprobe" command, and also the regular version of "fdisk" will automatically issue the appropriate system calls to make the kernel reread the partition table. If the system call is not successful, fdisk will typically tell you about it. But I don't know what versions of fdisk and other tools are available in the mondorestore environment...

Super Advisor

Re: pvcreate issue using mondorestore

Thanks, found issue with multipath...

When I issued: multipath -F it allowed me to do the pvcreate