His Masters' Voices Wiki

よろずのことの書き残し

ユーザ用ツール

サイト用ツール


nas:readynas_duo_v2_openwrt_hdd_manage

**文書の過去の版を表示しています。**

[ReadyNAS Duo v2][Open-WRT] HDDを扱えるようにする

概要

Open-WRT化したReadyNASで、HDDを扱えるようにして、RAID-1を構築する。

パッケージ導入

HDDのパーティション操作のために fdisk、RAID構築のために mdadm をインストールする。

opkg update
opkg install fdisk
opkg install mdadm

ReadyNASには、Open-WRT化する前のまま(工場出荷状態に戻すは実行したが)HDDが2本挿さっているので、どんな状態か覗いてみる。

root@OpenWrt:~# ls /dev/sd*
/dev/sda   /dev/sda2  /dev/sdb   /dev/sdb2
/dev/sda1  /dev/sda3  /dev/sdb1  /dev/sdb3
root@OpenWrt:~# fdisk -l /dev/sda
Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: ST3000DM007-1WY1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 36F7B8D6-ED67-4C9C-A0A9-51CD930408B4

Device       Start        End    Sectors  Size Type
/dev/sda1       64    8388671    8388608    4G Linux RAID
/dev/sda2  8388672    9437247    1048576  512M Linux RAID
/dev/sda3  9437248 5860529072 5851091825  2.7T Linux RAID
root@OpenWrt:~# fdisk -l /dev/sdb
Disk /dev/sdb: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: ST3000DM007-1WY1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C54C6828-8DBA-414F-BD8E-13F172CAC8BB

Device       Start        End    Sectors  Size Type
/dev/sdb1       64    8388671    8388608    4G Linux RAID
/dev/sdb2  8388672    9437247    1048576  512M Linux RAID
/dev/sdb3  9437248 5860529072 5851091825  2.7T Linux RAID
root@OpenWrt:~# 

3つパーティションが切ってあったらしい。
とりあえず、容量の大きな3番めのパーティションをそのまま使ってみる。

root@OpenWrt:~# ls /dev/md*
ls: /dev/md*: No such file or directory
root@OpenWrt:~# 
root@OpenWrt:~# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
mdadm: /dev/sda3 appears to be part of a raid array:
       level=raid1 devices=2 ctime=Thu May 26 21:29:24 2022
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: /dev/sdb3 appears to be part of a raid array:
       level=raid1 devices=2 ctime=Thu May 26 21:29:24 2022
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md3 started.
root@OpenWrt:~# cat /proc/mdstat 
Personalities : [raid0] [raid1] [raid10] 
md3 : active raid1 sdb3[1] sda3[0]
      2925413760 blocks super 1.2 [2/2] [UU]
      [>....................]  resync =  0.0% (2468480/2925413760) finish=276.2min speed=176320K/sec
      bitmap: 22/22 pages [88KB], 65536KB chunk

unused devices: <none>
root@OpenWrt:~# 
root@OpenWrt:~# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm: /dev/sda2 appears to be part of a raid array:
       level=raid1 devices=2 ctime=Thu May 26 21:29:07 2022
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: /dev/sdb2 appears to be part of a raid array:
       level=raid1 devices=2 ctime=Thu May 26 21:29:07 2022
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md2 started.
root@OpenWrt:~# mdadm --detail --scan
ARRAY /dev/md3 metadata=1.2 name=OpenWrt:3 UUID=96e650b0:c42bdbec:fa51e915:0eda2742
ARRAY /dev/md2 metadata=1.2 name=OpenWrt:2 UUID=508a7b33:f56fd66c:96557387:5c2401dd
root@OpenWrt:~# mdadm --detail --scan > /etc/mdadm/mdadm.conf
root@OpenWrt:~# 
nas/readynas_duo_v2_openwrt_hdd_manage.1653569774.txt.gz · 最終更新: 2022/05/26 21:56 by nipa28