Last active
December 8, 2021 21:49
-
-
Save l1x/88b43b6a5638b4ccbbac1f9fd30a675d to your computer and use it in GitHub Desktop.
Revisions
-
l1x revised this gist
Dec 8, 2021 . 1 changed file with 24 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,22 @@ # Creating a mirror using two disks This uses the partition UUID to be able to tolarate device name changes. ```bash doas /sbin/mdadm \ --verbose --create /dev/md/nas0 \ --level=mirror --raid-devices=2 \ /dev/disk/by-partuuid/7b139fcf-e971-4806-b0f9-cbbd8c1d24de \ /dev/disk/by-partuuid/a11e2aa2-c404-48a1-8e3e-51a8dec0c967 ``` Creating a FS on the new device. ```bash doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md/nas0 ``` Info about the array. ``` ➜ rpi4-3.lan ~ doas /sbin/mdadm --verbose --detail /dev/md/nas0 @@ -41,6 +52,8 @@ Consistency Policy : bitmap 1 8 16 1 active sync /dev/sdb ``` XFS info ``` ➜ rpi4-3.lan ~ doas /sbin/xfs_info /dev/md0 meta-data=/dev/md0 isize=512 agcount=8, agsize=268435455 blks @@ -55,16 +68,23 @@ log =internal log bsize=4096 blocks=521728, version=2 realtime =none extsz=4096 blocks=0, rtextents=0 ``` After mounting ``` ➜ rpi4-3.lan ~ df -h | grep nas /dev/md0 7.3T 52G 7.3T 1% /nas ``` Tracking progress ``` cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdc1[1] sdb1[0] 7813893440 blocks super 1.2 [2/2] [UU] [=>...................] resync = 6.1% (483675520/7813893440) finish=736.3min speed=165908K/sec bitmap: 56/59 pages [224KB], 65536KB chunk ``` Monitoring temperature -
l1x revised this gist
Dec 8, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ ```bash /sbin/mdadm --create /dev/md/nas0 \ --level=mirror \ --raid-devices=2 /dev/disk/by-id/ata-WDC_WD80EFBX-68AZZN0_VRHG67RK /dev/disk/by-id/ata-WDC_WD80EFBX-68AZZN0_VRJ8V8VK doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md/nas0 ``` -
l1x revised this gist
Dec 8, 2021 . 1 changed file with 15 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,25 @@ ```bash /sbin/mdadm --create /dev/md/nas0 --level=mirror --raid-devices=2 /dev/disk/by-id/ata-WDC_WD80EFBX-68AZZN0_VRHG67RK /dev/disk/by-id/ata-WDC_WD80EFBX-68AZZN0_VRJ8V8VK doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md/nas0 ``` ``` ➜ rpi4-3.lan ~ doas /sbin/mdadm --verbose --detail /dev/md/nas0 /dev/md/nas0: Version : 1.2 Creation Time : Wed Dec 8 21:21:56 2021 Raid Level : raid1 Array Size : 7813894464 (7451.91 GiB 8001.43 GB) Used Dev Size : 7813894464 (7451.91 GiB 8001.43 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Wed Dec 8 21:25:34 2021 State : clean, resyncing Active Devices : 2 Working Devices : 2 @@ -27,15 +28,15 @@ doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md0 Consistency Policy : bitmap Resync Status : 0% complete Name : rpi4-3.lan:nas0 (local to host rpi4-3.lan) UUID : ff6bf993:818a61e4:83b9ed22:23d9176f Events : 46 Number Major Minor RaidDevice State 0 8 32 0 active sync /dev/sdc 1 8 16 1 active sync /dev/sdb ``` ``` -
l1x revised this gist
Dec 7, 2021 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,4 +55,13 @@ realtime =none extsz=4096 blocks=0, rtextents=0 ``` ➜ rpi4-3.lan ~ df -h | grep nas /dev/md0 7.3T 52G 7.3T 1% /nas ``` ``` cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdc1[1] sdb1[0] 7813893440 blocks super 1.2 [2/2] [UU] [=>...................] resync = 6.1% (483675520/7813893440) finish=736.3min speed=165908K/sec bitmap: 56/59 pages [224KB], 65536KB chunk ``` -
l1x revised this gist
Dec 7, 2021 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,4 +50,9 @@ naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 ``` ``` ➜ rpi4-3.lan ~ df -h | grep nas /dev/md0 7.3T 52G 7.3T 1% /nas ``` -
l1x renamed this gist
Dec 7, 2021 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,10 @@ ```bash doas /sbin/mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1 doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md0 ``` ``` ➜ rpi4-3.lan ~ doas /sbin/mdadm --verbose --detail /dev/md0 /dev/md0: Version : 1.2 @@ -32,8 +36,9 @@ Consistency Policy : bitmap Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 33 1 active sync /dev/sdc1 ``` ``` ➜ rpi4-3.lan ~ doas /sbin/xfs_info /dev/md0 meta-data=/dev/md0 isize=512 agcount=8, agsize=268435455 blks = sectsz=4096 attr=2, projid32bit=1 @@ -45,4 +50,4 @@ naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 ``` -
l1x revised this gist
Dec 7, 2021 . 1 changed file with 47 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,48 @@ doas /sbin/mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1 doas /sbin/mkfs.xfs -f -b size=4096 -s size=4096 /dev/md0 ➜ rpi4-3.lan ~ doas /sbin/mdadm --verbose --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Tue Dec 7 18:39:36 2021 Raid Level : raid1 Array Size : 7813893440 (7451.91 GiB 8001.43 GB) Used Dev Size : 7813893440 (7451.91 GiB 8001.43 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Tue Dec 7 18:59:12 2021 State : clean, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Consistency Policy : bitmap Resync Status : 2% complete Name : rpi4-3.lan:0 (local to host rpi4-3.lan) UUID : 5e6623f5:13829aaf:30df0981:32419ee2 Events : 243 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 33 1 active sync /dev/sdc1 ➜ rpi4-3.lan ~ doas /sbin/xfs_info /dev/md0 meta-data=/dev/md0 isize=512 agcount=8, agsize=268435455 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 bigtime=0 data = bsize=4096 blocks=1953473360, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 -
l1x created this gist
Dec 7, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ doas /sbin/mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1