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

Pabru
  • 1,335
TGamer
  • 315

9 Answers9

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.

DocWeird
  • 1,329
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.

karel
  • 13,706
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).

phyrfox
  • 1
  • 21
  • 17
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)

davidgo
  • 73,366
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).

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.

JordanGS
  • 240
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 :) )

nic3ts
  • 216
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.

rackandboneman
  • 780
  • 4
  • 6
-1

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

Will
  • 1