16

Our teacher gave us 2 used computers and asked us to format them and we did. Then we installed Windows 10 on both. Now he comes and says "I don't want any OS on them". Of course, when a computer is just manufactured, it has no OS. He wants us to revert the computer to that state, to disassemble and reassemble its parts, and install any OS on it. But it seems to me that the first thing any OS is programmed to do is not allow the user to delete it when there are no installed operating systems on the computer. It seems the needed result can't be achieved. Or is it? I don't know. Since we will disassemble it anyway, I might learn how to reset everything using the hardware. So can you do that in any way (even using hardware; maybe unplug or change some cables)?


EDIT

Regardless of the context is, I have Win 10 on 2 computers each, and I want to remove it and revert the computer to the "dead box" state

16
  • 41
    Boot from another device (linux boot disk, windows disk), delete all the partitions off the drive. Done?
    – Jonno
    Commented May 4, 2017 at 8:41
  • 39
    "Of course, when a computer is just manufactured, it has no OS." -- actually it probably does have an OS; at Dell-like scales, the OS is likely written to the disk before the disk is put in the computer. They might even get the disks from (e.g.) Seagate with their OS image already installed. Commented May 4, 2017 at 11:28
  • 45
    Why do you think that an OS would be programmed to not allow itself to be deleted?
    – Mokubai
    Commented May 4, 2017 at 11:31
  • 7
    even manufacturers that ship PCs "without OS" generally install freedos on it so you can test it.
    – satibel
    Commented May 4, 2017 at 11:44
  • 40
    "we [formatted them]. Then we installed Windows 10 on both." What do you think was on them between those actions?
    – Kevin
    Commented May 4, 2017 at 15:21

9 Answers 9

22

It is possible to boot a computer without installing the OS on the hard disk. This is what happens with DBAN. The DVD or USB contains an image file of an operating system which is loaded into memory, making the computer function. On DBAN, a program is loaded which writes to a hard disk, removing and obliterating all the data it contains. When the computer is switched off, the OS disappears from memory, leaving the disks blank.

Some information is held in nonvolatile memory on the system board in the form of BIOS settings. These are often maintained by a battery which can be removed.

5
  • 20
    Some information is held in supposedly volatile storage for some amount of time, too. This is why it's important to have small explosive charges mounted on your RAM, just in case you spot the FBI about to break down your door, and carrying canisters of nitrogen ;) security.stackexchange.com/a/10644/91549 and superuser.com/a/226970/576378 for more on that.
    – flith
    Commented May 4, 2017 at 12:38
  • 2
    So If i have the win10 media creation tool on my usb, I boot from it, and format the harddisk completely, then unplug my usb and voila, right?
    – TGamer
    Commented May 5, 2017 at 5:21
  • 3
    @TGamer Yup. Note that that's not really secure; traces of the information will remain on the disk. It won't be able to boot, but someone may be able to e.g. find sensitive documents if given the wiped PC. Commented May 5, 2017 at 9:47
  • 1
    Like Someone Somewhere said. People think the formatting a disk completely wipes it, it doesn't always. It wipes out the table of contents but no the actual book. Commented May 5, 2017 at 10:55
  • Indeed, but as always, it depends: if the program doing the formatting is something like DBAN as suggested in the answer, then most likely it's repeatedly overwritten and destroyed the data ('main text') far more thoroughly than is needed or could ever be recoverable forensically. Commented May 6, 2017 at 17:18
54

If you want to "reset" a computer as near "pre-assembly specs" as possible, you need to wipe the drives, reset the BIOS and disassemble the individual parts.

Wiping the drives, so that they are completely empty or filled with random bits can be achieved with a bootable (USB/CD-ROM) system like DBAN: https://dban.org/ (instructions to create media, etc can be found under Help / Installation Questions).

If your computer(s) are already disassembled, you need to connect the drives to another computer (via USB or internally via SATA) and do the wiping there.

Some BIOSes offer a disk wipe option (mostly laptops, though), so it might be worth checking that out too.

BIOS (or UEFI, whichever you have in the computer) settings can be reset in the BIOS itself.

6
  • 11
    "Some BIOSes offer a disk wipe option (mostly laptops, though), so it might be worth checking that out too." – Technically speaking, I believe this is part of the SATA command set, so it's actually not the BIOS wiping the drive, it's the drive wiping itself. (The difference being a) that you don't actually need the BIOS, only some way of issuing the command to the drive, and b) the drive can disconnect from the host while doing the wipe and not block any resources that way. Oh, and c) the drive may cheat, i.e. it may simply set a bit in its internal configuration saying "I am empty".) Commented May 4, 2017 at 10:19
  • 2
    @jörg-w-mittag I meant an actual "secure wipe" option offered, like on Dell laptops, etc where the disk is actually wiped on next boot. Not just a "destroy the MBR/GPT partition layout" kind of thing.
    – DocWeird
    Commented May 4, 2017 at 10:22
  • 8
    That is also part of the SATA command set and handled by the disk itself. However, the spec doesn't say how "secure" the wipe has to be. Some disks with full disk encryption may just delete the key, for example, or SSDs simply reset their block allocation table. You can issue that command from the BIOS, using hdparm (under Linux), or a number of other tools. Commented May 4, 2017 at 10:30
  • "reset" BIOS? Surely we can do better than that.
    – Bergi
    Commented May 4, 2017 at 20:51
  • 2
    Allow me to point out that DBAN does not have Secure Erase support, which means that it effectively does not support SSDs. DBAN has also been taken over by this so-called "Blancco Drive Eraser" product - I wouldn't really trust the website anymore.
    – oldmud0
    Commented May 4, 2017 at 22:56
9

The entirety of the OS depends on the first few sectors of the hard drive. Without this critical first sector, the entire hard drive may as well be filled with random bits. You can grab a Live Linux OS disc, pop it in to your computer, and run a command like the following (run as root):

dd if=/dev/zero of=/dev/sda bs=4096 count=4096

At this point, the GPT or UEFI structures at the beginning of the drive will be zeroed out, and the computer will not be able boot at all, as if the hard drive were brand new (though there will be bits and pieces of the OS scattered throughout the rest of the drive).

It's important to note that the OS is not installed on the computer, it's installed on the hard drive. You can move the hard drive from one computer to another and the OS may run on the new hardware. Note that using the command above will render the drive unusable in any computer until it is formatted.

NOTE: Make sure you check the location of the hard drive before using the command. Not all Linux systems will map the hard drive to /dev/sda. You can use the lsblk command to verify the device that the hard drive is mapped to. (Thanks to @HSchmale for the comment).

2
  • 4
    You'll want lsblk first to make sure you wipe the right drive. Some distros make sda be the live image itself when they are placed live.
    – HSchmale
    Commented May 4, 2017 at 19:32
  • Note that this won't wipe the whole drive if the drive is really big.
    – wizzwizz4
    Commented May 6, 2017 at 13:50
6

There are a few things which are unclear from your post - specifically if a computer is to be returned to its "factory" state, depending on the PC it will either have an OS on a disk image on the hard drive, or the hard drive will be TOTALLY blank - ie not formatted.

A computer does nothing to prevent a user from deleting the OS, however if there is no OS on it there are usually no built in tools to do anything. In this case you would typically boot of a DVD or USB disk and install an OS.

Windows and Linux installers both offer the opportunity to boot a USB installer and overwrite the old OS/system. If this is what you want to do, download a copy of Ubuntu (or another distro if you prefer), install it on a USB key, boot from it and reinstall the OS.

