PARTIZIONAMENTO DEI DISCHI

Introduzione alle partizioni

Quando il PC IBM fu lanciato per la prima volta, aveva un semplice sistema operativo chiamato MS-DOS, fornito dalla Microsoft. L'IBM decise che un PC poteva avere al massimo fino a quattro sistemi operativi installati allo stesso tempo. Ogni sistema operativo avrebbe avuto la sua propria porzione del disco, chiamata partizione. Per questa ragione, il primo settore di ogni disco su un PC, chiamato MBR (Master Boot Record), contiene una tavola con quattro entrate, ognuna delle quali indica i punti di inizio e fine delle quattro partizioni.

L'ordine delle quattro entrate nel MBR non deve necessariamente corrispondere all'ordine reale delle partizioni sul disco, e ci possono essere degli spazi vuoti tra le partizioni così come prima della prima e dopo l'ultima. Ci si rende quindi conto che nel peggiore dei casi un disco può avere fino a nove regioni: quattro partizioni e cinque spazi vuoti, come nella figura.

http://www.minix3.org/doc/part-1.jpg

E' anche possibile, per un singolo sistema operativo, utilizzare partizioni multiple. Per esempio, un utente potrebbe decidere di dividere il disco in due partizioni, una per il sistema operativo e una per i dati dell'utente. Questo metodo rende più semplice fare un back up dei dati senza dover fare il back up dell'intero sistema operativo. Rende anche più semplice installare una nuova versione del sistema operativo senza perdere i dati dell'utente.

Non passò molto tempo prima che l'IBM e la Microsoft decidessero che quattro partizione non erano sufficienti. Piuttosto che aumentare le dimensioni della tavola delle partizioni nel MBR (che l'avrebbe resa incompatibile con versioni precedenti del MS-DOS), si decise che fino a tre partizioni potevano essere marcate come ESTESE (EXTENDED), nel senso che avrebbero contenuto una o più sotto-partizioni, chiamate dispositivi logici (logical drives). Una partizione non estesa viene invece chiamata partizione primaria (primary partition). Insieme, le partizioni primarie ed estese comprendono le quattro partizioni di alto livello (top-level partitions).

Sfortunatamente, quasi tutti i software di partizionamento mostrano le partizioni primarie, estese e i dispositivi logici in modo tale da far pensare che siano tutti uguali. Questo non è sicuramente vero e crea molta confusione, dato che ogni dispositivo logico è una sotto-partizione di una qualche partizione estesa che lo comprende. In aggiunta, alcuni software di gestione delle partizioni mostrano le partizioni nell'ordine in cui esse appaiono nel MBR, piuttosto che nell'ordine degli indirizzi di disco.

MS-DOS e Windows normalmente sono configurati con una partizione primaria e opzionalmente una partizione estesa. Nella maggior parte dei casi, la partizione primaria è chiamata C: una partizione estesa, se presente, contiene D:, E: etc., a seconda di quanti dispositivi logici sono stati creati. Il vantaggio di porre D:, E:, etc dentro una partizione estesa, invece che allocare per ognuna di esse una partizione primaria, è che lascia gli slot della tavola delle partizioni del MBR disponibili per altri sistemi operativi. Nell'immagine si vede un esempio di disco con una partizione primaria (C:) e una partizione estesa che contiene due dispositivi logici (D: and E:).

http://www.minix3.org/doc/part-2.jpg

E' importante capire che il concetto di lettere dei dispositivi, come C:, è un concetto proprio di MS-DOS, in seguito adottato da Windows. Nessuna variante di UNIX, come BSD, Linux o MINIX 3, usa le lettere dei dispositivi. Tutti i sistemi UNIX si riferiscono semplicemente alle quattro partizioni di alto livello nel MBR.

Le partizioni e MINIX 3

Quando si installa MINIX 3, si ha a che fare con due risorse: partizioni e spazio libero del disco. MINIX 3 ha bisogno di una partizione (cioè una entrata della tavola del MBR) e di 200 MB di spazio libero contiguo. Logicamente, vale una delle seguenti condizioni:

Ogni caso deve essere trattato separatamente. Il primo è semplice. MINIX 3 può essere installato immediatamente. Durante la configurazione, verrà chiesto se lo spazio del disco può essere utilizzato e si dovrà dare il consenso. Il secondo caso è più difficile. Alcune partizioni esistenti devono essere cancellate o ridimensionate per liberare 200 MB di spazio. Il terzo e quarto caso richiedono di cancellare una partizione per liberare una entrata nella tavola del MBR. In aggiunta, una delle rimanenti partizioni dovrebbe essere ridimensionata per liberare spazio. E' da notare che se una partizione viene cancellata, tutti i dati su di essa saranno persi.

Un caso comune che molti principianti affrontano è il secondo: l'intero disco è occupato da una unica partizione primaria Windows, C:. Ci sono tre entrate disponibili nella tavola del MBR da scegliere per MINIX 3, ma non c'è spazio libero disponibile. L'unica soluzione è ridimensionare la partizione C: per liberare almeno 200 MB di spazio

Per cancellare o ridimensionare una partizione è necessario un programma chiamato editor delle partizioni. MINIX 3 ha un programma chiamato part, ma bisogna fare molta attenzione nel suo utilizzo, perché un semplice errore di battitura può portare alla cancellazione del disco.

Pur essendo tutto ciò abbastanza complicato, c'è una ulteriore complicazione che dobbiamo spiegare. Ogni partizione primaria o dispositivo logico contiene un file system. Le partizioni estese non contengono file system -- semplicemente contengono dispositivi logici. Imagine a car trunk (a disk) that can hold up to four boxes (partitions), each of which can contain a fragile bowl (file system) or one or more smaller boxes that each contain one bowl. An outer box with two bowls (a primary partition with two file systems) is not permitted.

