sfdisk (分区表编辑器,具有附加功能,可以非交互方式运行)

瑞兹 发表于 2020-12-02 13:44
浏览次数:
在手机上阅读

在类似Unix的操作系统上,sfdisk命令是分区表编辑器。它类似于fdisk和cfdisk,但是具有附加功能。此外,与这两个程序不同,sfdisk可以非交互方式运行。

查看英文版

目录

1 sfdisk 运行系统环境

2 sfdisk 描述

3 sfdisk 语法

4 sfdisk 例子

sfdisk 运行系统环境

Unix&Linux

sfdisk 描述

sfdisk有四个(主要)用途:它可以列出分区的大小,列出设备上的分区,检查设备上的分区,并且-这非常危险!-它可以重新分区设备。

sfdisk无法理解GUID分区表(GPT)格式,并且不适用于大型分区。在这些情况下,请使用更高级的GNU parted

列出分区大小

以下命令:

sfdisk -s partition 

给出分区的大小(以块为单位)。与mkswap之类的程序结合使用时,可能会很有用。在这里,分区通常类似于/ dev / hda1/ dev / sdb12,但也可以是整个磁盘,例如/ dev / xda。以下示例命令和输出显示分区/ dev / hda9的大小:

sfdisk -s / dev / hda9
81599

如果省略partition 参数,则sfdisk将列出所有磁盘的大小以及总计:

sfdisk -s 
/dev/hda: 208896
/dev/hdb: 1025136
/dev/hdc: 1031063
/dev/sda: 8877895
/dev/sdb: 1758927
total: 12901917 blocks

列出分区

第二种调用方式:

sfdisk -ldevice

将列出指定设备上的分区。如果省略device参数,则会列出所有硬盘上的分区。以下示例列出了设备/ dev / hdc上的分区:

sfdisk -l / dev / hdc
Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hdc1          0+    406     407-   205096+  83  Linux native
/dev/hdc2        407     813     407    205128   83  Linux native
/dev/hdc3        814    2044    1231    620424   83  Linux native
/dev/hdc4          0       -       0         0    0  Empty

尾随的-+符号表示已进行四舍五入,并且实际值略小于或大于。要查看确切值,请要求以扇区为单位的列表(使用“ -u S ”选项)。

检查分区

第三类调用:

sfdisk -V device

将对设备上的分区表进行各种一致性检查。它要么打印“ OK”,要么抱怨。该-V选项一起使用-l。例如,在shell 脚本中,您可以使用

sfdisk -V -q device 

这只会返回设备的状态。

创建分区

第四类调用:

sfdisk device 

将导致sfdisk从标准输入读取所需设备分区的规范,然后更改该磁盘上的分区表。因此,可以从shell脚本中使用sfdisk。当sfdisk确定其标准输入是terminal时,它将是对话式的;否则,它将因任何错误而中止。

谨防。一键输入错误和所有数据丢失!

作为预防措施,您可以保存sfdisk更改的扇区:

%sfdisk / dev / hdd -O hdd-partition-sectors.save

然后,如果发现在将任何其他内容写入磁盘之前您做了一些愚蠢的操作,则可以使用以下方法恢复旧情况:

%sfdisk / dev / hdd -I hdd-partition-sectors.save

此命令与保存旧分区表不同:可以使用-d选项保存旧分区表的可读版本。但是,如果创建逻辑分区,则描述它们的扇区将位于磁盘上的某个位置,可能位于之前不属于分区表的扇区上。因此,-O选项保存的信息不是-d输出的二进制版本。

sfdisk has four (main) uses: it can list the size of a partition, list the partitions on a device, check the partitions on a device, and - this one is very dangerous! - it can repartition a device.

sfdisk doesn't understand the GUID Partition Table (GPT) format and it is not designed for large partitions. In these cases use the more advanced GNU parted.

Listing partition sizes

The following command:

sfdisk -s partition 

gives the size of partition in blocks. This may be useful in connection with programs like mkswap. Here partition is usually something like /dev/hda1 or /dev/sdb12, but may also be an entire disk, like /dev/xda. The following example command, and output, shows the size of partition /dev/hda9:

sfdisk -s /dev/hda9
81599

If the partition argument is omitted, sfdisk will list the sizes of all disks, and the total:

sfdisk -s
/dev/hda: 208896
/dev/hdb: 1025136
/dev/hdc: 1031063
/dev/sda: 8877895
/dev/sdb: 1758927
total: 12901917 blocks

Listing partitions

The second type of invocation:

sfdisk -l device

will list the partitions on the specified device. If the device argument is omitted, the partitions on all hard disks are listed. The following example lists the partitions on device /dev/hdc:

sfdisk -l /dev/hdc
Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hdc1          0+    406     407-   205096+  83  Linux native
/dev/hdc2        407     813     407    205128   83  Linux native
/dev/hdc3        814    2044    1231    620424   83  Linux native
/dev/hdc4          0       -       0         0    0  Empty

The trailing - and + signs indicate that rounding has taken place, and that the actual value is slightly less or more. To see the exact values, ask for a listing with sectors as the unit (using the "-u S" option).

Checking partitions

The third type of invocation:

sfdisk -V device

will apply various consistency checks to the partition tables on device. It either prints "OK", or complains. The -V option can be used together with -l. For example, in a shell script you could use

sfdisk -V -q device 

which would only return the status of device.

Creating partitions

The fourth type of invocation:

sfdisk device

will cause sfdisk to read the specification for the desired partitioning of device from standard input, and then to change the partition tables on that disk. Thus it is possible to use sfdisk from a shell script. When sfdisk determines that its standard input is a terminal, it will be conversational; otherwise it will abort on any error.

> BE EXTREMELY CAREFUL. ONE TYPING MISTAKE AND ALL YOUR DATA IS LOST!

As a precaution, you can save the sectors changed by sfdisk:

% sfdisk /dev/hdd -O hdd-partition-sectors.save

Then, if you discover that you did something stupid before anything else has been written to disk, it may be possible to recover the old situation with:

% sfdisk /dev/hdd -I hdd-partition-sectors.save

This command is not the same as saving the old partition table: a readable version of the old partition table can be saved using the -d option. However, if you create logical partitions, the sectors describing them are located somewhere on disk, possibly on sectors that were not part of the partition table before. Thus, the information the -O option saves is not a binary version of the output of -d.

查看英文版

查看中文版

sfdisk 语法

sfdisk [options] device
sfdisk -s [partition]

选件

sfdisk接受以下命令行选项:

-v,-- version 打印sfdisk的版本号并立即退出。
-h--help 打印使用情况消息并立即退出。
-T,-- list-types 打印识别的类型(系统ID)。
-s,-- show-size 列出分区的大小。
-g,-- show-geometry 列出内核对指定磁盘几何形状的想法。
-G,-- show-pt-geometry 列出通过查看分区表猜测的指示磁盘的几何形状。
-l--list 列出设备的分区。
-d,-- dump 以可用作/ fBsfdisk / fR输入的格式转储设备分区。例如,以下命令序列:

sfdisk -d / dev / hda> hda.out
sfdisk / dev / hda 
将纠正OS / 2 fdisk创建的错误的最后一个扩展分区。
-V--verify 测试分区是否正确。请参阅上面的第三种调用类型。
-i,--increment 数字圆柱等,从1而不是0开始
-N number 仅更改指示的单个分区。例如,以下sfdisk命令和列出的输入:

sfdisk / dev / hdb -N5
,,, *
将使/ dev / hdb上的第五个分区可启动(“活动”),并且保持不变。(也许第五个分区称为/ dev / hdb5,但是您可以随意调用其他名称,例如“ / my_equipment / disks / 2/5 ”)。
-A,--activate number 使指示的分区处于活动状态,而所有其他分区则处于非活动状态。
-c--id numberId ] 如果未提供Id参数:打印指定分区的分区ID。如果存在Id参数:将指示分区的类型(Id)更改为给定值。此选项有两种较长的形式,-- print-id--change-id。例如:

