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'm working on a really really wierd project. I'm using Ubuntu to recover an Android device. I'm doing this by launching Ubuntu and then using the GUI to keep the user informed.

I need to figure out a way to realign the partition tables. When using parted -l print, parted shows that there are problems on the disk and asks for user input to correct the partition table endings. Is there another tool that I can use for a scripted recovery?

Basically, The partition tables at this point are correct, but the disk is in an unknown state. I need to figure out a way to rewrite the partition table endings on the disk.

share|improve this question
up vote 0 down vote accepted

parted has a script mode.

-s, --script never prompts for user intervention

share|improve this answer
does that automatically realign partitions? – AdamOutler Feb 26 '12 at 18:34
No, you would have to write the 'script' to do it. I thought that was what you were looking for. Could be a fun (but be careful) exercise in bash scripting. – jedijf Feb 26 '12 at 18:38
Well, parted print gives the option to fix automatically. You have to press Y. – AdamOutler Feb 27 '12 at 6:32

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.