To show how can we recover the partition with no data loss in my example “ /dev/sdb1” partition mounted on “/opt” directory which have bellow information.
To remove the partition first we need to unmount this.
I use “parted” command to remove the partition
After deleting the partition now try to recover it with “parted” partition utility with “rescue” command.
After recover the partition now again try to mount this.
Parted copy partition ( /dev/sdb1 to /dev/sdb2 )
1st unmount the partition /dev/sdb1
Copy partition 1 to 2