Linux : getting error while executing mkfs

Hi All,
i am getting below error while executing mkfs after creating a new partition in linux

/dev/sda2 is apparently in use by the system ; will not make a filesystem here.

Anyone having any idea , how to solve this problem

thanks

Sure that /dev/sda2 the new partition? Is it mounted?

These commands might give you some insight:

mount | grep sda2
swapon -s | grep sda2
pvs | grep sda2

I bet, the device is in use as swapspace.