I have a 2TB SATA drive that was being used as file storage on my UBUNTU computer. I was re-imaging my windows box so I used that drive to back up some files to it. I did this by taking the drive from my windows PC and putting it in my UBUNTU PC, mounted it and copied the files over.

After the windows refresh I thought it would be easier to take the 2 TB drive and dock it in the external dock my Windows case has built in. Anyway it would recognize in BIOS but windows would not see it (because it was EXT3 or EXT4) so when I went into the disk manager it advised me the drive needed to be initialized. Me not thinking I initialized it as a GUID Partition table. Now it sees it as a blank drive, even in UBUNTU.

I have done nothing else to write or change the drive. I was wondering if there is a qay to repair the old partitioning and get access to my files back?

many thanks!

EDIT: I followed the instructions in the link @kniwor sent me. I used the command

sudo gpart -W /dev/sda /dev/sda

and here was the result:

Guessed primary partition table:
Primary partition(1)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(2861671176-2861671176)
   chs:  (1023/254/63)-(1023/254/63)d (178130/202/1)-(178130/202/1)r

Primary partition(2)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(3484550160-3484550160)
   chs:  (1023/254/63)-(1023/254/63)d (216903/55/1)-(216903/55/1)r

Primary partition(3)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(4)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Not sure it found what I wanted. suggestions?


As long as you have not written any data on the file, you can try recreating the old partition table and everything should be fine. This guide here has some tools that can help you do that


  • Thanks I am trying the command 'gpart -W /dev/sda /dev/sda' and it is running now. I was going to try doing 'sudo parted /dev/sda' then do 'rescue' but I am not sure what to put for the START and END paramets, the partition was the whole drive. – TheJoester Feb 21 '12 at 23:52
  • Since you are trying to restore your entire partition table, gpart should do fine. – ste_kwr Feb 22 '12 at 0:15
  • 3
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – ζ-- Jul 17 '12 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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