成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

fdisk 中文man頁面

系統
硬盤可以被分成一個或多個邏輯磁盤,稱為 分區。 這些分區信息都存放在硬盤0扇區的 分區表 中。

NAME

fdisk - Linux分區表操作工具軟件  

總覽

fdisk [-u]設備名

fdisk -l [-u] [設備名 ...]

fdisk -s分區 ...

fdisk -v  

描述

硬盤可以被分成一個或多個邏輯磁盤,稱為 分區。 這些分區信息都存放在硬盤0扇區的 分區表 中。

在 BSD 風格中,分區被稱為“磁盤片”和“磁盤標簽”

Linux 至少需要一個分區,即用做它的 root 文件系統。 Linux 可以使用交換文件和/或交換分區,交換分區更有效。因此,通常用戶會創建第二個 Linux 分區供交換分區使用。在 Intel 兼容的硬件上,啟動系統的 BIOS 往往只能訪問 1024 柱面之前的硬盤。因此,使用大硬盤的用戶通常創建第三個只有幾兆大小的小分區,通常用來裝配在 /boot ,用來存放內核映象和一些其它啟動時需要的附屬文件,所以應確保此分區必須是在BIOS可訪問的部分。出于安全方面的考慮、管理方面的原因、備份的需要或為了某些測試,也可以將一個硬盤分成更多的分區使用。

fdisk (以第一種形式調用)是一個以菜單問答形式出現的用來創建和修改分區的程序。它可以辯認 DOS 類型的分區表和 BSD 或 SUN 類型的磁盤標簽。

設備 通常是下列之一:
 

/dev/hda /dev/hdb /dev/sda /dev/sdb

(/dev/hd[a-h] 指 IDE 硬盤,/dev/sd[a-p] 指 SCSI 硬盤, /dev/ed[a-d] 指 ESDI 硬盤,/dev/xd[ab] 指 XT 硬盤)。設備名指整個硬盤設備。

分區 是在 設備名 后跟一個分區號。例如: /dev/hda1 是指系統在第一個 IDE 硬盤上的第一個分區。 IDE 硬盤可以最多創建 63 個分區,SCSI 可以創建 15 個。又見 /usr/src/linux/Documnetation/devices.txt

一個 BSD/SUN 風格的磁盤標簽可以描述 8 個分區,其中第三個應該是“整個磁盤”分區。不要在零柱面使用那些的確使用其第一扇區的分區,(比如交換分區)因為這將損壞磁盤標簽。

一個 IRIX/SGI 風格的磁盤標簽可以描述 16 個分區,其中第十一個應該是完整“卷標”分區,而第九個應該被標成“卷標頭”。卷標頭將覆蓋分區表,即,它從零塊開始并缺省時延伸 5 個柱面。卷標頭中余下的空間可以用來存放頭部目錄記錄信息。不要有任何分區與此卷標頭重疊。同樣,也不要改變它的類形和在其中創建任何文件系統,因為這樣做將丟失分區表信息。只有當將 Linux 安裝在 IRIX/SGI 機器上或在 Linux 中使用 IRIX/SGI 磁盤時才會使用這種類形的標簽。

一個 DOS 風格的分區表可以描述無限的分區。零扇區用來存放 4 個分區(稱為主分區)的描述信息。其中可以有一個分區是擴展分區;此擴展分區也就是存儲各邏輯分區地方,是一個在組成鏈表的扇區里存放的描述符,每個描述符都是一個對應分區的開頭.四個主分區,不管是否存在,都用數字 1-4 編號,而邏輯分區以 5 開始。

在 DOS 風格的分區表中,開始地址偏移量和每個分區的大小是以兩種不同的方式來存放的:以扇區數的絕對值來描述(占 32 位)和以柱面、磁頭、扇區三個一組的形式(占 10+8+6 個位)來描述。前一種描述很好 - 如果每扇區 512 個字節的情況,這種方式可描述到 2TB 的大小。后一種方式有兩個不同的問題。第一個是這種 C/H/S 方式必須是在磁頭數和每磁道扇區數都已知的情況下才能使用。第二個是就算我們已經知道了這些數字,而只用 24 位來描述這些信息也是不夠的。 DOS 只使用這種 C/H/S 的方式,Windows 則兩個都用,Linux 則不使用 C/H/S 的方式。

