<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
Ho scritto un breve articolo su come utilizzare fdisk per partizionare un hard disk, spero vi piaccia.<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
__________________<BR>
<B><I>Carlo Caponi</I></B><BR>
<A HREF="http://www.karolvs.it">www.karolvs.it</A><BR>
<TT><FONT SIZE="1">Registered Linux User #392368</FONT></TT><BR>
<FONT SIZE="1">ICQ #73707983</FONT>
</TD>
</TR>
</TABLE>
<BR>
<FONT SIZE="2">Per usare un hard disk &#232; necessario compiere le seguenti operazioni:</FONT><BR>
<BR>
<OL TYPE=1>
    <LI TYPE=1 VALUE=1><FONT SIZE="2">Partizionare l'hard disk.</FONT><BR>
    <BR>
    <LI TYPE=1 VALUE=2><FONT SIZE="2">Assegnargli un file system.</FONT><BR>
    <BR>
    <LI TYPE=1 VALUE=3><FONT SIZE="2">Montare il file system.</FONT><BR>
    <BR>
</OL>
<BR>
<FONT SIZE="2">Una </FONT><I><FONT SIZE="2">partizione del disco</FONT></I><FONT SIZE="2"> &#232; una parte di disco che contiene una struttura di directory, specificando quale sistema operativo potr&#224; usarla. Sullo stesso hd possono infatti coesistere pi&#249; sistemi operativi, ad esempio Windows o Linux.</FONT><BR>
<BR>
<FONT SIZE="2">I PC gestiscono gli HD mediante due interfacce, dette ATA( Advanced Technology Attachment): interfaccia primaria e secondaria. Ognuna di queste permette di gestire due HD in collegamento master-slave, per un totale di 4 periferiche a disco. Le assegnazioni standard dei dischi ATA sono contenute in /dev:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">/dev/hda disco master, interfaccia primaria.</FONT><BR>
<BR>
<FONT SIZE="2">/dev/ddb disco slave, interfaccia primaria.</FONT><BR>
<BR>
<FONT SIZE="2">/dev/hdc disco master, interfaccia secondaria.</FONT><BR>
<BR>
<FONT SIZE="2">/dev/hdd disco slave, interfaccia secondaria.</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">Per esaminare e scrivere partizioni occorre usare il comando fdisk:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">~$sudo fdisk /dev/hd&lt;a-d&gt;</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">Una volta entrati nel programma si possono usare i comandi seguenti:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">p : </FONT><BR>
<BR>
<FONT SIZE="2">elenco delle partizioni con relativa descrizione.</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">d : </FONT><BR>
<BR>
<FONT SIZE="2">cancella una partizione. Verr&#224; chiesto quale partizione eliminare, le partizioni sono numerate a partire da 1.</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">n : </FONT><BR>
<BR>
<FONT SIZE="2">crea una nuova partizione. Verr&#224; chiesto se si vuole creare una partizione estesa (e) o una partizione primaria (p). Questo &#232; un vecchio retagggio del fatto che in origine il partizionamento standard dei PC consentiva solo un massimo di quattro partizioni, da 1 a 4, dette </FONT><I><FONT SIZE="2">partizioni primarie</FONT></I><FONT SIZE="2">. Se si desiderano altre partizioni, queste possono essere definite come </FONT><I><FONT SIZE="2">partizioni estese</FONT></I><FONT SIZE="2">, consentendovi cos&#236; di inserire sottopartizioni al loro interno, dette </FONT><I><FONT SIZE="2">partizioni logiche</FONT></I><FONT SIZE="2">. Una volta dato il comando n, per creare una partizione devono essere dati in sequenza i comandi seguenti:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">t:</FONT><BR>
<BR>
<FONT SIZE="2">specifica un id di sistema, ossia il numero che rappresenta un sistema operativo. Linux usa 83 per le partizioni contenenti file, 82 per i file di swap.</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">w:</FONT><BR>
<BR>
<FONT SIZE="2">rende effettive le modifiche. Fino a quando non viene dato questo comando le modifiche sono solo &#8220;virtuali&#8221;, prima di eseguirlo controllare che sia tutto a posto mediante il comando p. Ricordare di eseguire w solo dopo aver controllato che il file system dell'HD in questione non sia gi&#224; </FONT><I><FONT SIZE="2">montato</FONT></I><FONT SIZE="2">.</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">q:</FONT><BR>
<BR>
<FONT SIZE="2">esce da fdisk, se ancora non &#232; stato dato il comando w, esce senza che fdisk esegua alcuna modifica.</FONT><BR>
<BR>
<FONT SIZE="2">Vediamo ad esempio l'elenco delle partizioni dell'HD slave dell'interfaccia secondaria:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">~$ sudo fdisk /dev/hdb</FONT><BR>
<BR>
<FONT SIZE="2">Password:</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">The number of cylinders for this disk is set to 24792.</FONT><BR>
<BR>
<FONT SIZE="2">There is nothing wrong with that, but this is larger than 1024,</FONT><BR>
<BR>
<FONT SIZE="2">and could in certain setups cause problems with:</FONT><BR>
<BR>
<FONT SIZE="2">1) software that runs at boot time (e.g., old versions of LILO)</FONT><BR>
<BR>
<FONT SIZE="2">2) booting and partitioning software from other OSs</FONT><BR>
<BR>
<FONT SIZE="2">(e.g., DOS FDISK, OS/2 FDISK)</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">Comando (m per richiamare la guida): p</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">Disk /dev/hdb: 203.9 GB, 203928109056 bytes</FONT><BR>
<BR>
<FONT SIZE="2">255 heads, 63 sectors/track, 24792 cylinders</FONT><BR>
<BR>
<FONT SIZE="2">Units = cilindri of 16065 * 512 = 8225280 bytes</FONT><BR>
<BR>
<BR>
<FONT SIZE="2">Dispositivo Boot Start End Blocks Id System</FONT><BR>
<BR>
<FONT SIZE="2">/dev/hdb1 * 1 24419 196145586 83 Linux</FONT><BR>
<BR>
<FONT SIZE="2">/dev/hdb2 24420 24792 2996122+ 5 Esteso</FONT><BR>
<BR>
<FONT SIZE="2">/dev/hdb5 24420 24792 2996091 82 Linux swap / Solaris</FONT><BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>