sfdisk --print-id / dev / hdb 5
6
sfdisk --change-id / dev / hdb 5 83
首先报告/ dev / hdb5具有ID 6,然后将其更改为83
-u,-- unit letter 解释输入并以字母指定的单位显示输出。此信可以是一个SCBM,这意味着Sectors,C ylinders,B锁和Megabytes,分别。默认为圆柱体,至少在已知几何体的情况下。
-x,-- show-extended 另外,在输出上列出非主要扩展分区,并在输入上为其提供描述符。
-C--cylinders cylinders 指定柱面数,可能会覆盖内核的想法。
-H,-- heads heads 指定头数,可能会覆盖内核的想法。
-S,-- sectors sectors 指定扇区数,可能会覆盖内核的想法。
-f--force 按我说的去做,即使那是愚蠢的。
-q,--quiet 禁止显示警告消息。
-L,-- Linux 不要抱怨与Linux不相关的事情。
-D,-- DOS 对于DOS兼容性:浪费一点空间。更精确地讲:如果一个分区不能包含扇区0,例如,因为它是设备的MBR,或者包含扩展分区的分区表,则sfdisk将使其开始下一个扇区。但是,给出此选项后,它会跳到下一个音轨的开头,例如,像某些特定版本的DOS那样,浪费了33个扇区(在34个扇区/音轨的情况下)。某些磁盘管理器和引导加载程序(例如OSBS,但不是LILO或OS / 2引导管理器)也位于此空白空间中,因此,如果您使用一个,则可能需要此选项。
-E,-- DOS-extended 取“内部”扩展分区的起始扇区号为相对于外部分区的起始柱体边界(如DOS的某些版本),而不是相对于实际的起始扇区(如Linux)。这里存在差异的事实意味着,如果DOS和Linux应该以相同的方式解释分区表,则应始终让扩展分区从圆柱边界开始。当然,只有知道DOS将用于此磁盘的几何图形时,才能知道圆柱边界在哪里。
--IBM--leave-last 某些IBM诊断程序假定它们可以使用磁盘上的最后一个柱面进行磁盘测试。如果您认为您可能曾经运行过此类程序,请使用此选项来告诉sfdisk它不应分配最后一个柱面。有时最后一个柱面包含一个坏扇区表。
-n 经历所有动作,但实际上不写入磁盘。
-R--re-read 仅执行BLKRRPART ioctl(以使内核重新读取分区表)。这对于提前检查最终的BLKRRPART是否成功以及在您手动更改分区表(例如,使用备份中的dd)时很有用。如果内核发出错误消息(“设备正忙于重新验证(使用= 2)”),则仍然有设备在使用该设备,并且您仍然必须卸载某些文件系统,或者说要交换到某些交换分区。
--no-reread 在开始对磁盘进行重新分区时,sfdisk会检查该磁盘是否未安装或正在用作交换设备,如果已安装,则拒绝继续。此选项禁止测试。另一方面,即使该测试失败,-f选项也会强制sfdisk继续运行。
--in-order 这是一个危险的选择。尚未记录。
--not-in-order 这是一个危险的选择。尚未记录。
--inside-outer 这是一个危险的选择。影响链接顺序。
--not-inside-outer 这是一个危险的选择。影响链接顺序。
--nested 这是一个危险的选择。每个分区都包含在周围的分区中,并且彼此不相交。
-chained 这是一个危险的选择。每个数据分区都包含在周围的分区中,并且与所有其他分区不相交,但是扩展分区可能位于外部(在all_logicals_inside_outermost_extended允许的范围内)。
--onesector 这是一个危险的选择。所有数据分区都是互不相交的;扩展分区每个仅使用一个扇区(也许最外面的一个除外)。
-O file 在写入新分区之前,将要覆盖的扇区输出到文件(希望文件驻留在另一个磁盘或软盘上)。
-I file 使用不幸的sfdisk命令销毁文件系统后,如果仅使用-O标志保存了旧情况,便能够恢复原来的情况。

技术细节和背景理论

磁盘的块0(主引导记录)除其他外还包含四个分区描述符。此处描述的分区称为主分区。

分区描述符具有6个字段:

struct partition {
	unsigned char bootable;        /* 0 or 0x80 */
	hsc begin_hsc;
	unsigned char id;
	hsc end_hsc;
	unsigned int starting_sector;
	unsigned int nr_of_sectors;
}

两个hsc字段指示分区开始和结束的磁头,扇区和柱面。由于每个hsc字段仅占用3个字节,因此仅24位可用,不足以用于大磁盘(例如> 8 GB)。实际上,由于浪费的表示方式(使用一个字节作为磁头数,通常为16),问题已经从0.5 GB开始。但是,Linux不使用这些字段,只有在启动Linux之前的引导时才会出现问题。有关更多详细信息,请参见LILO文档。

