LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-21-2010, 06:30 PM   #1
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 109

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
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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: 109

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: 390

Rep: Reputation: 50
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: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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: 109

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



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration