-1

I am wondering how to erase my hard drive completely, Grub and all, because my hard drive is messed up.

This is what I would like to do when it's wiped clean:

  1. Install Windows 7 Home Premium 64-bit from system image. (first and primary)
  2. Install Ubuntu 12.04 64-bit. (desktop) (going to be Ubuntu TV)
  3. Install 4MLinux 64-bit (for maintenance)

I would like to use the Windows Boot Manager to be able to load any of the four OSs. Ubuntu Grub is fine though, but it's not really what I wanted. I also need a partition for each OS. I have 250GB.

How would I do this correctly? I tried and messed up badly before.

UPDATE: I have got Ubuntu installed!

Braiam
  • 67,791
  • 32
  • 179
  • 269
Darren Lewis
  • 1
  • 1
  • 1
  • 1

2 Answers2

1

So you want a tri-boot with Windows bootmgr? Windows bootmgr is less configurable and more difficult to configure than GRUB. But if you insist, you can try EasyBCD to save your life from struggling with bcdedit or other Windows command line tools.

Since you want to use bootmgr, you may install Linux first and Windows last.

If you have previously installed some OSes (boot loaders) on this hard disk, you'd better erase them first.

Boot your computer up with Ubuntu Live USB / CD and determine which is your hard disk by lsblk and erase any footprints left by previously installed boot loaders (if any) with head -c 2M /dev/sda. (If your hard disk is different from /dev/sda remember to change it.)

Now you can partiton your disk with fdisk /dev/sda.

Let's assume you have divided your hard disk into three partitions, ordered in MBR (Booting Windows with GPT requires UEFI, which is a stupid restriction put by Windows installer):

/dev/sda1
/dev/sda2
/dev/sda3

You do not have to format them since the installers will format them.

Now you can install Ubuntu within your live session. Remember to choose /dev/sda2 manually.

After installing Ubuntu you can install 4MLinux in /dev/sda3.

Both Linux distributions will install GRUB to /dev/sda (notice the difference), but Windows installer will erase it anyway.

Now you can install Windows to /dev/sda1 and the installer will automatically format it as NTFS and install Windows bootmgr.

After installation of Windows, your computer can only boot into Windows. Here comes EasyBCD for help. Use it to add two more entries (Ubuntu in /dev/sda2 and 4MLinux in /dev/sda3) to BCD.

Reboot and enjoy your boot menu in bootmgr.

Zhuoyun Wei
  • 540
  • 1
  • 6
  • 12
1

Completely erasing the hard disk is overkill for your purposes. If you want to start fresh for purposes of installing new OSes, wiping the partition table should be sufficient. You can do this with any decent partitioning software, such as parted, GParted, or gdisk. (fdisk will also work, but only if you want to use MBR partitions and if the disk did not use GPT before. If you use any but the very latest version of fdisk on a GPT disk, the result will be incomplete removal of the GPT partition data.) The details depend on the program, but in general, you want to use whatever option it provides to create a new partition table. In parted this would be mklabel and in both gdisk and fdisk it's o, for instance. In any event, this operation makes the disk look blank to OS installers and other tools, but most of the data on the disk remains intact. Recovering it becomes increasingly more difficult as you repartition and use the disk, though.

Completely erasing the hard disk can be useful for security purposes -- say, if you're selling a used disk and you want to wipe it clean to ensure that the buyer can't recover your personal data from it. To do this, you can use dd, as in:

sudo dd if=/dev/zero of=/dev/sdb

This example completely wipes all data from /dev/sdb. Note that this operation will take several hours on a big disk.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105