How to Safely Uninstalled Linux

Hi,
I am running OpenSuSe 11.1 and Windows Vista under dual boot and know next to nothing about Linux.
After running into a problem booting my Linux system, I decided to re-install Suse. My drive at that time was laid out as follows

Recovery (F) - 15 GB
Window’s OS (C) - 300 GB
NTFS (D) - 100 GB
Free Space 43.31 GB
1st Linux Swap - 2 GB
2nd Linux Ext3 - 9 GB
3rd Linux Ext3 - 65 GB
NTFS (G) - 100 GB
NTFS (E) - 100 GB
Free Space - 192 GB

Unfortunately, I didn’t chose the 3 Linux Partitions correctly during install and as a result, the install used the 43.31 GB of free space. I then did an fdisk -l and saw the following

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0fff07e1

Device Boot Start End Blocks Id System
/dev/sda1 1 1959 15728640 7 HPFS/NTFS
/dev/sda2 1960 41155 314841870 7 HPFS/NTFS
/dev/sda3 * 41156 83384 339204442+ f W95 Ext’d (LBA)
/dev/sda4 83385 96515 105474757+ 7 HPFS/NTFS
/dev/sda5 41156 54171 104550988+ 7 HPFS/NTFS
/dev/sda6 60478 60739 2104483+ 82 Linux swap / Solaris
/dev/sda7 60740 61841 8851783+ 83 Linux
/dev/sda8 61842 70294 67898691 83 Linux
/dev/sda9 70295 83384 105145393+ 7 HPFS/NTFS
/dev/sda10 54172 55352 9486351 83 Linux
/dev/sda11 55353 60477 41166531 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 1500.3 GB, 1500301909504 bytes
1 heads, 63 sectors/track, 46512335 cylinders
Units = cylinders of 63 * 512 = 32256 bytes
Disk identifier: 0x5324add6

Device Boot Start End Blocks Id System
/dev/sdb1 2 46512256 1465136032+ 7 HPFS/NTFS

Disk /dev/sdc: 2047 MB, 2047681024 bytes
64 heads, 63 sectors/track, 991 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdc1 1 991 1997733+ 6 FAT16

So now I have a functioning Windows system, a new, functioning Linux system, and a broken Linux system which, when you try to boot it, comes up in grub.

Executing grub from the healthy Linux system seem so confirm that there are two Linux systems installed on the drive, since, when I execute find /boot/grub/menu.lst, it lists both (hd0,6) and (hd0,9).

Based on what I see in the /boot/grub/menu.lst file, it is (hd0,9) that is healthy –

Modified by YaST2. Last modification on Tue Nov 6 18:38:06 UTC 2012

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,9)/boot/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: windows 2###
title Windows Vista
rootnoverify (hd0,1)
chainloader +1

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.7-9
root (hd0,9)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-ST31000528AS_9VP771VT-part10 resume=/dev/disk/by-id/ata-ST31000528AS_9VP771VT-part6 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.1 - 2.6.27.7-9
root (hd0,9)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-ST31000528AS_9VP771VT-part10 showopts ide=nodma apm=off noresume edd=off powersaved=offnohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don’t change this comment - YaST2 identifier: Original name: SUSE LINUX (/dev/sda7)###
title SUSE LINUX (/dev/sda7)
rootnoverify (hd0,6)
chainloader +1

In any case, I am wondering how to uninstall the two Linux systems so that I may make a clean install thereafter. I have seen multiple threads out there advising how to do this, but there seems to be some disagreement as to which is the best way.

I would appreciate any help at all here,
Thanks,
s660117

I should have added that I would rather not format the drive and start over since I want to preserve my Windows system.

You should of course only alter (remove and create anew) those partitions that are not involved in your Windows installation.

Remove those unwanted partitions usinng e.g. a live CD, or the Rescue mode of an install DVD, or a seperate psrted CD. Using e.g. fdisk, or parted, or …

When they are gone you have then free space on the disk and as you already experienced, the installer will use that. It will propose you a partitioning and you can alter that before you GO with the installation to your liking.

PS, please use CODE tags around the computer text you post by using the # button from the toolbar in the post editor.

Thanks for your reply, Henk.
I have a few questions, however.
What do you mean by a live CD?
How do I use the (Windows?) install CD to accomplish this task?
Can you point me to a thread that would answer these questions?
I am also assuming that if I simply format the Linux partitions that my Windows system will not boot. Is this correct?
s660117

On 2012-11-07 21:56, hcvv wrote:
>
> s660117;2501964 Wrote:
>> I should have added that I would rather not format the drive and start
>> over since I want to preserve my Windows system.
> You should of course only alter (remove and create anew) those
> partitions that are not involved in your Windows installation.
>
> Remove those unwanted partitions usinng e.g. a live CD, or the Rescue
> mode of an install DVD, or a seperate psrted CD. Using e.g. fdisk, or
> parted, or …

Careful: if grub is installed into one of those partitions, then he will
not be able to boot Windows. And if grub is in the MBR, the entries for
the other oses have to be removed too.

So the situation of Grub has to be found first, and corrected.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Thanks for your reply.
How do I make sure that Grub is gone?
s660117

A live CD is one which you can boot an operating system from and it will run in RAM only. Thus the disks in the system are not touched. Good for testing if e.g openSUSE runs on your system, but also for repairing things on your disk(s) without them being “in use”. There are several of those (KDE or Gnome) on the openSUSE download pages. You could e.g. run YaST > System > Partitioner from such a system to do partitioning of your system disk. You could of course also run fdisk from such a system to do the same.

When I talk about an install DVD, I talk about the openSUSE install DVD of course. I do not know very much about Windows.

And you could use the openSUSE install DVD and choose the Rescue item of it’s boot screen. Then you end up in a CLI prompt where you can use fdisk to handle partitions.

What you do to your Linux partitions has no impact on your Windows partitions of course. That is as long as you do nothing to the Windows partitions. Only thing that could have impact on your Windows installation is on the boot process. But the openSUSE installation process normaly takes account of that and creates a Grub configuration where you can boot Windows.

BTW, You seem to have openSUSE 11.1. Because that is long out of support, do not reckon that many people here can realy try at home the details of what you have to help you.

I am sorry, but in case you are not sure about your own understanding of partitioning, creating file system (coolquialy calle “formatting”), etc. you may want to read: SDB:Basics of partitions, filesystems, mount points - openSUSE

Henk,
Bear with me… I read the article but remain confused.
I am unfamiliar with Yast and am not sure how to use it to remove Linux partitions.
And even if I do that, won’t my Windows system be unbootable.
I have read a few articles about using the Windows Repair CD to get rid of Linux, but each article advises a different command.
s660117

On 2012-11-07 22:46, s660117 wrote:
> Thanks for your reply.
> How do I make sure that Grub is gone?
> s660117

I would need to know first where did you install it…

Try, in linux:


file -s /dev/sd*

and post it all here.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Robin, thanks for your reply.
Once again, I have two Linux systems installed on my machine.
But if I login to the system that boots successfully, and enter file -s /dev/sd*, I see –

/dev/sda:   x86 boot sector; partition 1: ID=0x7, starthead 1, startsector 63, 31457280 sectors; partition 2: ID=0x7, starthead 254, startsector 31471335, 629683740 sectors; partition 3: ID=0xf, active, starthead 254, startsector 661155075, 678408885 sectors; partition 4: ID=0x7, starthead 254, startsector 1339563960, 210949515 sectors
/dev/sda1:  x86 boot sector
/dev/sda10: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
/dev/sda11: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
/dev/sda2:  x86 boot sector
/dev/sda3:  x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, LBA flag 0x1, 1st sector stage2 0x343322ea, GRUB version 0.97; partition 1: ID=0x7, starthead 1, startsector 63, 209101977 sectors; partition 2: ID=0x5, starthead 254, startsector 310407930, 4209030 sectors
/dev/sda4:  x86 boot sector
/dev/sda5:  x86 boot sector
/dev/sda6:  Linux/i386 swap file (new style) 1 (4K pages) size 526119 pages
/dev/sda7:  x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, LBA flag 0x1, 1st sector stage2 0x3b30daa2, GRUB version 0.97
/dev/sda8:  Linux rev 1.0 ext3 filesystem data (large files)
/dev/sda9:  x86 boot sector
/dev/sdb:   x86 boot sector; partition 1: ID=0x7, starthead 1, startsector 63, 2930272065 sectors
/dev/sdb1:  x86 boot sector
couldn't open file
/dev/sdc:   writable, no read permission
/dev/sdd:   x86 boot sector; partition 1: ID=0x6, starthead 3, startsector 245, 3995467 sectors
/dev/sdd1:  x86 boot sector
couldn't open file
/dev/sde:   writable, no read permission
couldn't open file
/dev/sdf:   writable, no read permission
couldn't open file
/dev/sdg:   writable, no read permission

On 2012-11-08 17:26, s660117 wrote:
>
> Robin, thanks for your reply.
> Once again, I have two Linux systems installed on my machine.
> But if I login to the system that boots successfully, and enter file -s
> /dev/sd*, I see –

Ok, the MBR is standard, and grub is installed in sda3 which is marked
active. To boot Windows standalone you have to mark bootable sda1 or 2;
I guess the right one is sda1. If that boots, you can destroy the rest
of (Linux) partitions safely.

The bootable mark can be changed in Linux with “fdisk /dev/sda”. First
you mark partition 2, then you unmark #3. Other Windows tool can do the
same, but I’m unsure which to recommend.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Robin,
Thanks again for your reply.
Unable to find fdisk in Unix In A Nutshell, I typed “man fdisk” but was only able to find list options for the command. Did you mean for me to use cfdisk instead? And if that’s the case, I’m confused by the syntax. Would I enter “cfdisk b /dev/sd3” to toggle off the active bit on sd3. And would I then enter “cfdisk b /dev/sd2” to make bootable the partition which contains the Windows OS?
s660117

I meant to write thta I would toggle on sd2 first and then toggle off sd3.

fdisk is normaly interractive (in the terminal). You call

fdisk /dev/sda

and after that type one letter commands. To do anything but listing, you must be root of course.

As it says at start, use the m command to get a list of commands.

p is also good for seeing what your situation is during editing.

You see the a command for toggling the boot flag. It will ask for the partition number.

d is for the deletion. Best is to delete from the last downwards.

You can allways bail out with q.

As soon as you do w, you write the edited table to the disk!!!

As a backup, save an fdisk -l listig somewhere (on a stick or on paper).

Ok… I just executed fdisk and now fdisk -l shows —




Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0fff07e1                     

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1959    15728640    7  HPFS/NTFS
/dev/sda2   *        1960       41155   314841870    7  HPFS/NTFS
/dev/sda3           41156       83384   339204442+   f  W95 Ext'd (LBA)
/dev/sda4           83385       96515   105474757+   7  HPFS/NTFS
/dev/sda5           41156       54171   104550988+   7  HPFS/NTFS
/dev/sda6           60478       60739     2104483+  82  Linux swap / Solaris
/dev/sda7           60740       61841     8851783+  83  Linux
/dev/sda8           61842       70294    67898691   83  Linux
/dev/sda9           70295       83384   105145393+   7  HPFS/NTFS
/dev/sda10          54172       55352     9486351   83  Linux
/dev/sda11          55353       60477    41166531   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 1500.3 GB, 1500301909504 bytes
1 heads, 63 sectors/track, 46512335 cylinders
Units = cylinders of 63 * 512 = 32256 bytes
Disk identifier: 0x5324add6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               2    46512256  1465136032+   7  HPFS/NTFS

Disk /dev/sdc: 2047 MB, 2047681024 bytes
64 heads, 63 sectors/track, 991 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         991     1997733+   6  FAT16


Is my next step to delete the Linux partitions under Windows?
s660117

On 2012-11-08 22:46, s660117 wrote:
> Is my next step to delete the Linux partitions under Windows?
> s660117

Your next step is verify that it boots Windows without grub display.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Thanks, robin and Henk, for all your help.
Using fdisk /dev/sda, I was able to remove the boot flag from the third partition and turn it on on the second.
I then deleted all Linux partitions using Microsoft Disk Admin.
At that point, created three new partitions for Linux and reinstalled the OS.
Thanks again,
s660117