既存のディスクからRAID1を再構築し、別のディスクを追加します。

既存のディスクからRAID1を再構築し、別のディスクを追加します。

この質問は、上記で見ることができる他の質問を解決することによって得られます。このスレッド

簡単に言えば、私の専用サーバーには2x3TB HDDを搭載したRAID1アレイがあります。 1週間前、そのうちの1つが失敗しました。サーバーを所有する会社がサーバーを交換したため、すべてのデータを含む良好なドライブと完全に空の新しいドライブがあります。

あなたが持っているリソースにRAIDを再構築する方法がわかりません。

この情報は役に立ちます(今はRAIDがないことを知っています)。

root@rescue /dev # lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   2.7T  0 disk
sdb      8:16   0   2.7T  0 disk
├─sdb1   8:17   0     1M  0 part
├─sdb2   8:18   0   127M  0 part
├─sdb3   8:19   0   200M  0 part
├─sdb4   8:20   0   2.7T  0 part
└─sdb5   8:21   0 455.5K  0 part
loop0    7:0    0   1.5G  1 loop
root@rescue /dev # cat /proc/mdstat
Personalities : [raid1]
unused devices: <none>

アップデート1 クイック情報:

   CPU1: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (Cores 8)
   Memory:  15974 MB
   Disk /dev/sda: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table
   Disk /dev/sdb: 3000 GB (=> 2794 GiB)
   Total capacity 5589 GiB with 2 Disks

アップデート2:

Trinueが提案したように:

root@rescue ~ # lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)
00:1c.7 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation H67 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
03:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
05:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)

アップデート3:

@Kokoが提案したように4つのパーティションをマウントしようとしましたが、そのうち3つでエラーが発生しました。このディスクも故障しましたか?

root@rescue / # mount -o ro /dev/sdb1 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # mount -o ro /dev/sdb4 /mnt/disk
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to calculate free MFT records: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.
root@rescue / # mount -o ro /dev/sdb2 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # mount -o ro /dev/sdb3 /mnt/disk
root@rescue / # cd /mnt/disk
root@rescue /mnt/disk # dir
EFI

アップデート4:

Michael MartinezとKokoの提案に従って、sdbからsdaにデータをコピーしようとしましたが、次のエラーが発生しました。

root@rescue /mnt/disk # dd if=/dev/sdb of=/dev/sda
dd: reading `/dev/sdb': Input/output error
6619712+0 records in
6619712+0 records out
3389292544 bytes (3.4 GB) copied, 67.7475 s, 50.0 MB/s

アップデート5:

以下は、サーバー所有者が提供するガイドラインです。http://wiki.hetzner.de/index.php/Festplattenaustausch_im_Software-RAID/enサーバーの1つでHDDを交換するために使用されます。しかし、彼らが提供する例にはRAIDやパーティションがないことがわかります。

アップデート6:

Herznerはすでに私に次のように答えています。「ハードウェアRAIDコントローラを注文していないため、ソフトウェアRAIDがあります。」

アップデート7:

root@rescue / # mount /dev/sda1 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # mount /dev/sda2 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # mount /dev/sda3 /mnt/disk
root@rescue / # mount /dev/sda4 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # mount /dev/sda5 /mnt/disk
mount: you must specify the filesystem type
root@rescue / # cd /mnt/disk
root@rescue /mnt/disk # dir
EFI

アップデート8:

mount コマンドを実行する前に、ddsda に sdb をインストールし、次を使用して新しいアレイの作成を開始することを指摘する必要があります。

# mdadm --create root --level=1 --raid-devices=2 missing /dev/sdb1  
# mdadm --create swap --level=1 --raid-devices=2 missing /dev/sdb2

root@rescue / # mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=8176304k,nr_inodes=2044076,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
213.133.99.101:/nfs on /root/.oldroot/nfs type nfs (ro,noatime,vers=3,rsize=8192,wsize=8192,namlen=255,acregmin=600,acregmax=600,acdirmin=600,acdirmax=600,hard,nocto,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=213.133.99.101,mountvers=3,mountproto=tcp,local_lock=all,addr=213.133.99.101)
aufs on / type aufs (rw,relatime,si=1848aabe5590850f)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1635764k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=3271520k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)

アップデート9:

最初にサーバーが起動を拒否したときに、カスタマーサービスに手動で再起動するように依頼しました。彼らが私に与えた答えは次のようになりました。

親愛なるお客様に、サーバーを再起動しましたが、ハードドライブの1つにエラーが発生したようです。ご希望の場合は交換いたします。ドライブのデータ損失と約15分のダウンタイムを確認してください。あなたのサーバーは今構造システムにあります:

すぐにボットのウェブサイトにアクセスしたときにサーバーを管理し、構造システムに関する情報を検索できました。

リカバリシステムを有効にすると、DHCP サーバーに構成ファイルが生成されます。次に再起動すると、サーバーがネットワークから起動し、TFTPサーバーから最小オペレーティングシステムがロードされます。その後、必要に応じて構造システムを使用することができる。構造システムへのコマンドは60分間続きます。その後、サーバーを再起動すると、システムは通常ハードドライブから起動します。詳しくはWikiをご覧ください。

Rescueシステムは64ビットDebianです。

アップデート10

root@rescue ~/.oldroot/nfs # ls /root/.oldroot/nfs
bash_aliases                rescue32-wheezy-v006.ext2
check                       rescue32-wheezy-v007.ext2
copy-vnode-lvs-to           rescue32-wheezy-v008.ext2
copy-vnode-lvs-to.bak       rescue32-wheezy-v009.ext2
esxi                        rescue64-lenny-v004.ext2
firmware_update             rescue64-squeeze-v011.ext2
freebsd                     rescue64-squeeze-v012.ext2
functions.sh                rescue64-squeeze-v013.ext2
images                      rescue64-squeeze-v014.ext2
images.old                  rescue64-squeeze-v015.ext2
install                     rescue64-squeeze-v016.ext2
ipmi                        rescue64-test.ext2
iso                         rescue64-wheezy-v000.ext2
knoppix                     rescue64-wheezy-v001.ext2
lost+found                  rescue64-wheezy-v002.ext2
opensolaris                 rescue64-wheezy-v003.ext2
raid_ctrl                   rescue64-wheezy-v004.ext2
README                      rescue64-wheezy-v005.ext2
rescue32-lenny-v004.ext2    rescue64-wheezy-v006.ext2
rescue32-squeeze-v011.ext2  rescue64-wheezy-v007.ext2
rescue32-squeeze-v012.ext2  rescue64-wheezy-v008.ext2
rescue32-squeeze-v013.ext2  rescue64-wheezy-v009.ext2
rescue32-squeeze-v014.ext2  shutdown-h
rescue32-squeeze-v015.ext2  shutdown-h-now
rescue32-squeeze-v016.ext2  tightvnc-vkvm.tar.gz
rescue32-test.ext2          vkvm64-squeeze-v001.ext2
rescue32-wheezy-v000.ext2   vkvm64-squeeze-v002.ext2
rescue32-wheezy-v002.ext2   vkvm64-test.ext2
rescue32-wheezy-v003.ext2   vkvm64-v001.ext2
rescue32-wheezy-v004.ext2   vkvm64-wheezy-overlay.ext2
rescue32-wheezy-v005.ext2   vkvm64-wheezy-overlay-v001.ext2

アップデート11:

root@rescue ~ # fdisk -l /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 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: 0x8ab49420

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

アップデート12:

root@rescue ~ # parted -l
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? OK
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  1066kB  1049kB               LDM metadata partition
 2      1066kB  134MB   133MB                Microsoft reserved partition  msftres
 3      135MB   345MB   210MB   fat16        EFI system partition          boot
 4      345MB   3001GB  3000GB  ntfs         LDM data partition
 5      3001GB  3001GB  466kB                LDM data partition


Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  1066kB  1049kB               LDM metadata partition
 2      1066kB  134MB   133MB                Microsoft reserved partition  msftres
 3      135MB   345MB   210MB   fat16        EFI system partition          boot
 4      345MB   3001GB  3000GB  ntfs         LDM data partition
 5      3001GB  3001GB  466kB                LDM data partition


Model: Linux Software RAID Array (md)
Disk /dev/md126: 133MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End    Size   File system     Flags
 1      0.00B  133MB  133MB  linux-swap(v1)


Model: Linux Software RAID Array (md)
Disk /dev/md127: 983kB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End    Size   File system  Flags
 1      0.00B  983kB  983kB  ext4

ベストアンサー1

Hetznerと話し合うのにソフトウェアRAIDがあると言いました。問題はそうではないということです。これはあなたがcat /proc/mdstat言ったことです

Personalities : [raid1]

unused devices: <none>

これはソフトウェアRAIDがないことを意味します。破損したソフトウェアRAIDがある場合は、次のように表示されます。

Personalities : [raid1] 
md0 : active raid1 sdb1[1] (F) sda1[0]
      1020032 blocks [2/2] [_U]

md1 : active raid1 sda2[2] sdb2[1] (F)
      975739772 blocks super 1.1 [2/2] [_U]
      bitmap: 3/8 pages [12KB], 65536KB chunk

unused devices: <none>

私のサーバーから取得したものなので、いくつかの詳細は異なる場合があります。最後のハードドライブのエラーに関するメモに基づいて書き換えたため、いくつかの詳細が間違っている可能性がありますが、重要なのは

  1. [_U](これはミラーの1つが壊れていることを意味します。すべてがうまくいったら、次のように言います[UU]。)
  2. (F)(どの部分が失敗したかを知らせます。この場合、どちらの場合もパーティションです/dev/sdb。)

非常によく似たコンテンツを表示するためにリンクした独自のガイドラインです。

これが表示されたら、新しいハードドライブを既存のアレイに接続することは、新しいディスクを分割し、mdadmミラーにパーティションを追加することを使用する簡単な問題です。ただし、現在RAIDがないシステムがあるため、これを行うことはできません。

Hetznerに独自のドキュメントを参照して、なぜソフトウェアRAIDの兆候が見えないのか尋ねたいと思います。システムを完全に起動するには、MD RAID参照を削除する必要があるかもしれませんが、それを行うと、RAIDを回復する必要がある可能性があるすべての機能が混乱します。

あなたと言ったでしょう」Linuxとハードウェアに関するコンテンツの完全な初心者「正直なところ、問題があるのです。できるだけ早く専門家の助けを求めて、システムバックアップ中のダウンタイムに備えて、完全に再構築され、RAID化されたケースに完全に復元します。

おすすめ記事