每个分区都有一个类型,即其“ Id”,如果此类型为5f(“扩展分区”),则该分区的起始扇区将再次包含4个分区描述符。MSDOS仅使用其中的前两个:第一个是实际的数据分区,第二个再次是扩展分区(或为空)。这样一来,便得到了一连串的扩展分区。其他操作系统的约定略有不同。Linux还接受与5f等效的类型85-如果希望在Linux下具有超过1024柱面边界的扩展分区而不使用DOS FDISK,这将很有用。挂。如果没有充分的理由,则应仅使用5,这是其他系统可以理解的。

非主要或扩展的分区称为逻辑分区。通常,不能从逻辑分区启动(因为查找逻辑分区的过程不仅仅是查看MBR,而是涉及更多的过程)。请注意,在扩展分区中,仅使用ID和开始。关于在其他字段中编写什么内容,有各种约定。人们不应该尝试使用扩展分区进行数据存储或交换。

输入格式

sfdisk读取以下形式的行

 

每行填充一个分区描述符。

字段之间用空格隔开,或者用逗号或分号隔开,可能后跟空格;初始和尾随空白将被忽略。数字可以是八进制,十进制或十六进制;默认为十进制。如果字段不存在或为空,则使用默认值。

所述部分可以(并且可能应该)被省略-sfdisk从计算他们和作为由内核给定或指定使用的磁盘几何-H-S-C标志。

可引导指定为[ * | - ],默认情况下不可引导。对于Linux,此字段的值无关紧要-当Linux运行时,它已经被引导-但对于某些引导加载程序和其他操作系统可能起作用。例如,当有几个主要的DOS分区时,DOS将C:分配给其中的第一个可引导分区。

Id以十六进制给出,不带0x前缀,或者为[ E | S | L | X ],其中LLINUX_NATIVE83)是默认值,SLINUX_SWAP82),EEXTENDED_PARTITION5),XLINUX_EXTENDED85)。

start的默认值为第一个未分配的扇区/圆柱体/ ...

size的默认值尽可能大(直到下一个分区或磁盘末尾)。

但是,对于扩展分区内的四个分区,默认值为:Linux分区,扩展分区,空,空。

但是,当给出-N选项(仅更改单个分区)时,每个字段的默认值为其先前的值。

可以指定' + '而不是数字来表示大小,这意味着要尽可能多。这对于-N选项很有用。

sfdisk [options] device
sfdisk -s [partition]

Options

sfdisk accepts the following command-line options:

