cleaning a HD for Windows

Asked by Red Sonja

I did an unsuccessful UBUNTU install on my new computer. There was already an aborted Windows XP install on the drive (320MB). Now I want to just clean and reformat the disk for a clean Windows install. Unfortunately Win XP doesn't even recognize this HD anymore (because of the UBUNTU???). So I need to at least bomb the HD in UBUNTU while it's mounted (SATA) to my friends computer with a working copy of UBUNTU. UBUNTU recognizes it and even which part is Windows!!.

HELP,
Red Sonja

I WILL go back and get a good Window's XP install then dual boot the UBUNTU for learning...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
CKirocZ
Solved:
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

Easy way... boot the live CD and run

sudo gparted

from a terminal. Delete the partitions and make one big fat partition. Windows will be able to see it and reformat it as NTFS when it installs.

Revision history for this message
Jim Hutchinson (jphutch) said :
#2

Oh, you can do it from your friend's Ubuntu box but the drive has to be unmounted to be worked on.

Revision history for this message
Red Sonja (wendymarie35) said :
#3

She already has UBUNTU 7.04 booted on her primary HD... I have my messed up SATA HD also connected to her system (SATA plus power cables).

How do I run "sudo gparted" so that it does MY HD "New Volume"? And how do I get to a command line prompt? Sorry I'm a novice... BUT I will get up to speed, especially with the wonderful helpful people on the forums.

Thanks,
Red

Revision history for this message
Dmitry Mityugov (dmitry-mityugov) said :
#4

Hello Sonja,

To "bomb the HD", you can use dd console command. For example,

sudo dd if=/dev/zero of=/dev/<your drive here>

will fill the entire drive with zeroes, and

sudo dd if=/dev/zero of=/dev/<your drive here> count=1

will clear the boot sector only, making the disk basically empty for Windows XP.

You can also add bs=64k to any of those commands to speed them up a little bit

Revision history for this message
Red Sonja (wendymarie35) said :
#5

