Linux

RAID-1 鏡像變成了單硬碟

  • July 31, 2014

我有一個 HP N40L 微伺服器,有 2 個相同的驅動器,我使用系統將它們作為鏡像進行硬體 RAID。大約一年前,我在系統上安裝了 mint。

在我升級到 Mint 17 之前,它一直在完美執行、更新等。

我認為一切都很好,但我注意到 mint 只使用 1 個驅動器啟動,然後由於某種原因顯示另一個驅動器的內容。

即它啟動sdb1,但df顯示sda1。我肯定 df曾經展示過一個/dev/mapper/pdc_bejigbccdb1驅動器,它是 RAID 陣列。因此,對 Grub 的任何更新都會轉到sda1,但它會啟動sdb1然後載入 fs sda1

N40L marty # df
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda1      233159608 113675036 107617644  52% /
none                   4         0         4   0% /sys/fs/cgroup
/dev             2943932        12   2943920   1% /media/sda1/dev
tmpfs             597588      1232    596356   1% /run
none                5120         0      5120   0% /run/lock
none             2987920         0   2987920   0% /run/shm
none              102400         4    102396   1% /run/user

cat /etc/fstab

N40L marty # cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/mapper/pdc_bejigbccdb1 /               ext4    errors=remount-ro 0       1
/dev/mapper/pdc_bejigbccdb5 none            swap    sw              0       0

如果我這樣做,ls /dev/mapper/我會得到

N40L marty # ls /dev/mapper
total 0
crw------- 1 root root 10, 236 Jul 24 17:03 control

我如何讓我的突襲回來,我如何讓 grub 啟動它?


進一步更新:

N40L grub # dmraid -r
/dev/sdb: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0
/dev/sda: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0

N40L grub # dmraid -s
*** Set
name   : pdc_bejigbccdb
size   : 486328064
stride : 128
type   : mirror
status : ok
subsets: 0
devs   : 2
spares : 0

N40L grub # dmraid -ay -vvv -d
WARN: locking /var/lock/dmraid/.lock
NOTICE: /dev/sdb: asr     discovering
NOTICE: /dev/sdb: ddf1    discovering
NOTICE: /dev/sdb: hpt37x  discovering
NOTICE: /dev/sdb: hpt45x  discovering
NOTICE: /dev/sdb: isw     discovering
DEBUG: not isw at 250059348992
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 250058267136
NOTICE: /dev/sdb: jmicron discovering
NOTICE: /dev/sdb: lsi     discovering
NOTICE: /dev/sdb: nvidia  discovering
NOTICE: /dev/sdb: pdc     discovering
NOTICE: /dev/sdb: pdc metadata discovered
NOTICE: /dev/sdb: sil     discovering
NOTICE: /dev/sdb: via     discovering
NOTICE: /dev/sda: asr     discovering
NOTICE: /dev/sda: ddf1    discovering
NOTICE: /dev/sda: hpt37x  discovering
NOTICE: /dev/sda: hpt45x  discovering
NOTICE: /dev/sda: isw     discovering
DEBUG: not isw at 250059348992
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 250058267136
NOTICE: /dev/sda: jmicron discovering
NOTICE: /dev/sda: lsi     discovering
NOTICE: /dev/sda: nvidia  discovering
NOTICE: /dev/sda: pdc     discovering
NOTICE: /dev/sda: pdc metadata discovered
NOTICE: /dev/sda: sil     discovering
NOTICE: /dev/sda: via     discovering
DEBUG: _find_set: searching pdc_bejigbccdb
DEBUG: _find_set: not found pdc_bejigbccdb
DEBUG: _find_set: searching pdc_bejigbccdb
DEBUG: _find_set: not found pdc_bejigbccdb
NOTICE: added /dev/sdb to RAID set "pdc_bejigbccdb"
DEBUG: _find_set: searching pdc_bejigbccdb
DEBUG: _find_set: found pdc_bejigbccdb
DEBUG: _find_set: searching pdc_bejigbccdb
DEBUG: _find_set: found pdc_bejigbccdb
NOTICE: added /dev/sda to RAID set "pdc_bejigbccdb"
DEBUG: checking pdc device "/dev/sda"
DEBUG: checking pdc device "/dev/sdb"
DEBUG: set status of set "pdc_bejigbccdb" to 16
DEBUG: checking pdc device "/dev/sda"
DEBUG: checking pdc device "/dev/sdb"
DEBUG: set status of set "pdc_bejigbccdb" to 16
RAID set "pdc_bejigbccdb" was not activated
WARN: unlocking /var/lock/dmraid/.lock
DEBUG: freeing devices of RAID set "pdc_bejigbccdb"
DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sda"
DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sdb"

所以我的系統看到這兩個驅動器並認為它們應該是陣列的一部分,但不會啟動陣列並且這不會創建/dev/mapper/pdc_bejigbccdb,因此我無法將 grub 載入到它並從它啟動。

如何讓 dmraid 啟動並創建映射器條目?

我修好了,但我不能老實告訴你怎麼修。

基本上我啟動到了 Mint 17 的 LiveUSB 版本。我注意到 raid 陣列很高興,所以我安裝了系統並 chroot 到它。

然後我再次安裝了 dmraid 和 mdadm(不知道我為什麼這樣做),更新了我的 grub 設置並將 grub 安裝到陣列中。

稍後重新啟動,它抱怨 mdadm,但一切都很好,現在它正在從陣列啟動。

真是一個驚喜。謝謝你的幫助。

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