MacOS – Problem when extending windows partition using Disk Utility

disk-utilitymacospartition

I tried to partitioning the macOS partition to have some space to extend the Windows partition using Windows OS. When trying to switch back to Windows OS, I could not find it. Even when restarting and pressing down the Option key. I found a thread with the same problem and its solution. But when trying the solution, I had a problem. The solution was entering this code in the terminal in recovery mode:

fdisk -e /dev/disk0s4
p
setpid 4
[press enter]
flag 4
p
write
y

disk0s4 is the partition with the windows on It.

But when trying to type the first line, I received an error saying "Resource is busy".

My software is MacOS High Sierra.

If there is any help, I would be grateful.

Notes:
The link of the thread is Mac won't boot Windows partition after using disk utility.
Mac version is Macbook mid 2010.
And the Windows is Windows 7.
This was the output when executing the command diskutil list disk0 in the terminal:

/dev/disk0 (internal, physical):
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *250.1 GB   disk0
1:                        EFI EFI                     209.7 MB   disk0s1
2:                  Apple_HFS macOS                   124.0 GB   disk0s2
3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
4:       Microsoft Basic Data Windows OS              125.2 GB   disk0s4

And the output from fdisk /dev/disk0 is

Disk: /dev/disk0    geometry: 30401/255/63 [488397168 sectors]
Signature: 0xAA55
     Starting       Ending
#: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
1: EE 1023 254  63 - 1023 254  63 [         1 -  488397167] <Unknown ID>
2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
4: 00    0   0   0 -    0   0   0 [         0 -          0] unused 

Below is the output from diskutil info disk0s4.

Device Identifier: disk0s4 
Device Node: /dev/disk0s4 
Whole: No 
Part of Whole: disk0 

Volume Name: Windows OS 
Mounted: Yes 
Mount Point: /Volumes/Windows OS 

Partition Type: Microsoft Basic Data 
File System Personality: NTFS 
Type (Bundle): ntfs 
Name (User Visible): Windows NT File System (NTFS) 

OS Can Be Installed: No 
Media Type: Generic 
Protocol: SATA 
SMART Status: Verified 
Volume UUID: FA34FC24-AD79-47B7-BF7F-20928229DB81 
Disk / Partition UUID: B94B94F6-3041-44DB-AFD6-37465DCC16B1 
Partition Offset: 124860235776 Bytes (243867648 512-Byte-Device-Blocks) 

Disk Size: 125.2 GB (125197877248 Bytes) (exactly 244527104 512-Byte-Units) 
Device Block Size: 512 Bytes 

Volume Total Space: 125.2 GB (125197873152 Bytes) (exactly 244527096 512-Byte-Units) 
Volume Used Space: 67.1 GB (67050299392 Bytes) (exactly 130957616 512-Byte-Units) (53.6%) 
Volume Free Space: 58.1 GB (58147573760 Bytes) (exactly 113569480 512-Byte-Units) (46.4%) 
Allocation Block Size: 4096 Bytes 

Read-Only Media: No 
Read-Only Volume: Yes 

Device Location: Internal 
Removable Media: Fixed 

Solid State: No 
Hardware AES Support: No

Best Answer

Use Hard Disk Manager to repair and partition BOOTCAMP.

You can get Hard Disk Manager from here (https://www.paragon-software.com/hdm-mac/#) or here (includes trial reset) (https://nofile.io/f/aWdNwtb3Ry9/Hard.Disk.Manager.v1.3.873.dmg) (link will expire in 24 hrs)

enter image description here