⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1266-1266.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:Administration and Privileged Commands:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=08 //-->

<!-- PAGES=1257-1422 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="1263-1265.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0000-0000.html">Next</A></CENTER></P>







<A NAME="PAGENUM-1266"><P>Page 1266</P></A>





<P><B>DESCRIPTION</B>

</P>



<P>cfdisk is a curses-based program for partitioning a hard disk drive. The device can be any one of the following:

<P>  



<!-- CODE SNIP //-->

<PRE>

/dev/hda [default]

/dev/hdb

/dev/sda

/dev/sdb

/dev/sdc

/dev/sdd

</PRE>

<!-- END CODE SNIP //-->



<P>cfdisk first tries to read the geometry of the hard disk. If it fails, an error message is displayed and

cfdisk exits. This should only happen when partitioning a SCSI drive on an adapter without a BIOS. To correct this problem, you can set

the cylinders, heads, and sectors-per-track on the command line. Next,

cfdisk tries to read the current partition table from

the disk drive. If it is unable to figure out the partition table, an error is displayed and the program exits. This might also

be caused by incorrect geometry information and can be overridden on the command line. Another way around this problem

is with the -z option. This will ignore the partition table on the disk.

</P> 





<P>The main display is composed of four sections, from top to bottom: the header, the partitions, the command line, and

a warning line. The header contains the program name and version number followed by the disk drive and its geometry.

The partitions section always displays the current partition table. The command line is the place where commands and text

are entered. The available commands are usually displayed in brackets. The warning line is usually empty except when there

is important information to be displayed. The current partition is highlighted with reverse video (or an arrow if the

-a option is given). All partition-specific commands apply to the current partition.

</P> 





<P>The format of the partition table in the partition's section is, from left to right: Name, Flags, Partition Type,

Filesystem Type, and Size. The name is the partition device name. The flags can be

Boot, which designates a bootable partition or NC, which stands for &quot;Not Compatible with DOS or OS/2.&quot; DOS, OS/2, and possibly other operating systems require the

first sector of the first partition on the disk and all logical partitions to begin on the second head. This wastes the second

through the last sector of the first track of the first head (the first sector is taken by the partition table itself).

cfdisk allows you to recover these &quot;lost&quot; sectors with the maximize command

(m). Note that fdisk(8) and some early versions of DOS create

all partitions with the number of sectors already maximized. For more information, see the maximize command later in

this chapter. The partition type can be Primary or

Logical. For unallocated space on the drive, the partition type can also

be Pri/Log or empty (if the space is unusable). The filesystem type section displays the name of the filesystem used on

the partition, if known. If it is unknown, then Unknown and the hex value of the filesystem type are displayed. A special

case occurs when there are sections of the disk drive that cannot be used (because all the primary partitions are used). When

this is detected, the filesystem type is displayed as

Unusable. The size field displays the size of the partition in megabytes

(by default). It can also display the size in sectors and cylinders (see the change units command later in this chapter). If

an asterisks (*) appears after the size, this means that the partition is not aligned on cylinder boundaries.

</P> 





<P><B>DOS 6.X WARNING</B>

</P> 



<P>The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition and treats

this information as more reliable than the information in the partition table.

DOS FORMAT expects DOS FDISK to clear the first

512 bytes of the data area of a partition whenever a size change occurs.

DOS FORMAT looks at this extra information even if the

/U flag is given; we consider this a bug in DOS

FORMAT and DOS FDISK.

</P> 





<P>The bottom line is that if you use cfdisk or

fdisk to change the size of a DOS partition table entry and then you must

also use dd to zero the first 512 bytes of that partition before using

DOS FORMAT to format the partition. For example, if you

were using cfdisk to make a DOS partition table entry for

/dev/hda1, then (after exiting fdisk or cfdisk and rebooting

Linux so that the partition table information is valid), you use the command

dd if=/dev/zero of=/dev/hda1 bs=512 count=1 to zero the first 512 bytes of the partition.

</P> 





<P>Be extremely careful if you use the dd command because a small typo can make all of the data on your disk useless.

</P> 





<P>For best results, you should always use an OS-specific partition table program. For example, you should make

DOS partitions with the DOS FDISK program and Linux partitions with the Linux

fdisk or Linux cfdisk program.

</P> 









<P><CENTER>

<a href="1263-1265.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0000-0000.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -