Making a HDD unallocated

reedOsama

Senior Member
Joined
Oct 4, 2009
Messages
927
Reaction score
2
Hey guys

I was just wondering if there's any way to format your drive to be unallocated...

so make it as though you just bought it.

I've tried looking it up but all I get is instructions for formatting an unallocated drive.

Thanks!
 
Well ideally you should use secure erase to clean the drive (then it will be completely empty)

In Windows: start -> run -> cmd -> diskpart -> list disk -> (look for your disk) -> select disk x (where x is the disk you found by looking) -> clean

In Linux
-> console
-> sudo fdisk -l (look for your disk)
-> sudo dd if=/dev/zero of=<your disk here, eg. /dev/sda, /dev/hda, etc.> bs=1024 count=10240

Linux one will not work if the partition stored information at the end of the disk. Then you will also need to determine the size of the disk in sectors using fdisk -l

Then use that and do -> sudo dd if=/dev/zero of=<disk> seek=<sector size -10240) bs=1024

Then it will appear unallocated but data can still be extracted from the disk by using data recovery programs, only secure erase can stop that.
 
Last edited:
Just delete the partition(s)

Exactly, then you'll have unallocated space. What exactly are you trying to do though?

If you're trying to make the drive look like it's still new by removing the partitions it's not going to work. HDDs have SMART data that keep logs over the course of the drive's life. Temperature, power on time, head load/unload cycles, bad sector count etc. Viewing this will show you the drives 'history' for lack of a better word. The SMART values can be reset though.
 
You can use something like Parted Magic (free Linux live CD) to partition the HDD.

Windows 7 also has a reasonable partition editor which can be found under Computer Management as Disk Management.
Windows XP also has it, but perhaps not as impressive ;)

@Gnome:
dd will take forever in block sizes of 1k. I usually use like 1M sizes -> dd bs=1M ..
You just have to be VERY careful with dd, because it can overwrite anything: files, partition tables & boot records
 
Last edited:
It's 3 in the morning so I'm gonna go through all of solutions later today but before I go sleep I'm gonna answer South's question.

Exactly, then you'll have unallocated space. What exactly are you trying to do though?

If you're trying to make the drive look like it's still new by removing the partitions it's not going to work. HDDs have SMART data that keep logs over the course of the drive's life. Temperature, power on time, head load/unload cycles, bad sector count etc. Viewing this will show you the drives 'history' for lack of a better word. The SMART values can be reset though.

I just used the "as though it's new" to help explain what I'm talking about. The story is...

We got a new PC for the house and I got a new hard drive a bit after that.

Whilst putting in the hard drive I thought I might as well put in my external's hdd too and then I can put the old PCs' hdd into my external.

Unfortunately I got a bootmgr is missing when installing the external's hard drive (the new one worked like a charm)

The fix for the above problem is to boot from the OS disk and then instead of installing choosing to repair the boot.

However the windows 7 disk was at my dad's work so I just used my old Vista disk (very much original)

It actually worked except when looking for the OS it finds it on a drive that doesn't exsist... but when I take the external out my PC works just fine.
 
Last edited:
This error that you're getting is because your BIOS is set to boot from the wrong HDD.
Either you need to swap the SATA cables on the motherboard, or you need to change the HDD boot order in the BIOS.
 
This error that you're getting is because your BIOS is set to boot from the wrong HDD.
Either you need to swap the SATA cables on the motherboard, or you need to change the HDD boot order in the BIOS.

+1
 
This error that you're getting is because your BIOS is set to boot from the wrong HDD.
Either you need to swap the SATA cables on the motherboard, or you need to change the HDD boot order in the BIOS.

Fixing the boot order in BIOS didn't help

but I didn't know about the sata cable order... i thought about it but decided it would obviously just boot from the HDD with the OS (I reformatted the external's hdd so it's completely empty)

I'll be away for the weekend so I'll have to try on Monday. I also don't feel like taking the external hdd apart... again:(

Anyway, thanks guys for the help and I'll tell you how it goes on Monday.
 
Actually the problem is that you partition on the external's hdd is marked as bootable. No amount of reformatting is going to get rid of that, you need to use fdisk and take off the bootable flag.
 
@Gnome:
dd will take forever in block sizes of 1k. I usually use like 1M sizes -> dd bs=1M ..
You just have to be VERY careful with dd, because it can overwrite anything: files, partition tables & boot records

The commands I gave above I use all the time. It takes milliseconds. It's only purpose is to erase the partition information (which is stored on the first few sectors and with some partitions also the last few), not clear the disk.

He didn't ask how to erase the disk, just how to remove partition information, so the disk appears as new. Both techniques will do exactly that, much faster than secure erase and without the need of other tools.

Secure erase took me 3 hours on a Samsung 1TB and 5 hours on a Seagate 1.5TB, which is short for a full erase but unacceptable for removing partitions.
 
Last edited:
Actually the problem is that you partition on the external's hdd is marked as bootable. No amount of reformatting is going to get rid of that, you need to use fdisk and take off the bootable flag.

but if it's unallocated then there isn't a partition?
 
but if it's unallocated then there isn't a partition?
Unallocated always means there are no partitions
No partitions does not always unallocated

The partitions are held by either, MBR (Master boot record) or GPT (GUID Partition Table).

Removing the MBR is easy, erase the first few sectors on the disk, but GPT requires removing the first few sectors AND the last few. The commands I gave above can remove both MBR and GPT in a second or two.

MBR is currently the most popular but it has a 2TB file size limit PER DISK, whereas GPT is the future which supports 8 ZiB.

I think only Windows 7 can boot from GPT, and you also need a motherboard with one of the newer BIOS's that support UEFI boot loaders. (My point being that you almost certainly will encounter MBR except for RAID and newer or more advanced setups like NAS devices).
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X