如果可能, fdisk 會自動獲得磁盤的幾何結構。這不一定是磁盤的物理結構(當然,現在的磁盤沒有真正的物理結構,同樣也不能以簡單的柱面/磁頭/扇區的形式來描述),而是 MS-DOS 用來供分區表使用的幾何結構。

通常,缺省時這些都將工作得很好,而且,如果磁盤上只有一個 Linux 操作系統時也不會有任何問題。然而,如果磁盤上還有其它操作系統,那么,用其它操作系統的 fdisk 來生成其自身使用的至少一個分區是比較好的選擇。當Linux啟動的時侯,它會掃描分區表,并由此推出和其它共存操作系統友好合作所需的(偽)幾何結構。

當打印一個分區表時,系統會對分區表進行一次一至性檢查。這些檢查會驗證磁盤幾何結構和物理地址的開始、結束、指向和標識,同時在柱面的邊界檢查分區的開始和結束。(除了第一個分區)

一些版本的 MS-DOS 在創建第一個分區時并不是從柱面邊界的開始處,而是從第一柱面的第 2 扇區處開始。從柱面 1 開始的分區不能直接從柱面邊界開始,但這未必會造成困難,除非你在你的機器上安裝了 OS/2 操作系統。

當執行了對分區表的更新后退出時,程序會運行一次 sync() 和 BLKRRPART ioct1() (從磁盤上重讀分區表信息)。以前,在使用完 fdisk 后需要重啟系統。我認為現在不需要這樣了 -- 太快的重起可能導致未寫入磁盤的數據丟失。注意,內核和磁盤硬件都可能緩存數據。

DOS6.x WARNING

DOS6.x 的 FORMAT 命令會在分區的第一扇區的數據區查找一些信息,并認為這些信息比分區表中的信息更可靠。 DOS 的 FORMAT 命令認為 DOS 的 FDISK 命令會在分區變化時自動清除分區數據區的前 512 字節區域。 DOS 的 FORMAT 將查看這些額外的信息,甚至在給出了 /U 這個參數后也是如此。我們認為這是 DOS FORMAT 和 DOS FDISK 的臭蟲。

如果你使用 cfdisk 或 fdisk 更改了 DOS 分區表的條目,你必須同時使用 dd 命令將該分區的前512個字節清零,之后,你才能使用 DOS 的 FORMAT 命令對這個分區進行格式化。例如:如果你使用 cfdisk 去創建一個 DOS 分區表項目,即分區 /dev/hda1,然后(在退出 fdisk 或 cfdisk 后重啟 Linux 使分區表合法化)你就有必要使用如下命令 “dd if=/dev/ero of=/dev/hda1 bs=512 count=1” 來將分區的前 512 個字節清零。

當你使用 dd 命令時請 務必萬分小心 , 由于任何小的打印錯誤都將造成磁盤數據的失效。

最好你還是使用由操作系統指定的分區工具軟件。例如,當你創建 DOS 分區時應使用 DOS FDISK,而創建 Linux 分區時則使用 Linux 的 fdisk 或 cfdisk。

選項

-v
打印 fdisk 的版本信息并退出.
-l
列出指定設備的分區表信息并退出。如果沒有給出設備,那么使用那些在 /proc/partitions (如果存在)提到的.
-u
以扇區數而不是以柱面數的形式顯示分區表中各分區的信息. -s 分區 將分區的 大小 (單位為塊)信息輸出到標準輸出

#p#

NAME

fdisk - Partition table manipulator for Linux  

SYNOPSIS

fdisk [-u] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device

fdisk -l [-u] [device ...]

fdisk -s partition ...

fdisk -v  

DESCRIPTION

Hard disks can be divided into one or more logical disks called partitions. This division is described in the partition table found in sector 0 of the disk.

In the BSD world one talks about `disk slices' and a `disklabel'.

Linux needs at least one partition, namely for its root file system. It can use swap files and/or swap partitions, but the latter are more efficient. So, usually one will want a second Linux partition dedicated as swap partition. On Intel compatible hardware, the BIOS that boots the system can often only access the first 1024 cylinders of the disk. For this reason people with large disks often create a third partition, just a few MB large, typically mounted on /boot, to store the kernel image and a few auxiliary files needed at boot time, so as to make sure that this stuff is accessible to the BIOS. There may be reasons of security, ease of administration and backup, or testing, to use more than the minimum number of partitions.

fdisk (in the first form of invocation) is a menu driven program for creation and manipulation of partition tables. It understands DOS type partition tables and BSD or SUN type disklabels.

The device is usually one of the following:
 

/dev/hda /dev/hdb /dev/sda /dev/sdb

(/dev/hd[a-h] for IDE disks, /dev/sd[a-p] for SCSI disks, /dev/ed[a-d] for ESDI disks, /dev/xd[ab] for XT disks). A device name refers to the entire disk.

The partition is a device name followed by a partition number. For example, /dev/hda1 is the first partition on the first IDE hard disk in the system. Disks can have up to 15 partitions. See also /usr/src/linux/Documentation/devices.txt.

A BSD/SUN type disklabel can describe 8 partitions, the third of which should be a `whole disk' partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel.

An IRIX/SGI type disklabel can describe 16 partitions, the eleventh of which should be an entire `volume' partition, while the ninth should be labeled `volume header'. The volume header will also cover the partition table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type and make some file system on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.

A DOS type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called `primary'). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1-4. Logical partitions start numbering from 5.

In a DOS type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits) and as a Cylinders/Heads/Sectors triple (given in 10+8+6 bits). The former is OK - with 512-byte sectors this will work up to 2 TB. The latter has two different problems. First of all, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. Secondly, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S.

If possible, fdisk will obtain the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in simplistic Cylinders/Heads/Sectors form), but is the disk geometry that MS-DOS uses for the partition table.

Usually all goes well by default, and there are no problems if Linux is the only system on the disk. However, if the disk has to be shared with other operating systems, it is often a good idea to let an fdisk from another operating system make at least one partition. When Linux boots it looks at the partition table, and tries to deduce what (fake) geometry is required for good cooperation with other systems.

Whenever a partition table is printed out, a consistency check is performed on the partition table entries. This check verifies that the physical and logical start and end points are identical, and that the partition starts and ends on a cylinder boundary (except for the first partition).

Some versions of MS-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.

A sync() and a BLKRRPART ioctl() (reread partition table from disk) are performed before exiting when the partition table has been updated. Long ago it used to be necessary to reboot after the use of fdisk. I do not think this is the case anymore - indeed, rebooting too quickly might cause loss of not-yet-written data. Note that both the kernel and the disk hardware may buffer data.

DOS 6.x WARNING

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 will look at this extra information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.

The bottom line is that if you use fdisk to change the size of a DOS partition table entry, 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 disk to make a DOS partition table entry for /dev/hda1, then (after exiting fdisk and rebooting Linux so that the partition table information is valid) you would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero the first 512 bytes of the partition.

BE EXTREMELY CAREFUL if you use the dd command, since a small typo can make all of the data on your disk useless.

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 program.

OPTIONS

-b sectorsize
Specify the sector size of the disk. Valid values are 512, 1024, or 2048. (Recent kernels know the sector size. Use this only on old kernels or to override the kernel's ideas.)
-C cyls
Specify the number of cylinders of the disk. I have no idea why anybody would want to do so.
-H heads
Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
-S sects
Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
-l
List the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if that exists) are used.
-u
When listing partition tables, give sizes in sectors instead of cylinders.
-s partition
The size of the partition (in blocks) is printed on the standard output.
-v
Print version number of fdisk program and exit.
責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man

2011-08-12 13:54:46

hostname中文man

2011-08-12 14:53:56

kill中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 老牛嫩草一区二区三区av | 欧美精品一区二区在线观看 | 999久久久| 日韩精品 电影一区 亚洲 | 国内精品视频免费观看 | 91免费电影 | 国产精品高清一区二区三区 | 欧日韩不卡在线视频 | 午夜免费视频 | 在线播放一区二区三区 | 剑来高清在线观看 | 亚洲精品国产a久久久久久 午夜影院网站 | 日韩在线小视频 | 久久久久久久香蕉 | 超碰精品在线 | 久久久久久久综合色一本 | 欧美综合久久 | 97精品国产97久久久久久免费 | 精品一区二区三区在线观看 | 玖玖操 | www.操.com| 国产一二三区在线 | 日韩综合 | 亚洲人成人一区二区在线观看 | 精品视频一区二区在线观看 | 久久久视频在线 | 精品国产1区2区3区 一区二区手机在线 | 91精品久久久久 | 成人一区二区三区在线观看 | 国产欧美日韩一区二区三区 | 精品综合久久 | 91麻豆精品一区二区三区 | av国产精品 | 成人在线a | 亚洲视频中文字幕 | 久久一本 | 久久久精品网站 | 91视频在线网站 | 成年人视频免费在线观看 | 欧美一级大黄 | 日本淫视频 |