LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   using parted to erase whole disk (https://www.linuxquestions.org/questions/linux-software-2/using-parted-to-erase-whole-disk-379278/)

shanenin 11-02-2005 10:10 AM

using parted to erase whole disk
 
I wanted to use parted to automatically partition my harddrive. As far as I can tell, their is no option to erase the drive in one step. I can do it using a bash or python script that gets output from the command
Code:

parted /dev/hda -s print
with this output I could manulally have the script run this command on each of the found partitions
Code:

parted /dev/hda -s rm $NUMBER
before I write this script, I am wondering if ther is a way to just erase the whole drive with one parted command. for example, if this command was available
Code:

parted /dev/hda -s rm all

tredegar 11-02-2005 11:19 AM

You might like to take a look at this link (describing Partition Tables):

http://www.win.tue.nl/~aeb/partition..._tables-2.html

It seems to me that if you just use dd to zero out the partition table, then all the partitions are "Deleted". Then you can start reconstructing them. Or maybe it isn't that simple?

HTH

shanenin 11-02-2005 11:36 AM

thanks for the suggestion, that sounds like that might be a good solution :-)


All times are GMT -5. The time now is 06:09 PM.