-v--version Print version number of sfdisk and exit immediately.
-h--help Print a usage message and exit immediately.
-T--list-types Print the recognized types (system Id's).
-s--show-size List the size of a partition.
-g--show-geometry List the kernel's idea of the geometry of the indicated disk(s).
-G--show-pt-geometry List the geometry of the indicated disks guessed by looking at the partition table.
-l--list List the partitions of a device.
-d--dump Dump the partitions of a device in a format that is usable as input to /fBsfdisk/fR. For example, the following sequence of commands:

sfdisk -d /dev/hda > hda.out
sfdisk /dev/hda < hda.out
will correct the bad last extended partition that the OS/2 fdisk creates.
-V--verify Test whether partitions seem correct. See the third invocation type above.
-i--increment Number cylinders etc. starting from 1 instead of 0.
-N number Change only the single partition indicated. For example, the following sfdisk command, and the listed input:

sfdisk /dev/hdb -N5
,,,*
will make the fifth partition on /dev/hdb bootable ("active") and change nothing else. (Probably this fifth partition is called /dev/hdb5, but you are free to call it something else, like "/my_equipment/disks/2/5" or so).
-A--activate number Make the indicated partition(s) active, and all others inactive.
-c--id number [Id] If no Id argument given: print the partition Id of the indicated partition. If an Id argument is present: change the type (Id) of the indicated partition to the given value. This option has two longer forms, --print-id and --change-id. For example:

sfdisk --print-id /dev/hdb 5
6
sfdisk --change-id /dev/hdb 5 83
OK
first reports that /dev/hdb5 has Id 6, and then changes that into 83.
-u--unit letter Interpret the input and show the output in the units specified by letter. This letter can be one of SCB or M, meaning Sectors, Cylinders, Blocks and Megabytes, respectively. The default is cylinders, at least when the geometry is known.
-x--show-extended Also, list non-primary extended partitions on output, and expect descriptors for them on input.
-C--cylinders cylinders Specify the number of cylinders, possibly overriding what the kernel thinks.
-H--heads heads Specify the number of heads, possibly overriding what the kernel thinks.
-S--sectors sectors Specify the number of sectors, possibly overriding what the kernel thinks.
-f--force Do what I say, even if it is stupid.
-q--quiet Suppress warning messages.
-L--Linux Do not complain about things irrelevant for Linux.
-D--DOS For DOS-compatibility: waste a little space. More precisely: if a partition cannot contain sector 0, e.g., because that is the MBR of the device, or contains the partition table of an extended partition, then sfdisk would make it start the next sector. However, when this option is given it skips to the start of the next track, wasting for example 33 sectors (in case of 34 sectors/track), just like certain versions of DOS do. Certain Disk Managers and boot loaders (such as OSBS, but not LILO or the OS/2 Boot Manager) also live in this empty space, so maybe you want this option if you use one.
-E--DOS-extended Take the starting sector numbers of "inner" extended partitions to be relative to the starting cylinder boundary of the outer one (like some versions of DOS do), rather than relative to the actual starting sector (like Linux does). The fact that there is a difference here means that one should always let extended partitions start at cylinder boundaries if DOS and Linux should interpret the partition table in the same way. Of course one can only know where cylinder boundaries are when one knows what geometry DOS will use for this disk.
--IBM--leave-last Certain IBM diagnostic programs assume that they can use the last cylinder on a disk for disk-testing purposes. If you think you might ever run such programs, use this option to tell sfdisk that it should not allocate the last cylinder. Sometimes the last cylinder contains a bad sector table.
-n Go through all the motions, but do not actually write to disk.
-R--re-read Only execute the BLKRRPART ioctl (to make the kernel re-read the partition table). This can be useful for checking in advance that the final BLKRRPART will be successful, and also when you changed the partition table "by hand" (e.g., using dd from a backup). If the kernel complains ("device busy for revalidation (usage = 2)") then something still uses the device, and you still have to unmount some file system, or say swapoff to some swap partition.
--no-reread When starting a repartitioning of a disk, sfdisk checks that this disk is not mounted, or in use as a swap device, and refuses to continue if it is. This option suppresses the test. On the other hand, the -f option would force sfdisk to continue even when this test fails.
--in-order THIS IS A DANGEROUS OPTION. Not yet been documented.
--not-in-order THIS IS A DANGEROUS OPTION. Not yet been documented.
--inside-outer THIS IS A DANGEROUS OPTION. Affects chaining order.
--not-inside-outer THIS IS A DANGEROUS OPTION. Affects chaining order.
--nested THIS IS A DANGEROUS OPTION. Every partition is contained in the surrounding partitions and is disjoint from all others.
--chained THIS IS A DANGEROUS OPTION. Every data partition is contained in the surrounding partitions and disjoint from all others, but extended partitions may lie outside (insofar as allowed by all_logicals_inside_outermost_extended).
--onesector THIS IS A DANGEROUS OPTION. All data partitions are mutually disjoint; extended partitions each use one sector only (except perhaps for the outermost one).
-O file Just before writing the new partition, output the sectors that are going to be overwritten to file (where hopefully file resides on another disk, or on a floppy).
-I file After destroying your filesystems with an unfortunate sfdisk command, you would have been able to restore the old situation if only you had preserved it using the -O flag.

Technical Details And Background Theory

Block 0 of a disk (the Master Boot Record) contains among other things four partition descriptors. The partitions described here are called primary partitions.

A partition descriptor has 6 fields:

struct partition {
	unsigned char bootable;        /* 0 or 0x80 */
	hsc begin_hsc;
	unsigned char id;
	hsc end_hsc;
	unsigned int starting_sector;
	unsigned int nr_of_sectors;
}

The two hsc fields indicate head, sector and cylinder of the begin and the end of the partition. Since each hsc field only takes 3 bytes, only 24 bits are available, which does not suffice for big disks (say > 8 GB). In fact, due to the wasteful representation (that uses a byte for the number of heads, which is typically 16), problems already start with 0.5 GB. However, Linux does not use these fields, and problems can arise only at boot time, before Linux has been started. For more details, see your LILO documentation.

Each partition has a type, its "Id", and if this type is 5 or f ("extended partition") the starting sector of the partition again contains 4 partition descriptors. MSDOS only uses the first two of these: the first one an actual data partition, and the second one again an extended partition (or empty). In this way one gets a chain of extended partitions. Other operating systems have slightly different conventions. Linux also accepts type 85 as equivalent to 5 and f - this can be useful if one wants to have extended partitions under Linux past the 1024 cylinder boundary, without DOS FDISK hanging. If there is no good reason, you should just use 5, which is understood by other systems.

Partitions that are not primary or extended are called logical. Often, one cannot boot from logical partitions (because the process of finding them is more involved than just looking at the MBR). Note that of an extended partition only the Id and the start are used. There are various conventions about what to write in the other fields. One should not try to use extended partitions for data storage or swap.

Input Format

sfdisk reads lines of the form

 

where each line fills one partition descriptor.

Fields are separated by whitespace, or comma or semicolon possibly followed by whitespace; initial and trailing whitespace is ignored. Numbers can be octaldecimal or hexadecimal; decimal is default. When a field is absent or empty, a default value is used.

The  parts can (and probably should) be omitted - sfdisk computes them from  and  and the disk geometry as given by the kernel or specified using the -H-S-C flags.

Bootable is specified as [*|-], with as default not-bootable. The value of this field is irrelevant for Linux - when Linux runs it has been booted already - but might play a role for certain boot loaders and for other operating systems. For example, when there are several primary DOS partitions, DOS assigns C: to the first among these that is bootable.

Id is given in hex, without the 0x prefix, or is [E|S|L|X], where L (LINUX_NATIVE (83)) is the default, S is LINUX_SWAP (82), E is EXTENDED_PARTITION (5), and X is LINUX_EXTENDED (85).

The default value of start is the first nonassigned sector/cylinder/...

The default value of size is as much as possible (until next partition or end-of-disk).

However, for the four partitions inside an extended partition, the defaults are: Linux partition, Extended partition, Empty, Empty.

But when the -N option (change a single partition only) is given, the default for each field is its previous value.

A '+' can be specified instead of a number for size, which means as much as possible. This is useful with the -N option.

查看英文版

查看中文版

sfdisk 例子

sfdisk /dev/hdc << EOF
0,407
,407
;
;
EOF

如上所示,此命令(和列出的输入)将/dev / hdc分区。

sfdisk /dev/hdb << EOF
,3,L
,60,L
,19,S
,,E
,130,L
,130,L
,130,L
,,L
EOF

该命令(和列出的输入)将/dev / hdb分为两个Linux分区,分别为3个柱面和60个柱面,一个19个柱面的交换空间以及一个覆盖其余部分的扩展分区。在扩展分区内部,有四个Linux逻辑分区,其中130个柱面中的三个,一个覆盖其余部分。

使用-x选项,输入行数必须是4的倍数:您必须使用两个空行列出两个您不想使用的空分区。如果不使用-x选项,则将扩展分区内的分区的一行而不是四行,并以文件结尾(^D)结尾。和了sfdisk假设你输入线代表第一四,第二一个被扩展,并且第三和第四是空的。

sfdisk /dev/hdc << EOF
0,407
,407
;
;
EOF

This command (and the listed input) partitions /dev/hdc just as indicated above.

sfdisk /dev/hdb << EOF
,3,L
,60,L
,19,S
,,E
,130,L
,130,L
,130,L
,,L
EOF

This command (and the listed input) will partition /dev/hdb into two Linux partitions of 3 and 60 cylinders, a swap space of 19 cylinders, and an extended partition covering the rest. Inside the extended partition there are four Linux logical partitions, three of 130 cylinders and one covering the rest.

With the -x option, the number of input lines must be a multiple of 4: you have to list the two empty partitions that you never want using two blank lines. Without the -x option, you give one line for the partitions inside an extended partition, instead of four, and terminate with end-of-file (^D). And sfdisk will assume that your input line represents the first of four, that the second one is extended, and the 3rd and 4th are empty.

查看英文版

查看中文版

其他命令行

sysklogd | s2p | service | sag | set | setenv | setfacl | sha224sum | sha256sum | sha384sum | sha512sum | shutdown | sleep | stat | startx | strftime | strip | swapoff | shred |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条