LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 12-21-2010, 06:30 PM   #1
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 108

Rep: Reputation: 16
delete partition tables


Hi,

How can I delete all the existing partitions on a HDD?

I tried using the following command:
/bin/dd if=/dev/urandom of=/dev/sda bs=1M count=10

This does delete the partition tables but when I use fdisk to create new partitions, then I format those using mkfs.ntfs then the partitions are not seen by Windows.

Is there any other way to remove all existing paritions from a HDD?

Please help
Thanks
 
Old 12-21-2010, 06:34 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 13,787

Rep: Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359
Run "fdisk /dev/sda". Delete the partitions from there, then use the DD command to 'randomize' the device.
 
Old 12-21-2010, 06:36 PM   #3
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 108

Original Poster
Rep: Reputation: 16
What if I need to script this and I do not know how many partitions are on the /dev/sda device?

is there any way to specify using fdisk to delete ALL existing partitions?
 
Old 12-21-2010, 06:43 PM   #4
silvyus_06
Member
 
Registered: Oct 2010
Distribution: Ubuntu 10.04 , Linux Mint Debian Edition , Microsoft Windows 7
Posts: 386

Rep: Reputation: 49
what about a gparted live cd ....
 
Old 12-21-2010, 06:48 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,801

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
Make sure you have the partition (type) identifier as x07, not a Linux type.
 
1 members found this post helpful.
Old 12-22-2010, 04:39 AM   #6
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 108

Original Poster
Rep: Reputation: 16
syg00, you were right, I had to change the partition type to 7 using fdisk to make it seen by windows. The problem was not with the way I was removing all the partitions.

Thanks for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
different partition tables from fdisk and df dark* Slackware 8 02-15-2007 10:26 AM
need some help with partition tables O_o eNtoS Linux - Software 14 11-28-2006 12:16 PM
Raid, fdisk and partition tables zdenisl Linux - Software 0 10-21-2006 10:35 PM
Filesystems and Partition Tables blkmage Linux - Hardware 0 09-10-2004 04:15 PM
How do I recover old partition tables in linux? PsychoFarmer Linux - Software 5 01-04-2004 05:14 PM


All times are GMT -5. The time now is 12:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration