<HTML ><HEAD ><TITLE >Format the new disk</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.56"><LINK REL="HOME" TITLE="Hard Disk Upgrade Mini How-To" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Partition the new disk" HREF="partition.html"><LINK REL="NEXT" TITLE="Mount the new disk" HREF="mount.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Hard Disk Upgrade Mini How-To</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="partition.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="mount.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="FORMAT" >5. Format the new disk</A ></H1 ><P >Use the following command to format Linux partitions using ext2fs on the new disk: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >mkfs.ext2 /dev/hdb1</PRE ></TD ></TR ></TABLE ></P ><P >To check the disk for bad blocks (physical defects), add the <TT CLASS="OPTION" >-c</TT > option just before <TT CLASS="FILENAME" >/dev/hdb1</TT >.</P ><P >If the new disk will have more than one Linux partition, format the other partitions with <B CLASS="COMMAND" >mkfs.ext2 /dev/hdb2</B >, <B CLASS="COMMAND" >mkfs.ext2 /dev/hdb3</B >, and so on. Add the <TT CLASS="OPTION" >-c</TT > option if desired.</P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >Note: </B >With older distributions, the command <B CLASS="COMMAND" >mkfs -t ext2 -c /dev/hdb1</B > didn't check for bad blocks under any of Red Hat, Debian or Slackware, contrary to what the man page stated. This has now been fixed.</P ></BLOCKQUOTE ></DIV ><P >To format a swap partition, use this command: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >mkswap /dev/hdb1</PRE ></TD ></TR ></TABLE ></P ><P >Again, you can add the <TT CLASS="OPTION" >-c</TT > option before <TT CLASS="FILENAME" >/dev/hdb1</TT > to check for bad blocks.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="partition.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="mount.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Partition the new disk</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Mount the new disk</TD ></TR ></TABLE ></DIV ></BODY ></HTML >