Many different kinds of file systems exist. Windows alone supports four types: FAT-12, FAT-16, FAT-32, and NTFS. MINIX 3, Linux, BSD, and other UNIX systems each have one or more supported file system types. If all you want to do is delete an entire partition and free up all its disk space, then the type of file system it holds is irrelevant. The problem comes in when you want to resize (e.g., reduce) a partition to free up some disk space at the end. In order to resize a partition, the partition editor has to understand the internal layout of the file system on it and different partition editors understand different file system types.

In summary, you have to make sure you have a free partition (MBR table slot) and 200 MB of contiguous disk space. If you already have this, you can start installing MINIX 3 now. If you can achieve this situation by just deleting an existing partition, you can also start installing MINIX 3 now since the setup procedure allow you to delete partitions. However, if you first have to resize a partition, you need a partition editor that can resize the partition you have selected for reduction and you have to do this before starting the MINIX 3 installation using a partition editor that can handle the type of partition you want to resize.

How to Partition Your Disk

Before starting to manage your disk partitions, be sure to back up your files to CD-ROM or DVD to prevent losing them all in the event something goes wrong during the partitioning process. It has been known to happen. In what follows, we will assume you are running Windows, since most people running BSD or Linux have already encountered this problem and presumably now know how to partition disks.

What you have to do depends on whether you have enough free space and a free partition. Keep in mind that the goal is end up with at least one free partition and at least 200 MB of contiguous free disk space.

Step 1: Inspect the disk.

Determine how many partitions you have and what types they are. On Windows 95, 98, and ME, all partitions are FAT partitions. On Windows 2000 and XP they could be either FAT or NTFS, so proceed as follows:

Windows 2000
Click on Start
Click on 'Help'
Type 'disk management' in the dialog box
Double click on 'overview' in the left pane
Click on 'disk management' in the right pane

Windows XP
Click on Start
Click on 'Help and Support'
Type 'disk management' in the dialog box
Click on 'Using disk management' in the left pane
Click on 'Computer management (Local)' in the right pane
Click on 'Disk management' in the new window

Examine the display to determine the number of partitions, their types, and their sizes.

Step 2: Decide on a course of action.

If there is 200 MB of contiguous free space and not more than 3 partitions, you can begin installing MINIX 3 now. Similarly, if there are one or more partitions that you are willing to delete and whose removal will give you 200 MB of contiguous free space, you can also begin installation now. If all four top-level partitions are in use, you must select at least one for deletion. If there is a free partition (i.e., MBR table slot) but insufficient free disk space and you want to keep all partitions, you have to select a partition for resizing.

Step 3: Defragment the selected partition.

If a partition has to be resized to free up enough space, first defragment it to put all the data at the beginning and leave all the free space at the end to make resizing possible. Windows comes with a defragmenting program. The click sequence for starting the disk defragmenter is as follows:       Start > Programs > Accessories > System Tools > Disk defragmenter When the program starts, click on the partition to be defragmented and then click on 'Defragment.' Then defragment the same partition again as a second pass usually finds more fragments.

Step 4a: Resizing a FAT partition.

If you need to resize a partition, you need to find a suitable partition editor that can resize partitions of your chosen type. Some commercial ones are listed below, but we will focus on free partition editors here. If you need to resize a FAT partition, a good choice is Partition resizer. It is included on the MINIX 3 CD-ROM as presz134.zip. After downloading it or copying it from the CD-ROM, unzip it and copy presize.exe onto an MS-DOS floppy disk and boot the computer from this floppy. Then run presizer.exe. If you do not have MS-DOS, see if you have a Windows 95, 98, or ME boot floppy. Usually they are MS-DOS systems. On Windows XP, go to Windows Explorer and right click on A:, then select 'Format' from the menu. Check the 'Create an MS-DOS startup disk' box. Or get FreeDOS. If you do not have a floppy disk drive, use an NTFS partition resizer as described below.

Step 4b: Resizing an NTFS partition.

Several NTFS partition resizers exist, but they do not work on all computers, so you may have to try several before settling on one. Again, be sure to back up all your data before starting to resize. A commercial program that offers a free trial is BootIT NG. To use this one, click on 'Bootit Next Generation' in the 'Downloads' menu and save it to your hard disk as Bootitng.exe. Then proceed as follows:

Using Bootit NG

The main free alternative is to download, burn, and use a Live Linux CD containing a suitable partition editor. All of these work the same way: You first download a CD-ROM image containing a bootable Linux system. These images files are normally about 700 MB. Then you decompress the file if need be and burn it to a CD as a CD image file. Easy CD-Creator uses .iso files, but for Nero you have to change the extension to .nrg. Then you boot the computer and wait until setup completes. The result will be a running Linux system, albeit with nothing installed on the hard disk. Then you have to run the partition editor, qtparted, to resize a partition. Detailed instructions for MEPIS 3.3.1 are given below, but the others are similar. Again, before using any resizer, back up your data to CD-ROM or DVD.

Using MEPIS

Another approach is to use G-Parted. A final NTFS resizing option is to use the NTFSresize program from the command line, being very careful that you do not make a typing error. After the partition has been resized, you must use a partition editor to delete the partition (which only removes the MBR table entry), then immediately create a new partition of the reduced size in its place. If done right, the NTFS file system will be completely intact. This alternative is not for the faint of heart though. The manual for the ntfsresize program is here. Fortunately, several graphical front ends for it exist, making the process much easier.

If you are still having problems, subscribe to the USENET newsgroup comp.os.minix and post your question there. There is a good chance another MINIX 3 user can help you.

Web Resources

Minix3Wiki: PartizionamentoDeiDischi (last edited 2008-08-26 07:44:03 by zagadka)