nas:mount_raiddisk_another
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン | |||
nas:mount_raiddisk_another [2025/01/26 21:47] – [手順] nipa28 | nas:mount_raiddisk_another [2025/01/26 21:51] (現在) – nipa28 | ||
---|---|---|---|
行 207: | 行 207: | ||
+ | 以下は、よく分からずに試行錯誤していたときのログ。 | ||
+ | 実際にはやる必要のなかった無駄な操作が多く含まれているが、何かの参考になるかもしれないので残しておく。 | ||
+ | |||
+ | ``` | ||
+ | hiroshi@omvpi: | ||
+ | : | ||
+ | [ 8929.274103] usb 1-1.2: new high-speed USB device number 3 using xhci_hcd | ||
+ | [ 8929.471725] usb 1-1.2: New USB device found, idVendor=152d, | ||
+ | [ 8929.471749] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5 | ||
+ | [ 8929.471762] usb 1-1.2: Product: JMS56x Series | ||
+ | [ 8929.471772] usb 1-1.2: Manufacturer: | ||
+ | [ 8929.471781] usb 1-1.2: SerialNumber: | ||
+ | [ 8929.482805] scsi host0: uas | ||
+ | [ 8929.486632] scsi 0:0:0:0: Direct-Access | ||
+ | [ 8929.522498] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB) | ||
+ | [ 8929.522865] scsi 0:0:0:1: Direct-Access | ||
+ | [ 8929.523223] sd 0:0:0:0: [sda] Write Protect is off | ||
+ | [ 8929.523232] sd 0:0:0:0: [sda] Mode Sense: 67 00 10 08 | ||
+ | [ 8929.524723] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA | ||
+ | [ 8929.525334] sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes | ||
+ | [ 8929.525343] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes) | ||
+ | [ 8929.601685] sd 0:0:0:1: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB) | ||
+ | [ 8929.602395] sd 0:0:0:1: [sdb] Write Protect is off | ||
+ | [ 8929.602413] sd 0:0:0:1: [sdb] Mode Sense: 67 00 10 08 | ||
+ | [ 8929.604127] sd 0:0:0:1: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA | ||
+ | [ 8929.604679] | ||
+ | [ 8929.604841] sd 0:0:0:1: [sdb] Preferred minimum I/O size 4096 bytes | ||
+ | [ 8929.604856] sd 0:0:0:1: [sdb] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes) | ||
+ | [ 8929.605963] sd 0:0:0:0: [sda] Attached SCSI disk | ||
+ | [ 8929.611992] sd 0:0:0:1: [sdb] Attached SCSI disk | ||
+ | [ 8929.621925] sd 0:0:0:0: Attached scsi generic sg0 type 0 | ||
+ | [ 8929.622143] sd 0:0:0:1: Attached scsi generic sg1 type 0 | ||
+ | [ 8930.035279] block device autoloading is deprecated and will be removed. | ||
+ | [ 8930.039552] block device autoloading is deprecated and will be removed. | ||
+ | [ 8930.050350] block device autoloading is deprecated and will be removed. | ||
+ | : | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors | ||
+ | Disk model: 007-1WY10G | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: gpt | ||
+ | Disk identifier: 36F7B8D6-ED67-4C9C-A0A9-51CD930408B4 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | Disk /dev/sdb: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors | ||
+ | Disk model: 007-1WY10G | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | -bash: ll: command not found | ||
+ | hiroshi@omvpi: | ||
+ | brw-rw---- 1 root disk 9, 125 Jan 25 22:30 /dev/md125 | ||
+ | brw-rw---- 1 root disk 9, 126 Jan 25 22:30 /dev/md126 | ||
+ | brw-rw---- 1 root disk 9, 127 Jan 25 22:30 /dev/md127 | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | * /dev/sda が openwrt から取り外した RAID-1 を構成していたディスクのうちの1本 | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] | ||
+ | md125 : inactive sda3[0](S) | ||
+ | 2925413816 blocks super 1.2 | ||
+ | |||
+ | md126 : inactive sda1[0](S) | ||
+ | 4189184 blocks super 1.2 | ||
+ | |||
+ | md127 : inactive sda2[0](S) | ||
+ | 522240 blocks super 1.2 | ||
+ | |||
+ | unused devices: < | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | /dev/md125: | ||
+ | | ||
+ | Raid Level : raid1 | ||
+ | Total Devices : 1 | ||
+ | | ||
+ | |||
+ | State : inactive | ||
+ | | ||
+ | |||
+ | Name : OpenWrt:3 | ||
+ | UUID : bee41517: | ||
+ | Events : 20919 | ||
+ | |||
+ | Number | ||
+ | |||
+ | | ||
+ | /dev/md126: | ||
+ | | ||
+ | Raid Level : raid1 | ||
+ | Total Devices : 1 | ||
+ | | ||
+ | |||
+ | State : inactive | ||
+ | | ||
+ | |||
+ | Name : OpenWrt:1 | ||
+ | UUID : d1675450: | ||
+ | Events : 48 | ||
+ | |||
+ | Number | ||
+ | |||
+ | | ||
+ | /dev/md127: | ||
+ | | ||
+ | Raid Level : raid0 | ||
+ | Total Devices : 1 | ||
+ | | ||
+ | |||
+ | State : inactive | ||
+ | | ||
+ | |||
+ | Name : OpenWrt:2 | ||
+ | UUID : 133d7fd3: | ||
+ | Events : 0 | ||
+ | |||
+ | Number | ||
+ | |||
+ | | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | |||
+ | |||
+ | Number | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | * mdadm.conf の内容(初期状態) | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | # mdadm.conf | ||
+ | # | ||
+ | # !NB! Run update-initramfs -u after updating this file. | ||
+ | # !NB! This will ensure that initramfs has an uptodate copy. | ||
+ | # | ||
+ | # Please refer to mdadm.conf(5) for information about this file. | ||
+ | # | ||
+ | |||
+ | # by default (built-in), scan all partitions (/ | ||
+ | # containers for MD superblocks. alternatively, | ||
+ | # wildcards if desired. | ||
+ | #DEVICE partitions containers | ||
+ | |||
+ | # automatically tag new arrays as belonging to the local system | ||
+ | HOMEHOST < | ||
+ | |||
+ | # instruct the monitoring daemon where to send mail alerts | ||
+ | MAILADDR root | ||
+ | |||
+ | # definitions of existing MD arrays | ||
+ | |||
+ | # This configuration was auto-generated on Sat, 18 Jan 2025 23:15:35 +0900 by mkconf | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | ||
+ | sda | ||
+ | ├─sda1 | ||
+ | │ └─md126 | ||
+ | ├─sda2 | ||
+ | │ └─md127 | ||
+ | └─sda3 | ||
+ | └─md125 | ||
+ | sdb | ||
+ | mmcblk0 | ||
+ | ├─mmcblk0p1 179:1 0 512M 0 part / | ||
+ | └─mmcblk0p2 179:2 0 6.9G 0 part / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | Warning: Error fsyncing/ | ||
+ | Retry/ | ||
+ | Warning: Error fsyncing/ | ||
+ | Retry/ | ||
+ | hiroshi@omvpi: | ||
+ | Warning: Error fsyncing/ | ||
+ | Retry/ | ||
+ | hiroshi@omvpi: | ||
+ | Warning: Error fsyncing/ | ||
+ | Retry/ | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | * OpenWRTでは、どんな風になっていたのか(現行のディスクをチェックしてみる) | ||
+ | |||
+ | |||
+ | |||
+ | BusyBox v1.35.0 (2023-01-03 00:24:21 UTC) built-in shell (ash) | ||
+ | |||
+ | _______ | ||
+ | | ||
+ | | ||
+ | | ||
+ | |__| W I R E L E S S F R E E D O M | ||
+ | | ||
+ | | ||
+ | | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | Filesystem | ||
+ | / | ||
+ | tmpfs | ||
+ | / | ||
+ | overlayfs:/ | ||
+ | tmpfs 512 | ||
+ | / | ||
+ | / | ||
+ | root@OpenWrt: | ||
+ | Personalities : [raid0] [raid1] [raid10] | ||
+ | md1 : active raid1 sda1[3] sdb1[2] | ||
+ | 4189184 blocks super 1.2 [2/2] [UU] | ||
+ | | ||
+ | md3 : active raid1 sda3[3] sdb3[2] | ||
+ | 5855671847 blocks super 1.2 [2/2] [UU] | ||
+ | bitmap: 0/22 pages [0KB], 131072KB chunk | ||
+ | |||
+ | unused devices: < | ||
+ | root@OpenWrt: | ||
+ | Disk /dev/sda: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors | ||
+ | Disk model: WDC WD60EZAZ-00S | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: gpt | ||
+ | Disk identifier: 875A90EA-FE1C-4FE0-9649-DB24155B5A85 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | Disk /dev/sdb: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors | ||
+ | Disk model: WDC WD60EZAZ-00S | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: gpt | ||
+ | Disk identifier: F11EE5F2-D7CE-4738-AA86-59F981999363 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | /dev/md1: | ||
+ | | ||
+ | | ||
+ | Raid Level : raid1 | ||
+ | Array Size : 4189184 (4.00 GiB 4.29 GB) | ||
+ | Used Dev Size : 4189184 (4.00 GiB 4.29 GB) | ||
+ | Raid Devices : 2 | ||
+ | Total Devices : 2 | ||
+ | | ||
+ | |||
+ | | ||
+ | State : clean | ||
+ | Active Devices : 2 | ||
+ | | ||
+ | Failed Devices : 0 | ||
+ | Spare Devices : 0 | ||
+ | |||
+ | Consistency Policy : resync | ||
+ | |||
+ | Name : OpenWrt: | ||
+ | UUID : d1675450: | ||
+ | Events : 70 | ||
+ | |||
+ | Number | ||
+ | | ||
+ | | ||
+ | /dev/md3: | ||
+ | | ||
+ | | ||
+ | Raid Level : raid1 | ||
+ | Array Size : 5855671847 (5584.40 GiB 5996.21 GB) | ||
+ | Used Dev Size : 5855671847 (5584.40 GiB 5996.21 GB) | ||
+ | Raid Devices : 2 | ||
+ | Total Devices : 2 | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | State : clean | ||
+ | Active Devices : 2 | ||
+ | | ||
+ | Failed Devices : 0 | ||
+ | Spare Devices : 0 | ||
+ | |||
+ | Consistency Policy : bitmap | ||
+ | |||
+ | Name : OpenWrt: | ||
+ | UUID : bee41517: | ||
+ | Events : 24640 | ||
+ | |||
+ | Number | ||
+ | | ||
+ | | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | config mdadm | ||
+ | option email root | ||
+ | # list devices /dev/hd* | ||
+ | # list devices /dev/sd* | ||
+ | # list devices partitions | ||
+ | |||
+ | #config array | ||
+ | # | ||
+ | # | ||
+ | # list devices /dev/sda2 | ||
+ | # list devices /dev/sdb2 | ||
+ | |||
+ | config array | ||
+ | option device /dev/md3 | ||
+ | option name OpenWrt:3 | ||
+ | list devices /dev/sda3 | ||
+ | list devices /dev/sdb3 | ||
+ | |||
+ | config array | ||
+ | option device /dev/md1 | ||
+ | option name OpenWrt:1 | ||
+ | list devices /dev/sda1 | ||
+ | list devices /dev/sdb1 | ||
+ | root@OpenWrt: | ||
+ | root@OpenWrt: | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | root@OpenWrt: | ||
+ | |||
+ | * こっちでも同じこと | ||
+ | root@OpenWrt: | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | root@OpenWrt: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | *ラズパイ側に戻る | ||
+ | |||
+ | こう出てくる | ||
+ | hiroshi@omvpi: | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | こうなってる | ||
+ | hiroshi@omvpi: | ||
+ | # mdadm.conf | ||
+ | # | ||
+ | # !NB! Run update-initramfs -u after updating this file. | ||
+ | # !NB! This will ensure that initramfs has an uptodate copy. | ||
+ | # | ||
+ | # Please refer to mdadm.conf(5) for information about this file. | ||
+ | # | ||
+ | |||
+ | # by default (built-in), scan all partitions (/ | ||
+ | # containers for MD superblocks. alternatively, | ||
+ | # wildcards if desired. | ||
+ | #DEVICE partitions containers | ||
+ | |||
+ | # automatically tag new arrays as belonging to the local system | ||
+ | HOMEHOST < | ||
+ | |||
+ | # instruct the monitoring daemon where to send mail alerts | ||
+ | MAILADDR root | ||
+ | |||
+ | # definitions of existing MD arrays | ||
+ | |||
+ | # This configuration was auto-generated on Sat, 18 Jan 2025 23:15:35 +0900 by mkconf | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | brw-rw---- 1 root disk 9, 125 Jan 25 23:31 /dev/md125 | ||
+ | brw-rw---- 1 root disk 9, 126 Jan 25 23:31 /dev/md126 | ||
+ | brw-rw---- 1 root disk 9, 127 Jan 25 23:31 /dev/md127 | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | ARRAY / | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | sudo reboot | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | md125 md126 md127 | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | mapper/ | ||
+ | hiroshi@omvpi: | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | |||
+ | |||
+ | hiroshi@omvpi: | ||
+ | mdadm: ' | ||
+ | a mistake. | ||
+ | | ||
+ | hiroshi@omvpi: | ||
+ | mdadm: cannot open /dev/sda3: Device or resource busy | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== | ||
+ | Linux omvpi 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1: | ||
+ | |||
+ | The programs included with the Debian GNU/Linux system are free software; | ||
+ | the exact distribution terms for each program are described in the | ||
+ | individual files in / | ||
+ | |||
+ | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
+ | permitted by applicable law. | ||
+ | Last login: Sun Jan 26 15:41:19 2025 from 2001: | ||
+ | hiroshi@omvpi: | ||
+ | md125 md126 md127 | ||
+ | hiroshi@omvpi: | ||
+ | update-initramfs: | ||
+ | '/ | ||
+ | update-initramfs: | ||
+ | '/ | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | |||
+ | hiroshi@omvpi: | ||
+ | brw-rw---- 1 root disk 9, 1 Jan 26 16:37 /dev/md1 | ||
+ | brw-rw---- 1 root disk 9, 2 Jan 26 16:37 /dev/md2 | ||
+ | brw-rw---- 1 root disk 9, 3 Jan 26 16:37 /dev/md3 | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | brw-rw---- 1 root disk 9, 1 Jan 26 16:37 /dev/md1 | ||
+ | brw-rw---- 1 root disk 9, 2 Jan 26 16:37 /dev/md2 | ||
+ | brw-rw---- 1 root disk 9, 3 Jan 26 16:37 /dev/md3 | ||
+ | hiroshi@omvpi: | ||
+ | Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] | ||
+ | md3 : inactive sda3[0](S) | ||
+ | 2925413816 blocks super 1.2 | ||
+ | |||
+ | md2 : inactive sda2[0](S) | ||
+ | 522240 blocks super 1.2 | ||
+ | |||
+ | md1 : inactive sda1[0](S) | ||
+ | 4189184 blocks super 1.2 | ||
+ | |||
+ | unused devices: < | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | mount: / | ||
+ | | ||
+ | mount: (hint) your fstab has been modified, but systemd still uses | ||
+ | the old version; use ' | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | [ 3015.764373] mount: attempt to access beyond end of device | ||
+ | md3: rw=4096, sector=2, nr_sectors = 2 limit=0 | ||
+ | [ 3015.764395] EXT4-fs (md3): unable to read superblock | ||
+ | |||
+ | |||
+ | |||
+ | hiroshi@omvpi: | ||
+ | mke2fs 1.47.0 (5-Feb-2023) | ||
+ | mkfs.ext4: Device size reported to be zero. Invalid partition specified, or | ||
+ | partition table wasn't reread after running fdisk, due to | ||
+ | a modified partition being busy and in use. You may need to reboot | ||
+ | to re-read your partition table. | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | fsck from util-linux 2.38.1 | ||
+ | fsck.ext2: Invalid argument while trying to open /dev/md3 | ||
+ | / | ||
+ | The superblock could not be read or does not describe a valid ext2/ | ||
+ | filesystem. | ||
+ | filesystem (and not swap or ufs or something else), then the superblock | ||
+ | is corrupt, and you might try running e2fsck with an alternate superblock: | ||
+ | e2fsck -b 8193 < | ||
+ | or | ||
+ | e2fsck -b 32768 < | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | hiroshi@omvpi: | ||
+ | Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] | ||
+ | md3 : inactive sda3[0](S) | ||
+ | 2925413816 blocks super 1.2 | ||
+ | |||
+ | md2 : inactive sda2[0](S) | ||
+ | 522240 blocks super 1.2 | ||
+ | |||
+ | md1 : inactive sda1[0](S) | ||
+ | 4189184 blocks super 1.2 | ||
+ | |||
+ | unused devices: < | ||
+ | hiroshi@omvpi: | ||
+ | mdadm: started array /dev/md3 | ||
+ | hiroshi@omvpi: | ||
+ | mount: (hint) your fstab has been modified, but systemd still uses | ||
+ | the old version; use ' | ||
+ | hiroshi@omvpi: | ||
+ | TESTFILE | ||
+ | hiroshi@omvpi: | ||
+ | total 32 | ||
+ | -rw-r--r-- 1 root | ||
+ | drwxr-xr-x 3 root | ||
+ | drwx------ 2 root root 16384 May 28 2022 lost+found | ||
+ | drwxrwxrwx 8 nobody root 4096 Oct 15 2022 share | ||
+ | drwxr-xr-x 6 nobody root 4096 Nov 23 2022 users | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | hiroshi@omvpi: | ||
+ | Personalities : [raid1] [linear] [raid0] [raid6] [raid5] [raid4] [raid10] | ||
+ | md3 : active (auto-read-only) raid1 sda3[0] | ||
+ | 2925413760 blocks super 1.2 [2/1] [U_] | ||
+ | bitmap: 3/22 pages [12KB], 65536KB chunk | ||
+ | |||
+ | md2 : inactive sda2[0](S) | ||
+ | 522240 blocks super 1.2 | ||
+ | |||
+ | md1 : inactive sda1[0](S) | ||
+ | 4189184 blocks super 1.2 | ||
+ | |||
+ | unused devices: < | ||
+ | hiroshi@omvpi: | ||
+ | |||
+ | |||
+ | ``` | ||
nas/mount_raiddisk_another.txt · 最終更新: 2025/01/26 21:51 by nipa28