The NZ Linux Resource

[AuckLUG] RE: DELETING PARTITIONS(OR NEWBIE PLAYING WITH

Trevor van Bremen trev_vb at SalesRS.com
Thu Feb 1 13:46:06 NZDT 2007


Perhaps this is slightly OT, but I figure it's near enough to on-topic since
disk partitioning is a component common to both Linux and the 'Redmond
Virus' so here goes nothing...
It goes back a LONG way, but hopefully the history MIGHT help some people to
better understand things?
Oh yeah, sorry it's so long... SUE ME!

On a floppy, the first sector of the first track was always designated as
being the bootstrap loader.  It contained a comparatively small piece of
software that loaded the majority of the operating system from the relevant
files into memory and then began executing this code.  (Hence the term
'bootstrap loader' as this code picks up the system from its own
bootstraps).
When hard disks started appearing on PC's (back when Noah was still
gathering animals by the pair to squeeze onto the Ark), some clever turkey
decided that there was sooooo much storage available on a 5MB hard disk that
users might want to 'split' the drive into multiple partitions unlike the
single partition that was available on the wonderfully efficient floppy
disks.  (Me? Sarcastic??? Surely not!)
When booting a PC from a hard disk, the BIOS follows the same basic
procedure as for booting from a floppy in that it reads the first sector of
the first cylinder of the first head and then executes the code contained
therein.
However, when it comes to hard disks, another level of 'indirection' was
inserted.  The primary bootstrap loader on a hard disk contains a table of
exactly four (4) entries that define the 4 primary partitions available on
the hard disk.  The associated bootstrap code scans this table looking for
the first entry that is marked as 'active', and it then proceeds to load the
first sector of that partition into memory and executes it.  The expected
content of this secondary bootstrap loader sector is largely identical to
that found on the old floppy disk bootstrap sector.
About now, you're probably beginning to wonder how Alan has managed to
squeeze 9 partitions into a table that is fixed in size to four entries...
(Well, maybe one or two of you are asking...)
You'll notice that parition 4 has the type 'extended'.  An extended
partition is there purely to allow further partitions above and beyond the
fixed limit of 4 in the primary partition table.  Thus, hda5, hda6, hda7,
hda8 and hda9 are all subsidiary to hda4 in this instance.  (Imagine it as
yet another level of indirection that had to be created because Redmond was
incapable of counting past 4 when it implemented use of partition tables).
LILO, GRUB and other such (non-redmond) bootstrap loaders deviate here and
there from the above, but they mostly follow the same basic principles at
least to the point where they understand and obey the basic physics of
partition definition.  (You might choose to read-up on these if you want
more details of map files etc)

With all that being said, it's plain to see that Alan has loaded all his
Linux partitions in subsidiary partitions of the hda4 extended partition.
Therefore, all Alan needs to do to 'uninstall' the paritions he'd setup for
*nix would be to remove hda5 through hda9 and recreate them as he installs
OpenSuse.  However, be 
especially careful that the code contained in the primary bootstrap sector
(also known as the MBR [Master Boot Record]) has not been adulterated by a
LILO type bootstrap loader.  Historically, this could be accomplished by
booting the Redmond Virus and typing "FDISK /MBR" on a command prompt.
However, I've not had to do this since Win95 days as I've only ever wanted
to remove the Redmond O/S from systems rather than removing the REAL O/S...
It seems WIN XP no longer provides FDISK.EXE (which BTW is a TERRIFIC
anti-virus tool useful in the removal of Redmond code).  Instead, it appears
you'll need to find "FIXMBR.EXE" in your recovery console which is PROBABLY
in that hidden partition on your disk... (More on that below)
As a side note, Alans existing parition table shows two independent
Linux-Swap partitions on hda5 and hda7.  It's highly unlikely that he's ever
used both of these partitions and it's also somewhat illogical to have two
swap partitions on a single disk spindle.  (If he had multiple HDDs in the
machine, he could technically mirror his swap-space across multiple spindles
to create a more 'fault-tolerant' system, but that's an entirely different
story and well beyond the scope of this already far-too-long response)

Last (and almost definitely least since it's now truly off-topic)...
All your Wind-Blows partitions are of type FAT (1 * FAT16 and 2 * FAT32)...
While these partition types have traditionally offered the best
compatability to be mounted and accessed from within Linux, they do not
offer any of the advanced security aspects of the Redmond NTFS file system.
On the few remaining clients of mine that INSIST on having the ability to
play Wind-Blows games, I tend to make an NTFS partition *AND* a FAT32
partition.  The latter being allocated as the D: drive and used for
transferral of files between Linux and Wind-Blows.  (Last I checked, the
CONFIG_NTFS_RW kernel build option that enables read-write access to an NTFS
partition is still marked as "DANGEROUS / EXPERIMENTAL" so I religiously
avoid it like the plague)
FYI, there is a utility included in XP called
"%SYSTEMROOT%\System32\Convert.exe" that enables you to convert an existing
FAT partition into an NTFS partition.  The %SYSTEMROOT% is normally
C:\WINDOWS, but you may have your copy of XP loaded with some other
basename...
Also, note that your system has THREE (3) FAT paritions being hda1, hda2 and
hda3.  One of these is 'hidden' from you as you only see C: and D: on your
system in Windows.   The third one is almost definitely your 'recovery'
partition.  I have found that most notebooks tend to have the recovery
parition setup as FAT16 (which seems to contradict Chi.Li's observations, so
YMMV).  If you're really interested in seeing what is on this 'hidden'
parition, you can assign it a drive letter in Windows by way of
ControlPanel/AdministrativeTools/ComputerManagement/DiskManagement.  Be
warned that if you screw up the data on this partition though, you'll never
be recovering the Redmond OS to this system without a proper XP bootable CD.
(And really, you don't need it anyway.  It's just another bunch of
meaningless bloatware).  Perhaps the only thing you might need from it will
be the abovementioned FIXMBR.exe program in case you've installed LILO in
your MBR.

-----Original Message-----
From: Li, Chi (Contractor) [mailto:chi.li-eds at eds.com] 
Sent: Thursday, 1 February 2007 7:38 a.m.
To: aucklug at linux.net.nz
Subject: [AuckLUG] RE: DELETING PARTITIONS(OR NEWBIE PLAYING WITH

Hi Alan

You did not tell us the partition size.

Notebooks tend to have a FAT 16 boot partition and a FAT 32 partition which
is hidden for recovery purpose. You can press a magic key to kick off the
recovery process during boot. When you go through those process, you will be
back to OEM.

It appears that you have a XP Home on you notebook. OEM tend to use FAT 32.

There you have it. If you blow away the FAT 16 and FAT 32, you will not be
able to recovery your notebook to OEM.

By the way, the i386 folder on the C:\ contains everything you need to
install XP except the s/n. You can use that i386 folder and make a bootable
CD. Let me know if you want the instruction.

Sorry guys, this is not a Linux discussion.

Regards

Chi

Message: 4
Date: Wed, 31 Jan 2007 19:50:04 +1300
From: Alan Nicholson <alan.nicholson at janal.co.nz>
Subject: [AuckLUG] Fwd: DELETING PARTITIONS(OR NEWBIE PLAYING WITH
	FIRE!!!)
To: aucklug at linux.net.nz
Message-ID: <200701311950.04763.alan.nicholson at janal.co.nz>
Content-Type: Text/Plain;  charset="iso-8859-1"




I have an Acer Laptop that came originally with WinXP loaded. Although I
hardly ever use it I would like to keep it as a backup for my wifes PC - she
is a bit more locked in to M$ as she is an contract Project Manager who
frequently deals with companies who are solely M$ based. As its a legal copy
(albeit with NO backup CD copy if anything goes wrong) I would like to be
sure not to delete it.

Some time back I loaded SLED 10 on  a trial basis and later installed Suse
10.1 so it now has the 3 OS loaded.

I've now decided to move to OpenSuse 10.2 but want to retain the XP
partitions and delete all the others and do a fresh install. I could let
Suse 10.2 do the repartitioning or I have GParted as a live CD so I could
use that. My problem is ensuring that I don't delete the partitions that
relate to XP

When I look at the partitions using GParted I see:

Dev/hda1		fat32
hda4		extended
hda5		linux-swap
hda6		reiserfs  (pretty sure this is SLED10as the Bootloader
shows SLED10 as
			hda6)
hda7		linux-swap
hda8		ext3
hda9		ext3
hda2		fat32
hda3		fat16

I am assuming that the extended,fat32 & fat16 partitions (hda 1,2 3 &4) are
WinXP. If I look on "My Computer" it looks like the hard drive is set up as
2 drives - C & D. Hence my assumption that the 4 partitions relate to WinXP.
hda6 is SLED with the remaining partitions 5,7,8,&9 being allocated to
either Suse 10.1 or SLED. If this is the case then I assume that I would be
safe in deleting all partitions except 1.2. 3 & 4.

Am I correct in my assumptions or am I playing with fire deleting these
remaining partitions.

Can anyone tell me how to be sure that I am not deleting the XP partitions
or suggest how I can clean out 10.1 & SLED10

Alan

-------------------------------------------------------








More information about the AuckLUG mailing list If you have any questions or comments about this page, email the Webmaster
Design Copyright © 1998-2005 Linux.net.nz