Skip to content

Commit 26e0657

Browse files
committed
added raid 60
1 parent 8bb3534 commit 26e0657

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

src/tools/raid-calculator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
44
export const tool = defineTool({
55
name: 'RAID Calculator',
66
path: '/raid-calculator',
7-
description: 'Calculate storage capacity and fault tolerance of an array based on the number of disks, size, and RAID type',
7+
description: 'Calculate storage capacity, fault tolerance and space efficiency of an array based on the number of disks, size, and RAID type',
88
keywords: ['raid', 'calculator'],
99
component: () => import('./raid-calculator.vue'),
1010
icon: Database,

src/tools/raid-calculator/raid-calculator.service.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ const raidCalculations = {
9797
},
9898
raid_50: {
9999
about: 'RAID 50 stripes multiple RAID 5 arrays together (RAID 5 + RAID 0). Each RAID 5 set can sustain a single drive failure. More info: <a href="https://en.wikipedia.org/wiki/Nested_RAID_levels#RAID_50_(RAID_5+0)" target="_blank">Wikipedia</a>',
100-
requirements: 'RAID 50 requires at least 6 disks total with 3 minimum per stripe. Stripes must contain an equal number of disks.',
100+
requirements: 'RAID 50 requires at least 6 disks with 3 minimum per stripe. Stripes must contain an equal number of disks.',
101101
validate(num, size, stripeSize) {
102102
return num >= 6 && stripeSize >= 3 && num % stripeSize === 0;
103103
},
104104
capacity(num, size, stripeSize, unit) {
105-
// RAID 5 per strip
105+
// RAID 5 per stripe
106106
const perStripe = ((stripeSize - 1) * size) * unit;
107107

108108
// sum each stripe
@@ -113,8 +113,30 @@ const raidCalculations = {
113113
return (1 - (1 / stripeSize)) * 100;
114114
},
115115
fault(num, size, unit) {
116-
// one per mirror
116+
// one per set
117117
return '1 drive failure per RAID 5 set';
118118
},
119119
},
120+
raid_60: {
121+
about: 'RAID 60 stripes multiple RAID 6 arrays together (RAID 6 + RAID 0). Each RAID 6 set can sustain a two drive failures. More info: <a href="https://en.wikipedia.org/wiki/Nested_RAID_levels#RAID_60_(RAID_6+0)" target="_blank">Wikipedia</a>',
122+
requirements: 'RAID 50 requires at least 8 disks with 4 minimum per stripe. Stripes must contain an equal number of disks.',
123+
validate(num, size, stripeSize) {
124+
return num >= 8 && stripeSize >= 4 && num % stripeSize === 0;
125+
},
126+
capacity(num, size, stripeSize, unit) {
127+
// RAID 6 per stripe
128+
const perStripe = ((stripeSize - 2) * size) * unit;
129+
130+
// sum each stripe
131+
return perStripe * (num / stripeSize);
132+
},
133+
efficiency(num, stripeSize) {
134+
// 1 - (2 / strips per stripe)
135+
return (1 - (2 / stripeSize)) * 100;
136+
},
137+
fault(num, size, unit) {
138+
// 2 per set
139+
return '2 drive failures per RAID 6 set';
140+
},
141+
},
120142
};

src/tools/raid-calculator/raid-calculator.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function validateSetup() {
6262
/>
6363
</div>
6464
</n-form-item>
65-
<n-form-item v-if="raidType == 'raid_50'" label="Disks per stripe" label-placement="left" label-width="150" mb-2>
65+
<n-form-item v-if="['raid_50', 'raid_60'].includes(raidType)" label="Disks per stripe" label-placement="left" label-width="150" mb-2>
6666
<n-input-number v-model:value="diskPerStripe" max="10000" min="2" placeholder="Number of disks per stripe (ex: 3)" w-full />
6767
<n-input v-model:value="totalStripes" placeholder="" ml-1 w-full readonly />
6868
</n-form-item>
@@ -77,6 +77,7 @@ function validateSetup() {
7777
{ label: 'RAID 6 (double parity)', value: 'raid_6' },
7878
{ label: 'RAID 10 (mirror + stripe)', value: 'raid_10' },
7979
{ label: 'RAID 50 (parity + stripe)', value: 'raid_50' },
80+
{ label: 'RAID 60 (double parity + stripe)', value: 'raid_60' },
8081
]"
8182
/>
8283
</n-form-item>

0 commit comments

Comments
 (0)