nas:mount_raiddisk_another
**文書の過去の版を表示しています。**
RAIDディスクを別のシステムでマウント
概要
OpenWRTのRAID-1(ミラーリング)で運用していたディスクを取り外し、1台だけ別のシステム(具体的にはRaspberry Pi)に接続してマウントする。
一般的なLinuxシステムでも同じ方法でできるはず。
手順
mdadmをインストール
sudo apt install mdadm
取り外したHDDを適当なHDDケースに入れて、RaspberryPiにUSB接続する。
そのときのdmesgの抜粋
[ 6150.566933] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd [ 6150.588314] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcdDevice=72.05 [ 6150.588337] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 6150.588349] usb 2-2: Product: GW3.5AM-SU3P [ 6150.588359] usb 2-2: Manufacturer: Kuroutoshikou [ 6150.588368] usb 2-2: SerialNumber: 0C51800004CB [ 6150.630844] scsi host0: uas [ 6150.632117] scsi 0:0:0:0: Direct-Access ST3000DM 007-1WY10G 7205 PQ: 0 ANSI: 6 [ 6150.706932] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB) [ 6150.706952] sd 0:0:0:0: [sda] 4096-byte physical blocks [ 6150.707175] sd 0:0:0:0: [sda] Write Protect is off [ 6150.707182] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08 [ 6150.707533] sd 0:0:0:0: [sda] Disabling FUA [ 6150.707540] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 6150.741115] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 6150.763114] sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes [ 6150.763130] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes) [ 6150.811705] sda: sda1 sda2 sda3 [ 6150.812083] sd 0:0:0:0: [sda] Attached SCSI disk [ 6150.922693] block device autoloading is deprecated and will be removed. [ 6150.938755] block device autoloading is deprecated and will be removed. [ 6150.971161] block device autoloading is deprecated and will be removed. [ 6150.994442] md/raid1:md125: active with 1 out of 2 mirrors [ 6151.066078] md125: detected capacity change from 0 to 5850827520 hiroshi@omvpi:~ $ hiroshi@omvpi:~ $
hiroshi@omvpi:~ $ sudo fdisk -l /dev/sda Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors Disk model: 007-1WY10G 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 hiroshi@omvpi:~ $
hiroshi@omvpi:~ $ ls -l /dev/md* brw-rw---- 1 root disk 9, 125 Jan 26 21:19 /dev/md125 brw-rw---- 1 root disk 9, 126 Jan 26 21:19 /dev/md126 brw-rw---- 1 root disk 9, 127 Jan 26 21:19 /dev/md127 /dev/md: total 0 lrwxrwxrwx 1 root root 8 Jan 26 21:19 OpenWrt:3 -> ../md125 hiroshi@omvpi:~ $ hiroshi@omvpi:~ $ cat /proc/mdstat Personalities : [raid1] md125 : active (auto-read-only) raid1 sda3[0] 2925413760 blocks super 1.2 [2/1] [U_] bitmap: 3/22 pages [12KB], 65536KB chunk md126 : inactive sda2[0](S) 522240 blocks super 1.2 md127 : inactive sda1[0](S) 4189184 blocks super 1.2 unused devices: <none> hiroshi@omvpi:~ $
マウントすることで、中身にアクセスできた。
(リードオンリーのようだけど、データを救い出せることが分かったので目的は達せられた)
hiroshi@omvpi:~ $ sudo mkdir /mnt/hdd{1,2,3} hiroshi@omvpi:~ $ sudo mount /dev/md125 /mnt/hdd3 hiroshi@omvpi:~ $ ls -l /mnt/hdd3 total 32 drwxr-xr-x 3 root root 4096 May 28 2022 homes drwx------ 2 root root 16384 May 28 2022 lost+found drwxrwxrwx 8 nobody root 4096 Oct 15 2022 share -rw-r--r-- 1 root root 29 May 28 2022 TESTFILE drwxr-xr-x 6 nobody root 4096 Nov 23 2022 users hiroshi@omvpi:~ $
有効になっていないパーティションも読めるようにする。
nas/mount_raiddisk_another.1737894786.txt.gz · 最終更新: 2025/01/26 21:33 by nipa28