If you want to totally erase the hard drive, prepare a USB stick with Ubuntu, boot Ubuntu, click on the swirly round thing at the top, type terminal and launch the terminal. This should provide a black box. Type sudo /bin/bash to get full admin access. Use fdisk -l to find the appropriate disk (which will be called /dev/sd?) - you can tell the appropriate one by it size. Then type dd if=/dev/zero of=/dev/sd? bs=512 count=1 and reboot. This command will erase the first 512 bytes of the disk and make it appear to the OS as is new and unformatted. (If you change the bs to something like 65536 and leave off the count option it will zero out the entire disk - this will take a LONG time)

6
  • I said I want absolutely nothing on my pc. Not even the OS
    – TGamer
    Commented May 4, 2017 at 9:47
  • 2
    Then follow my instructions about dd.
    – davidgo
    Commented May 4, 2017 at 10:44
  • It might be worth mentioning the use of smartcl to invoke the disks' secure erase, if supported. Commented May 4, 2017 at 12:38
  • Windows install disks have always contained disk utilities for partitioning and formatting of hard drives, such as FDisk and DiskPart
    – Mad Myche
    Commented May 4, 2017 at 14:59
  • 1
    the nice part about that dd command is that if you just copy and paste it without reading the instructions, the ? will expand to mean all drives, not just the one you wanted to erase :)
    – Nobody
    Commented May 4, 2017 at 21:37
4

Since I don't have enough reputation to comment, I'll post this as an answer.

You mentioned that you have the Windows 10 installation media on a USB drive. If you press Shift+F10 in the Windows Setup program, it will open a Command Prompt.

From there, you can enter the diskpart command, then select disk 0 to select the first hard disk (use list disk to find the correct disk number). Now enter clean all to completely erase the disk (overwrite with zeros).

1
  • This shouldn't have been posted as a comment, because it is in fact an answer. There's a distinction on Stack Exchange sites. (Re-)read the tour if you want to know more.
    – wizzwizz4
    Commented May 6, 2017 at 13:52
3

Use Ultimate Boot CD to wipe the drives and reset the BIOS. That's all you can do from a software standpoint. The reset is to take it apart physically.

The reason i suggest UBCD is because it has a secure wipe which will prevent the data on the drives from being recovered whereas windows format, you can still recover the data is you so choose at a later date.

2

Use a bootable media (USB, cd, dvd, even a network boot would suffice) to live boot the computer with an OS of your choice.

Once in the OS of your choice, use disk utilities or the terminal to completely erase any drive connected to the system.

That way, the OS doesn't have to delete itself, another (live) OS is gonna do the job for you.

One of the easiest ways to do that is with a live ubuntu usb.

(Ohhhh, btw, should the OS you actively have on your drive be unix-based, you can actually use rm rf with root privilages on the terminal to make the OS wipe the whole drive :) )

1
  • That will not wipe the whole drive. The command that you mean is rm -rf /, but that only wipes the index - all the files will still be there, just without file names until you overwrite them with something else. (Formatting wipes the Table of Contents, so you should do something like piping /dev/zero into /dev/sd? instead.)
    – wizzwizz4
    Commented May 6, 2017 at 13:55
0

Three additions to the advice given:

Check whether a so called HPA has been set up on the drive; this is a reserved set of sectors, making the drive appear slightly smaller than it is, and making any attempt at wiping it without being aware of it incomplete.

hdparm -N from a linux live system can be used to see, create and remove HPAs.

...

If using the ATA secure erase feature via hdparm, make sure that you use a password that is recoverable during preparations (the secure erase process is two step, locking the drive with a password then triggering the erase process which will unlock the drive again) - if it becomes lost you can end up with a drive that is, to your means, bricked.

...

OS licensing with some very modern OSes can be dependent on either a BIOS serial number or an surrogate serial number created from hardware specifications and/or other hardware serial numbers (eg network adapter MAC addresses). Such a computer could behave slightly differently (usually to your advantage though) when installing an OS even after a complete wipe, since what happened during install did not only affect the local PC but stored some authorization information somewhere on the internet.

-1

What you can do is use a zero-fill program on another computer to reset the drives to all zeroes.

1
  • 1
    Yes, but how?
    – wizzwizz4
    Commented May 6, 2017 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .