Linux

cfdisk 還是 fdisk?

  • August 17, 2017

在閱讀手冊頁時,fdisk我遇到了這個有趣的文本:

周圍有幾個 *fdisk 程序。每個都有其問題和優勢。按 cfdisk、fdisk、sfdisk 的順序嘗試它們。(確實,cfdi​​sk 是一個漂亮的程序,它對它所接受的分區表有嚴格的要求,並產生高質量的分區表。如果可以的話,使用它。fdisk 是一個錯誤的程序,它會做一些模糊的事情——通常它會產生合理的結果。它的唯一優點是它對 BSD 磁碟標籤和其他非 DOS 分區表有一些支持。如果可以,請避免使用它。sfdisk 僅供黑客使用——使用者界面很糟糕,但它比 fdisk 和比 fdisk 和 cfdisk 更強大。此外,它可以非互動方式使用。)

我注意到兩個應用程序的選項格式不同:

- melancholy():/$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00036f1b

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    39063551    19530752   83  Linux
/dev/sda2        39063552   976771071   468853760   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00085251

  Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    15624191     7811072   82  Linux swap / Solaris
/dev/sdc2   *    15624192    64452607    24414208   83  Linux
/dev/sdc3        64454654  1953523711   944534529    5  Extended
Partition 3 does not start on physical sector boundary.
/dev/sdc5        64454656  1953523711   944534528   83  Linux
- melancholy():/$ sudo cfdisk -l
cfdisk: invalid option -- 'l'

Usage:
Print version:
       cfdisk -v
Print partition table:
       cfdisk -P {r|s|t} [options] device
Interactive use:
       cfdisk [options] device

Options:
-a: Use arrow instead of highlighting;
-z: Start with a zero partition table, instead of reading the pt from disk;
-c C -h H -s S: Override the kernel's idea of the number of cylinders,
               the number of heads and the number of sectors/track.

Copyright (C) 1994-2002 Kevin E. Martin & aeb

**cfdisk切換到 using而不是是否有真正的優點fdisk,或者手冊頁是否記錄了不再有效的歷史觀察?**由於fdisk可以很好地列出磁碟資訊(-l標誌),我應該cfdisk僅用於更改分區和分區表嗎?每個應用程序的真正優勢和劣勢是什麼?

cfdisk是一個圖形應用程序,旨在對新手更友好。如果您對 感到滿意fdisk,那麼請務必使用它。如果您喜歡更多的手握和更少的(高級)選項,請使用cfdisk. 另一個不錯的選擇是 GNU parted

引用自:https://unix.stackexchange.com/questions/194680