パーティション/ dev / sda5を拡張しようとしています。は拡張パーティション/ dev / sda2の下の論理パーティションです。

fdisk を使用します。

手順は、両方のパーティションを削除してから、まったく同じ開始セクターでそれらを再作成することです(1001470 & 1001472)。最小の開始セクターがある論理パーティションを作成するまでは問題ありません。必要以上に大きい( 1003518 )。

 $ sudo fdisk /dev/sda Command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0cd7105f Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 16775167 15773698 7.5G 5 Extended /dev/sda5 1001472 16775167 15773696 7.5G 83 Linux Partition 5 has been deleted. Partition 2 has been deleted. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): e Partition number (2-4, default 2): First sector (999424-20479999, default 999424): 1001470 Last sector, +sectors or +size{K,M,G,T,P} (1001470-20479999, default 20479999): Created a new partition 2 of type "Extended" and of size 9.3 GiB. Command (m for help): n All space for primary partitions is in use. Adding logical partition 5 First sector (1003518-20479999, default 1003520): 1001472 Value out of range. 

parted で実行しましたが、fdiskで可能になるはずです。

$ fdisk -V fdisk from util-linux 2.27.1 

回答

通常のインターフェイスでは、Linuxのfdiskはパーティションに配置制約を適用します。どの制約はfdiskのバージョンによって異なります。 LBA と互換性のない古いオペレーティングシステムとの互換性のために、古いバージョンはデフォルトでシリンダーアライメントに設定されていました。 LBAが20年余り前の頃、fdiskはデフォルトでそのような古いシステムへの対応を停止し、代わりに1MBの配置に切り替えました。これにより、最新のストレージメディアでのパフォーマンスが向上します。

現在のバージョンのfdiskでは、任意のセクター(512B)の配置でパーティションを作成するには、最初に目的のエンドポイントでパーティションを作成してから、エキスパートメニュー(x)に移動し、コマンド

パーティションの開始位置を調整します(これにより、パーティションの終了位置ではなく、パーティションサイズが変更されます)。かなり不器用に見えます。

コメント

  • 魅力のように機能しました。 この場合でエキスパートモードが不要になった理由を詳しく説明していただけますか?
  • @ A.D。その場合、パーティションは1MBで整列されていたためです。
  • 本当です。整列されたパーティションを拡張しようとしましたが、エキスパートモードがなくても機能しました。

回答

Gilles “の回答に従って実行される手順:

 $ sudo fdisk /dev/sda Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0cd7105f Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 16775167 15773698 7.5G 5 Extended /dev/sda5 1001472 16775167 15773696 7.5G 83 Linux Command (m for help): d Partition number (1,2,5, default 5): 2 Partition 2 has been deleted. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): e Partition number (2-4, default 2): First sector (999424-20479999, default 999424): 1001470 Last sector, +sectors or +size{K,M,G,T,P} (1001470-20479999, default 20479999): Created a new partition 2 of type "Extended" and of size 9.3 GiB. Command (m for help): n All space for primary partitions is in use. Adding logical partition 5 First sector (1003518-20479999, default 1003520): Last sector, +sectors or +size{K,M,G,T,P} (1003520-20479999, default 20479999): Created a new partition 5 of type "Linux" and of size 9.3 GiB. Command (m for help): x Expert command (m for help): b Partition number (1,2,5, default 5): New beginning of data (1001471-20479999, default 1003520): 1001472 Expert command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x0cd7105f Device Boot Start End Sectors Id Type Start-C/H/S End-C/H/S Attrs /dev/sda1 * 2048 999423 997376 83 Linux 0/33/32 62/55/53 80 /dev/sda2 1001470 20479999 19478530 5 Extende 62/23/86 250/23/209 /dev/sda5 1001472 20479999 19478528 83 Linux 62/57/118 250/23/209 

次に、 r (メインメニューに戻る)と w (テーブルをディスクに書き込む)。

回答

Fdiskは古いプログラムであり、MBRパーティションのみを理解します。問題はディスクジオメトリ(ヘッド、トラックごとのセクター、トラック)の変更にあると思います。 ddコマンド(セクターからセクターへのコピー)を介して古いディスクから新しいディスクにパーティションがトラックの開始セクターに整列されていないため、fdiskでは、最初にトラックセクターの開始位置に整列される前に開始パーティションセクターを作成できません。古いディスク上。

拡張メニューのコマンドを使用して、fdiskプログラムで新しいディスクのジオメトリを変更することができますが、それは間違った方法です。古いfdiskの代わりにpartedおよびgpartedプログラムを使用してください。

今読んでいます書き込み速度は、各パーティションのトラックセクターを開始するための調整に依存しません。

コメント

  • 最新バージョンのfdiskはGPTも理解しますが、 'はここでは関係ありません。問題は'必ずしもディスクジオメトリを変更することではなく、fdisk 'の非エキスパートインターフェイスの制限だけです。
  • これはMBRです:Disklabel type: dos。 'が位置合わせされていないので、位置合わせしてから拡張しようとすると、partedが文句を言ったのを覚えています。 ' fdiskで同じ手順が実行され、機能していることを確認しました。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です