0

I recently deleted Windows from my Laptop and installed Ubuntu to use it as a main operating system (no other operating system beside Ubuntu installed). So I want to delete Ubuntu now. I want no operating system on my Laptop. How can I do it?

  • The easy way is to have ubuntu installer USB and just format the whole drive. This should make laptop a paper weight until a new OS is installed. It will hide data, but the data would have a chance of being found by someone who knows what they are doing. – crip659 Aug 25 '20 at 17:03
  • If you're going to then install Windows, you can skip all that middle-man stuff and just use the Windows installer (8 or 10 are still supported) and the installer (pick to do a custom install) will let you delete partitions, re-partition, and then format the disk(s). This is one of many tutorials. Done that way, there's no real need to do the same thing with a bootable USB or anything of that nature. – KGIII Aug 25 '20 at 17:33
  • 2

2 Answers2

1

Simply delete all partitions and data from your hard disk.

You can make a bootable USB that contains a disk manager like gparted, or just use GUI tools like "Disks" in a live Ubuntu session by selecting "Try Ubuntu" when booting from Ubuntu installation media. You can even use disk formatting tools from a Windows bootable USB.

Nmath
  • 12,333
0

If you want to remove all partitions, you can boot from a live usb and run fdisk -l to find your hard disk and then run fdisk /dev/sdX and type o to create a new MBR partition table. If you want a GPT partition table, you have to run gdisk /dev/sdX and type o to cerate a new GPT partition table. To write and exit type w. To abort write q.

For example

# fdisk -l
Disk /dev/sda: 149.05 GiB, 160041885696 bytes, 312581808 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 457A8416-1E69-4BB7-B84A-E731240D648E

Device Start End Sectors Size Type /dev/sda1 2048 18431 16384 8M BIOS boot /dev/sda2 18432 1067007 1048576 512M EFI System /dev/sda3 1067008 273696767 272629760 130G Linux filesystem /dev/sda4 273696768 312581774 38885007 18.5G Linux swap

Disk /dev/sdb: 30.05 GiB, 32262586368 bytes, 63012864 sectors Disk model: USB Flash Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x63a44614

Device Boot Start End Sectors Size Id Type /dev/sdb1 * 0 2543423 2543424 1.2G 0 Empty /dev/sdb2 172 131243 131072 64M ef EFI (FAT-12/16/32)

/dev/sda is the hard disk (150 GB) and /dev/sdb is the USB.

# fdisk /dev/sda

Welcome to fdisk (util-linux 2.36). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

Command (m for help): o Created a new DOS disklabel with disk identifier 0x5bd5b3e4.

Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.

Creating a MBR partition table.

# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5

Partition table scan: MBR: protective BSD: not present APM: not present GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): y

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!

Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sda. The operation has completed successfully.

Creating a GPT partition table.

The data will still be recoverable (/on the disk), but it wouldn't show up in your file manager. If you want to erase it permanently (/overwrite it with random data) you can use fdisk -l to find the hard disk and use dd if=/dev/urandom of=/dev/sdX status=progress to overwritet it with random data and then use fdisk for a MBR partiton table and gdisk for a GPT partition table (see above)

For example:

/dev/sda is the hard disk

# dd if=/dev/urandom of=/dev/sda status=progress
150000000000 bytes (139 GB, 150 GiB) copied, 882 s, 170 MB/s
292968750+0 records in
292968750+0 records out
150000000000 bytes (139 GB, 150 GiB) copied, 882.35294 s, 170 MB/s

Overwriting it with random data

See above for creating the partition tables