Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a laptop that I run 2 OSs on, Ubuntu and Chromium. They are on separate hard drives, and I physically swap the drives when I want to change the OS.

Recently I wanted to install Windows 7 instead of Chromium, so I went ahead and began installing Windows. I got to the screen where you select the disk/partition to install to, and I started deleting the old partitions. That's when I realized that I had forgotten to switch the drives, and I was deleting Ubuntu partitions. I only deleted one, it was the smaller partition (~200MB). I think this was the boot partition because now Ubuntu won't boot. How can I get this partition back?

share|improve this question
How did you set it up to begin with? Normally there is one partition for swap, which should be a few gb, and one for everything else. – psusi Jun 17 '13 at 21:38
I just installed it directly from the live USB, no changes made. I don't think it was swap space as its now showing only a few hundred meg unallocated on the drive and that seems a bit small for swap. – Owen Tourlamain Jun 19 '13 at 14:49
If you didn't choose manual partitioning, then you don't get a /boot partition, so your description doesn't make sense. – psusi Jun 19 '13 at 15:54
up vote 1 down vote accepted

Your best bet is probably to use TestDisk, which comes on most Linux emergency discs and live CDs.

Given the size of the partition, I suspect this may have been an EFI System Partition (ESP), which is a FAT partition that holds EFI boot loaders. If I'm right, you'll need to give it an appropriate type code after you restore it. You can do this with gdisk, sgdisk, or cgdisk by setting the type code to EF00; or with parted or GParted by setting the "boot flag" on the partition. If this is not an ESP, though, you may not want to run gdisk, sgdisk, or cgdisk on the disk, and you might or might not want to set the "boot flag" with parted or GParted.

share|improve this answer
ok, how would I be able to tell if it was an ESP? – Owen Tourlamain Jun 19 '13 at 14:58
OK, I tried using test disk, but I couldn't get it to do anything. Theres only a few files on there that I want to save, I tried copying them onto a removable hard drive using the live USB, but The files are in my home directory and I don't have permission to read them, how can I get around this? – Owen Tourlamain Jun 19 '13 at 16:18
Given your description, I think you used PhotoRec, not TestDisk. TestDisk recovers entire partitions, not individual files. – Rod Smith Jun 19 '13 at 16:27
Sorry, I worded that badly, I tried using testdisk, gave up and then tried to copy the files using the standard file manager. – Owen Tourlamain Jun 19 '13 at 16:31
OK, ive got the files I need now, I had to use chmod to change the file permissions. Thanks for the help! – Owen Tourlamain Jun 19 '13 at 18:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.