サイドノート

サイドノート

そのため、RAID 1構成があり、ハードドライブの1つにエラーが発生しました。これでそれを置き換えて、次のコマンドを実行して最初の2つのパーティションを再構築しました。

mdadm /dev/md1 --manage --add /dev/sda1

そして

mdadm /dev/md2 --manage --add /dev/sdb2

どちらも再構築は大丈夫です。fdisk -lレポートは次のとおりです。

root@rescue:~# fdisk -l

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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: 0x00000000

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          4096   20975616   20971521    10G fd Linux raid autodetect
/dev/sda2         20975617 1464092672 1443117056 688.1G fd Linux raid autodetect
/dev/sda3       1464092673 1465144064    1051392 513.4M 82 Linux swap / Solaris

Disk /dev/sdb: 698.7 GiB, 750156374016 bytes, 1465149168 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: 0x00025c91

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sdb1  *          4096   20975616   20971521    10G fd Linux raid autodetect
/dev/sdb2         20975617 1464092672 1443117056 688.1G fd Linux raid autodetect
/dev/sdb3       1464092673 1465144064    1051392 513.4M 82 Linux swap / Solaris

Disk /dev/md2: 688.1 GiB, 738875867136 bytes, 1443116928 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
Disk /dev/md1: 10 GiB, 10737352704 bytes, 20971392 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

私もそうでした:

mkswap  /dev/sda3
swapon -a

ただし、入力するとfreeスワップはありません。

           total       used       free     shared    buffers     cached
Mem:       4025812     251340    3774472      11412      42456      63468
-/+ buffers/cache:     145416    3880396
Swap:            0          0          0

ベストアンサー1

swapon -a交換アイテムが追加されます/etc/fstab

次の行が必要です。

/dev/sda3    none    swap    sw      0 0

仕事swapon -a

あなたはできます一時的にスイッチングデバイスの追加

swapon /dev/sda3

しかし、この現象は再起動すると消えます。

サイドノート

あなたの交換がレイドに含まれていないことが確認されました。ディスクを紛失するとスワップが破損します。別の md 配列 (たとえばmd3) を構築し、sda3それsdb3md3スワップとして使用することをお勧めします。

私の場合

/dev/sda5              66         131      522240   fd  Linux raid autodetect
/dev/sdb5              66         131      522240   fd  Linux raid autodetect

これらはすべてmd3形式です

md3 : active raid1 sdb5[1] sda5[0]
      521920 blocks super 1.2 [2/2] [UU]

私は交換する

/dev/md3        swap       swap    defaults              0 0

おすすめ記事