3

I was installing Arch Linux in a hard drive, separate from the hard drive I have Windows installed on.

While creating and mounting my partitions, I ran the command: swapon /dev/sda2 instead of sdb2. sda2 is my Windows EFI partition and sdb2 was my swap partition for Linux.

I don't remember if I originally did mkswap /dev/sda2, but I have since ran the command mkfs.fat -fat32 /dev/sda2, but that didn't fix it.

I basically need to mount this partition; however I can only boot into my Arch Linux installation from my flash drive. Am I completely screwed?

4
  • I'm sure someone can quickly summarize this up on a scale of 1 to Reinstall for you! ;) Commented May 20, 2014 at 4:35
  • Ugh I hope its a 1. I purposely installed arch on another hard drive instead of dual boot so I wouldn't ruin my windows partition on accident lol Commented May 20, 2014 at 4:37
  • I guess if you have enough RAM, it never swapped, so only the partition header will be broken. Testdisk will help you. Commented May 20, 2014 at 4:51
  • testdisk will be useful in this regard. Running mkfs just destroyed a lot of the structures, so at this point it's a salvage operation. Also, was it actually FAT and not NTFS? If so, more damage. Commented May 22, 2014 at 1:00

1 Answer 1

0

You'll need to convert the partition back to FAT by using GParted, mkdosfs, or some similar tool, and also ensure that it's marked correctly as an ESP with GParted, parted, gdisk, or some other tool.

Once that's done, you'll need to restore its files. If you backed them up, then restoring the backup will fix the problem. If not, you'll need to obtain a Windows recovery disc and run its recovery tools to restore the Windows boot loader. I'm afraid I'm not an expert on this, so I can't tell you precisely what to do -- but be aware that you're booting in EFI mode, and older advice you might find on the net is likely to be BIOS-specific, so don't follow any advice you find on this score unless it specifically states that it's for restoring EFI-mode Windows boot loaders.

If you find that you boot straight to Windows after restoring the Windows boot loader, you'll need to restore your Linux boot loader. The Arch Linux wiki covers the efibootmgr command you'll use to do this, so just follow that part of the installation again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .