Seite 1 von 1

Partition Windows XP

Verfasst: 26 Jan 2011, 14:21
von o.ferre
Hi,

i've got a question with the partition on windows XP.
When we install Windows XP with Opsi, all partitions are deleted ; but, some computers have 2 partitions (for ex. C: --> System and D: --> Data)
is it possible to install a Windows XP with Opsi without delete the other partition ?

thanks

O.Ferre

Re: Partition Windows XP

Verfasst: 26 Jan 2011, 16:22
von c.kampka
Hi,

yes, you can accomplish this by setting 'Repartition=no' in the unattended.txt file of your XP Product.
If you need more information about the unattended.txt file and unattended setup, I advise you to read up on Microsofts Documentation on that subject at http://technet.microsoft.com/en-us/libr ... 57100.aspx and http://technet.microsoft.com/en-us/libr ... S.10).aspx (Server2003 specific, but most of it should apply to XP as well).

Cheers,
Christian Kampka

Re: Partition Windows XP

Verfasst: 26 Jan 2011, 16:29
von o.ferre
OK ; thanks !
I thought that OPSI deleted the partition before charging the unattend !!

sorry, and thanks

O.ferre

Re: [SOLVED] Partition Windows XP

Verfasst: 27 Jan 2011, 10:11
von c.kampka
Hi again,

it is I who is sorry because as it turns out, you were right.
What you want to do takes a little more afford.
In addition to the unattend.txt you need to edit the setup.py script in your Windows XP product.

In there you will find a code block looking somewhat like this:

Code: Alles auswählen

# Get current partitions
partitions = disk.getPartitions()

if not partitions:
	# No partition found on harddisk
	scriptMessageSubject.setMessage(u"Keine Partitionen auf %s gefunden" % disk.device)
	
# Create new partitiontable
disk.deletePartitionTable()

# Partition table deleted => delete all netboot product states
backend.backend_setOptions( { 'addProductPropertyStateDefaults': False } )
deletePocs = []
for poc in backend.productOnClient_getObjects(clientId = clientId):
	if ((poc.productType == 'NetbootProduct') and (poc.productId != productId)) or \
	   ((poc.productType == 'LocalbootProduct') and (poc.installationStatus == 'not_installed') and (poc.actionRequest == 'none')):
		deletePocs.append(poc)
backend.productOnClient_deleteObjects(deletePocs)

# Create fat32 partition
disk.createPartition(start = "0", end = "100%", fs = "fat32", boot = True)

# Create fat32 filesystem on partition
disk.createFilesystem(partition = 1, fs = "fat32")

# Write Master Boot Record
disk.writeMasterBootRecord(system = 'winxp')

# Write Partition Boot Record
disk.writePartitionBootRecord(partition = 1, fsType = 'fat32nt')

# Mount partition
disk.mountPartition(partition = 1, mountpoint = target)
You can alter this code to reflect the partitioning layout you want.
What you'll want to avoid is of course deleting the partition table, and of course you don't need to recreate your partitions then, you just reuse the first partition as the installation medium.
Keep in mind however that the partitioning is done using a Linux system, so the first partition you get might not necessarily be your C: drive.
Also, you might run into several Windows related problems as Windows tends to prefer any NTFS partition over the first partition for its C: drive if the first partition is fat.

I strongly suggest you test any modifications to the setup.py thoroughly before using it in production.
If you need a more complete answer or a solution that is tailored to your needs, I recommend our commercial support options.

Cheers,
Christian Kampka

Re: [SOLVED] Partition Windows XP

Verfasst: 27 Jan 2011, 14:38
von o.ferre
Hi

thanks for your answer ; i've just tested this morning and the partitions are deleted before loading the unattend ;
so i'm going to modify the setup.py and try !

i will post the result of the test

thanks

o.ferre