複数のディスクを再分割し、ストレージを再割り当てします。

複数のディスクを再分割し、ストレージを再割り当てします。

Arch LinuxインストールCDからパーティションを分割しようとします。現在、オペレーティングシステムが破損しているため、これを行っています。

ランタイムはfdisk –l次のとおりです。

/dev/sda1 * start=2048 end=1026047 blocks=512000 id=83 system=linux     
/dev/sda2   start=10264048 end=625141759 blocks=312057856 id=8e system=linux LVM

すべてをきれいに消去し、/sda1OSのインストールのために15 GBをパーティション化し、残りを保持するため/sda2にパーティションを分割する必要があります。これを行うための最もクリーンで時間効率的な方法は何ですか?

これを行うために私が見つけた1つのオプションは、次のコマンドを使用することです。

dd if=/dev/zero of=/dev/sda

ただし、両方のディスクに対してこれを行う必要があるのか​​、一方のディスクまたは別のディスクに対してこれを行う必要があるのか​​は完全にはわかりません。これが私の問題を解決できるかどうかはわかりませんし、非常に時間がかかることがわかります。

誰でもこの状況を処理する方法についてのガイダンスを提供できますか?

ベストアンサー1

以下を実行しないでください。

  1. Arch LinuxインストールCDを起動します。
  2. ランニングfdisk /dev/sda

    linux-1reo:~ # fdisk /dev/sda
    The number of cylinders for this disk is set to 9729. 
    There is nothing wrong with that, but this is larger than 1024, 
    and could in certain setups cause problems with: 
    1) software that runs at boot time (e.g., old versions of LILO) 
    2) booting and partitioning software from other OSs 
       (e.g., DOS FDISK, OS/2 FDISK) 
    
    Command (m for help): 
    
  3. 既存のパーティションを削除するには、このオプションを使用しますd

  4. その後、すべてのパーティションを削除した後、このnオプションを使用して新しいパーティションを作成します。これが最初のパーティションになります/dev/sda1

    Command (m for help): n 
    First cylinder (7921-9729, default 7921): 
    Using default value 7921 
    Last cylinder or +size or +sizeM or +sizeK (7921-9729, default 9729): +15G
    
  5. 手順4を繰り返しますが、今回はデフォルトの選択を使用します。

  6. 次に、パーティションタイプが正しく設定されていることを再確認してください。すべて「Linux」でなければなりません。たとえば、

    Command (m for help): p 
    
    Disk /dev/sda: 80.0 GB, 80026361856 bytes 
    255 heads, 63 sectors/track, 9729 cylinders 
    Units = cylinders of 16065 * 512 = 8225280 bytes 
    
       Device Boot      Start         End      Blocks   Id  System 
    /dev/sda1   *           1        1402    11261533+   7  HPFS/NTFS 
    /dev/sda2            1403        1415      104422+  83  Linux 
    /dev/sda3            1416        1546     1052257+  82  Linux swap / Solaris 
    /dev/sda4            1547        9729    65729947+   5  Extended 
    /dev/sda5            1547        7920    51199123+  8e  Linux LVM 
    /dev/sda6            7921        8045     1004031   83  Linux 
    
  7. すべてが設定されたら、このオプションを使用して変更をディスクに書き込みますw

    Command (m for help): w 
    The partition table has been altered! 
    
    Calling ioctl() to re-read partition table. 
    
    WARNING: Re-reading the partition table failed with error 16: Device or resource busy. 
    The kernel still uses the old table. 
    The new table will be used at the next reboot. 
    Syncing disks. 
    
  8. mkfs.ext4 /dev/sda1最後のステップには、パーティションの使用とフォーマットが含まれますmkfs.ext4 /dev/sda2

引用する

おすすめ記事