I am trying to repair a lost HSF+ partition table an iMac by running the i command inside of sudo pdisk /dev/rdisk1. Once I try running the i command, I get an error message saying that the resource is busy:
pdisk: can't open file '/dev/rdisk1' for writing (Resource busy)

I get the same result when using /dev/disk1, /dev/rdisk2, and /dev/disk2.
I also tried running sudo gpt /dev/(r)disk(1-3). Interestingly enough, the I only get a result from /dev/rdisk3:

So, I try to see what is using the resource by running sudo lsof /dev/rdisk1, as well as sudo lsof /dev/disk1. Nothing shows up:

I've also tried unmounting the device by running sudo umount /dev/disk1 as well as sudo umount /dev/rdisk1. I get a message saying that the device is not currently mounted:

Here's a list of all of the disks connected to the computer, found by running sudo DiskUtil list:

/dev/disk0 - The disk of the computer that the iMac is connected to.
/dev/disk1 - The HDD of the iMac.
/dev/disk2 - The SSD of the iMac.
/dev/disk3 - I don't know what this is. I would assume it is the combined HDD and SSD of the iMac.
/dev/disk4 - An external hard drive.
/dev/disk5 - I have no clue what this is either. Maybe utilities for /dev/disk4?
The iMac has a fusion drive, and /dev/disk1 is the HDD. I've tried with the SSD, /dev/disk2, but I get the same result.
I have the iMac plugged into another computer via thunderbolt, and by holding t when the iMac started up, the Macintosh HD showed up as an external device on the other computer.
How could I get rid of this message? I've tried restarting both the iMac and the computer that it is connected to.