OK, thanks Dmitry (where are u from??, I'm in Indiana,USA). I assume that <your drive here> is "New Volume" without the quotes (ie the space is OK). This should work but have to wait till my friend returns to get her password (who uses passwords for admin anyway??). This is what I wanted to do was to "bomb the HD" but couldn't from the Window's system (at least with my limited knowledge)!!!

Thanks again, will get back when this works and my problem is "solved",
Red Sonja

Revision history for this message
Red Sonja (wendymarie35) said :
#6

This is the message I get"

anna@anna-desktop:~$ sudo dd if=/dev/zero of=/dev/'New Volume' bs=64
dd: writing `/dev/New Volume': No space left on device
15417601+0 records in
15417600+0 records out
986726400 bytes (987 MB) copied, 16.6016 seconds, 59.4 MB/s

HELP,
Red Sonja

Revision history for this message
Red Sonja (wendymarie35) said :
#7

The HD is a Seagate Barracuda 7200.9 300GB...

Revision history for this message
Dmitry Mityugov (dmitry-mityugov) said :
#8

Hello Sonja,

How many hard drives do you have in your computer? What's their type, IDE, or SATA, or maybe SCSI? What do these commands produce:

ls /dev/hd*
ls /dev/sd*

I am in St.Petersburg, Russia. The closest place to Indiana I have visited probably was Atlanta, or more exactly - its international airport. I had only 20 or so minutes to catch a connecting flight there, so I ran like a rocket from one terminal to another, crying "it's me! don't close the aircraft door!" ;-)

With best wishes

Revision history for this message
Jim Hutchinson (jphutch) said :
#9

I don't know much about "dd" so I can't comment, but I think using gparted is a simple way to format the drive so you can use it with windows. To open a terminal you click on applications - accessories - terminal. gparted might not be installed so run

sudo apt-get install gparted

after you open the terminal. Then run

sudo gparted

When it opens, select the drive you want to work on and then format it or delete partitions as necessary. The drive should probably not be auto mounting so you shouldn't have any problem with that. Let me know if you have any other questions.

Revision history for this message
Gianfranco (lordborotto) said :
#10

ok....you want to install windows, right?
if that's the case, grab your windows cd, boot from it, make a fat, big partition , patitionate it if you want, then install windows......
if it doesn't work, buy a new HD =)

Revision history for this message
Red Sonja (wendymarie35) said :
#11

Dmitry, from what I have heard, St Petersburg is a great place to visit. Tchaikovsky, Stravinsky and Rimsky-Korsakov are three of my favorite composers, especially Tchaikosky's Piano Concerto #1 and Rimsky's Piano Concerto #2 (along with several of Tchaikosky's Symphonies). Don't know if I could take the cold "white" winter but that would probably be the only time I could afford to visit someday.

Sorry for getting off topic,
Red Sonja

Revision history for this message
Red Sonja (wendymarie35) said :
#12

Thanks for your input Gianfranco. NO I don't want to support the Microsoft EMPIRE anymore (too many "blue screens of death") and will NOT be upgrading to vista... but need time to get a Linux OS up and functional with all the utilities I am used to. And transfer years of iTunes (not a fan of Apple either) music, Word docs, ACDsee photos and movies, etc. over to Ubuntu (the Linux version of my choice, I think).

OH, and drivers for all my "devises":
Intel Desktop Board D955XBK MOBO
w/ Pentium D 940 (3.2GHz) overclocked to 4.4GHz
Crucial Ballistix 2GB DDR2 800 (PC2 6400) Cas Latency 4
(2) "CrossFire", ATI Radeon X1600, Express x16, 512 Mb
Two Seagate Barracuda 7200.10's in RAID 0 configuration
External Western Digital WDG1NC7500N 750GB Network Hard Drive
Linksys SRX 400 Wireless-G Broadband Router (may be updating to "h" router)
Acer Monitor AL2216W (1680 x 1050 widescreen)
Canon PIXMA iP6600D Photo Printer
Plextor ConvertX, Digital Video Converter (model PX-M402U) ***any chance of a driver???***
........

Smiles,
Red Sonja

Revision history for this message
Red Sonja (wendymarie35) said :
#13

Hi Jim, sorry I got off topic... Here is what I get with the gparted command:

anna@anna-desktop:~$ sudo gparted
Password:
======================
libparted : 1.7.1
automounting disabled
======================

then it goes into a device searching mode, I choose "my" HD (I hope) in a "GParted" window, and hit return in the command window. I get a blinking cursor... and blinking.... and blinking...

HELP,
Red Sonja

Revision history for this message
Red Sonja (wendymarie35) said :
#14

The cursor finally stopped blinking and came back to a command line prompt. Now how do I know what was done... If it "bombed" my disk or not??

Thanks,
Red

Revision history for this message
Jim Hutchinson (jphutch) said :
#15

Not sure what's going on but once you start gparted you should ignore the terminal window. Work just in the gparted gui and select your drive and then use the tools in that gui window to do what you need to do with the drive. The gui interface will tell you what is happening (although the terminal window will also report output and errors but you can usually ignore it unless you need to troubleshoot).

Revision history for this message
Best CKirocZ (christopherakeeton) said :
#16

Red Sonja, if you properly executed the command that Dmitri suggested (sudo dd if=/dev/zero of=/dev/<your drive here>), then the output-

anna@anna-desktop:~$ sudo dd if=/dev/zero of=/dev/'New Volume' bs=64
dd: writing `/dev/New Volume': No space left on device
15417601+0 records in
15417600+0 records out
986726400 bytes (987 MB) copied, 16.6016 seconds, 59.4 MB/s

means that dd filled the entire disk that you specified with zeros until it ran out of space on the disk then it rightfully stopped with an error.

I am not sure how Ubuntu is set up but this portion of the command that you used concerns me-
"of=/dev/'New Volume'".
Typically, linux systems designate harddrives as /dev/sda, /dev/sdb (SATA drives), and /dev/hda, /dev/hdb (IDE drives).
From the info you provided your drive should show up as /dev/sdx .(the "x" means some appropriate letter such as "a" or "b" or "c")
If you type "sudo mount" in a terminal window(no quotes) it should tell you what drives are mounted(being used by the system), then you can look in the /dev folder to see which sdx is not listed by mount, the one that isn't listed should be your HD.

An easy way to list all drives in /dev is-
"sudo ls /dev | grep sd"

my results are-

ptysd
sda
sda1
sda2
sdb
sdb1
sdb2
ttysd

Then type "sudo mount | grep sd" which gives me-

/dev/sda2 on /mnt/gentoo type ext3 (rw)

This means that the partition /dev/sda2 is mounted at the folder /mnt/gentoo.
You do not want to use the dd command on a partition that is in use, you will blank your friend's HD!
Also, in my results above, you can see sda, sda1, sda2 and sdb, sdb1, sdb2; the ones without numbers are entire drives and the ones with numbers are partitions.
So you will want to blank a drive(/dev/sdx) that is not listed by "sudo mount".
I would, according to my results, type-

"sudo dd if=/dev/zero of=/dev/sdb bs=1M"

because the HD /dev/sdb is not in use and /dev/sda(specifically /dev/sda2) is in use.

Hope this helps!
Linux can be hard to learn but it is well worth it.
You can check the Ubuntu or Gentoo forums for future help!

Revision history for this message
Red Sonja (wendymarie35) said :
#17

Thank U very much for this insight. I will rerun the dd command as I already successfully removed all partitions, but Win XP would still not recognize the disk (although it IS listed in my BIOS). I am sure there is a DOS command to do the reformatting on this drive also, but I don't know nor want to learn DOS.

Thanks,
Red Sonja

----- Original Message ----
From: CKirocZ <email address hidden>
To: <email address hidden>
Sent: Tuesday, August 14, 2007 11:50:54 PM
Subject: Re: [Question #11363]: cleaning a HD for Windows

Your question #11363 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/11363

CKirocZ proposed the following answer:
Red Sonja, if you properly executed the command that Dmitri suggested
(sudo dd if=/dev/zero of=/dev/<your drive here>), then the output-

anna@anna-desktop:~$ sudo dd if=/dev/zero of=/dev/'New Volume' bs=64
dd: writing `/dev/New Volume': No space left on device
15417601+0 records in
15417600+0 records out
986726400 bytes (987 MB) copied, 16.6016 seconds, 59.4 MB/s

means that dd filled the entire disk that you specified with zeros until
it ran out of space on the disk then it rightfully stopped with an
error.

I am not sure how Ubuntu is set up but this portion of the command that you used concerns me-
"of=/dev/'New Volume'".
Typically, linux systems designate harddrives as /dev/sda, /dev/sdb (SATA drives), and /dev/hda, /dev/hdb (IDE drives).
>From the info you provided your drive should show up as /dev/sdx .(the "x" means some appropriate letter such as "a" or "b" or "c")
If you type "sudo mount" in a terminal window(no quotes) it should tell you what drives are mounted(being used by the system), then you can look in the /dev folder to see which sdx is not listed by mount, the one that isn't listed should be your HD.

An easy way to list all drives in /dev is-
"sudo ls /dev | grep sd"

my results are-

ptysd
sda
sda1
sda2
sdb
sdb1
sdb2
ttysd

Then type "sudo mount | grep sd" which gives me-

/dev/sda2 on /mnt/gentoo type ext3 (rw)

This means that the partition /dev/sda2 is mounted at the folder /mnt/gentoo.
You do not want to use the dd command on a partition that is in use, you will blank your friend's HD!
Also, in my results above, you can see sda, sda1, sda2 and sdb, sdb1, sdb2; the ones without numbers are entire drives and the ones with numbers are partitions.
So you will want to blank a drive(/dev/sdx) that is not listed by "sudo mount".
I would, according to my results, type-

"sudo dd if=/dev/zero of=/dev/sdb bs=1M"

because the HD /dev/sdb is not in use and /dev/sda(specifically
/dev/sda2) is in use.

Hope this helps!
Linux can be hard to learn but it is well worth it.
You can check the Ubuntu or Gentoo forums for future help!

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/ubuntu/+question/11363/+confirm?answer_id=15

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/ubuntu/+question/11363

You received this question notification because you are a direct
subscriber of the question.

____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/

Revision history for this message
Dmitry Mityugov (dmitry-mityugov) said :
#18

Hello Sonja,

What do you mean by "would still not recognize the disk"? Could you tell us what drives are shown if you right-click My Computer icon on the desktop, select Manage, and select Disk Management?

Revision history for this message
Red Sonja (wendymarie35) said :
#19

Sorry, I get into "My Computer" which shows the two partitions of my friends disk, but I can't (Windows XP Pro SP2) find a Manage - Disk management options???

Sorry for my ignorance,
Red Sonja

ps, if u have read my profile u will know i am NOT ignorant in any sense of the word..

----- Original Message ----
From: Dmitry Mityugov <email address hidden>
To: <email address hidden>
Sent: Wednesday, August 15, 2007 11:11:23 AM
Subject: Re: [Question #11363]: cleaning a HD for Windows

Your question #11363 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/11363

    Status: Open => Needs information

Dmitry Mityugov requested for more information:
Hello Sonja,

What do you mean by "would still not recognize the disk"? Could you tell
us what drives are shown if you right-click My Computer icon on the
desktop, select Manage, and select Disk Management?

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/ubuntu/+question/11363

You received this question notification because you are a direct
subscriber of the question.

____________________________________________________________________________________
Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

Revision history for this message
Red Sonja (wendymarie35) said :
#20

Thanks CKirocZ, that solved my question.

Revision history for this message
CKirocZ (christopherakeeton) said :
#21

Your welcome, Red Sonja.
Glad I could help.
Just for future reference, using the dd command in this way leaves your harddrive in a like new state - no formatting, no boot sector, no data - so it will need to be formatted and partitioned again. It is a good idea to do this any time you sell or give away a computer or disk to strangers, but keep in mind that data can still be recovered.
Anyone needing data recovery should check out TestDisk and PhotoRec at http://www.cgsecurity.org/.