-1
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 3999.7 GB, 3999688294400 bytes
255 heads, 63 sectors/track, 486267 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.
/dev/sda2               1        2090    16785120   82  Linux swap / Solaris
/dev/sda3               1      218918  1758456029+  8e  Linux LVM

Partition table entries are not in disk order

Above is my "fdisk -l", my current problem is when I go and try to do "pvcreate /dev/sda2" it gives me "Can't open /dev/sda2 exclusively. Mounted filesystem?" and I have been searching google for a while now trying to find a way to fix this. There is defiantly things I tried from google but none of them ended up working.

David
  • 2,987
  • 1
  • 29
  • 35
Emma Skye
  • 23
  • 1
  • 1
  • 4
  • Consider looking for advice on [Unix & Linux](http://unix.stackexchange.com) – drs Jul 11 '14 at 12:25
  • The correct question (unlike incorrect partition in this question) with solution is here: https://stackoverflow.com/q/10889433/7869636 – Ashark Oct 20 '20 at 16:58

3 Answers3

1

You're trying to initialize a partition for use by LVM that's currently used by swap.

You should rather run

pvcreate /dev/sda3
David
  • 2,987
  • 1
  • 29
  • 35
0

i updated to the new Kernel and the problem was resolved in RHEL 6 . Had upgraded from 2.6.32-131.x to 2.6.32-431.x

0

Check those disks/partition you are using, are not mounted to any directory on your system.

If yes, umount them and try again.