I accidentally run
dd if=image.img of=/dev/sda instead of
/dev/sdb and sda is my main partition. When i realised i misstyped it i immediately stopped the process with CTRL+C, so it run only for like 2 seconds. When i rebooted i couldnt boot to any partition, the UEFI boots on the bios boot menu was empty. I created a live image of the Gparted live and run a
testdisk and it found 4 out of the 6 partitions that i had, the efi partition was on sda2 and now its on sda1, windows part from sda4 to sda2 and linux and linux swap from sda5 and sda6 to sda3 and sda4. Despite that the efi partition still exists with the EFI folder in it and some entries inside when i run
efibootmgr i cant see any entry and when i run manjaro live on UEFI it said that it cant find efi. So what i want to do is to be able to boot to the os's again or at least at windows(because i will reinstall linux and windows have some files that i want). Any help is apreciated, thanks for your time :) !
I accidentally run
Even 2 sec, at least the beginning 300MB of your disk is rewritten. You may not be able to correctly boot into your MS-Windows because you need not only the EFI, but also the MS-Windows boot-manager. What I recommend is while working on some other OS even other computer: download some live Linux (I preffere CAINE) create the boot USB flash disk (or burn the DVD). Start your damaged computer from the CAINE, look for files you need to save and copy them to some other media (do not forget to unlock the target disk for write - the CAINE is very strict).
The more expensive way is to buy a new harddisk to install your Linux on it, and then you can mount some partitions from your corrupted disk under the Linux. For easy working with NTFS (MS-Windows default filesystem) you need to install some Linux utilities like
Under Linux you may mount a partition even the MBR/EFI partition table does not exist. Simply you have to find the begining of the partition (e.g. by looking for NTFS string) and if you know the exact offset form the beginning of the disk you can mount it by:
mount /dev/sdX /mnt/windows -o ro,loop,offset=xxxx
On the other hand, after you successfully install the Linux, you may try to configure the Grub bootloader to identify your original MS-Windows partition and to add it into it's boot list.
First, make an image of what's left and if possible copy that image once more; then you can at least revert to the "bad but not hopeless" situation you've got already.
Then consider what's less effort and most probably that will be to extract your data from partitions not affected and to install the OSes clean (
wipefs -a /dev/sda first).
efibootmgr shows what's stored in NVRAM, see also Rod's book on the topic (my favourite UEFI link :-).