mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 05:19:12 -04:00
added raid 60
This commit is contained in:
parent
8bb3534b31
commit
26e0657ede
3 changed files with 28 additions and 5 deletions
|
@ -4,7 +4,7 @@ import { defineTool } from '../tool';
|
|||
export const tool = defineTool({
|
||||
name: 'RAID Calculator',
|
||||
path: '/raid-calculator',
|
||||
description: 'Calculate storage capacity and fault tolerance of an array based on the number of disks, size, and RAID type',
|
||||
description: 'Calculate storage capacity, fault tolerance and space efficiency of an array based on the number of disks, size, and RAID type',
|
||||
keywords: ['raid', 'calculator'],
|
||||
component: () => import('./raid-calculator.vue'),
|
||||
icon: Database,
|
||||
|
|
|
@ -97,12 +97,12 @@ const raidCalculations = {
|
|||
},
|
||||
raid_50: {
|
||||
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>',
|
||||
requirements: 'RAID 50 requires at least 6 disks total with 3 minimum per stripe. Stripes must contain an equal number of disks.',
|
||||
requirements: 'RAID 50 requires at least 6 disks with 3 minimum per stripe. Stripes must contain an equal number of disks.',
|
||||
validate(num, size, stripeSize) {
|
||||
return num >= 6 && stripeSize >= 3 && num % stripeSize === 0;
|
||||
},
|
||||
capacity(num, size, stripeSize, unit) {
|
||||
// RAID 5 per strip
|
||||
// RAID 5 per stripe
|
||||
const perStripe = ((stripeSize - 1) * size) * unit;
|
||||
|
||||
// sum each stripe
|
||||
|
@ -113,8 +113,30 @@ const raidCalculations = {
|
|||
return (1 - (1 / stripeSize)) * 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// one per mirror
|
||||
// one per set
|
||||
return '1 drive failure per RAID 5 set';
|
||||
},
|
||||
},
|
||||
raid_60: {
|
||||
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>',
|
||||
requirements: 'RAID 50 requires at least 8 disks with 4 minimum per stripe. Stripes must contain an equal number of disks.',
|
||||
validate(num, size, stripeSize) {
|
||||
return num >= 8 && stripeSize >= 4 && num % stripeSize === 0;
|
||||
},
|
||||
capacity(num, size, stripeSize, unit) {
|
||||
// RAID 6 per stripe
|
||||
const perStripe = ((stripeSize - 2) * size) * unit;
|
||||
|
||||
// sum each stripe
|
||||
return perStripe * (num / stripeSize);
|
||||
},
|
||||
efficiency(num, stripeSize) {
|
||||
// 1 - (2 / strips per stripe)
|
||||
return (1 - (2 / stripeSize)) * 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// 2 per set
|
||||
return '2 drive failures per RAID 6 set';
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ function validateSetup() {
|
|||
/>
|
||||
</div>
|
||||
</n-form-item>
|
||||
<n-form-item v-if="raidType == 'raid_50'" label="Disks per stripe" label-placement="left" label-width="150" mb-2>
|
||||
<n-form-item v-if="['raid_50', 'raid_60'].includes(raidType)" label="Disks per stripe" label-placement="left" label-width="150" mb-2>
|
||||
<n-input-number v-model:value="diskPerStripe" max="10000" min="2" placeholder="Number of disks per stripe (ex: 3)" w-full />
|
||||
<n-input v-model:value="totalStripes" placeholder="" ml-1 w-full readonly />
|
||||
</n-form-item>
|
||||
|
@ -77,6 +77,7 @@ function validateSetup() {
|
|||
{ label: 'RAID 6 (double parity)', value: 'raid_6' },
|
||||
{ label: 'RAID 10 (mirror + stripe)', value: 'raid_10' },
|
||||
{ label: 'RAID 50 (parity + stripe)', value: 'raid_50' },
|
||||
{ label: 'RAID 60 (double parity + stripe)', value: 'raid_60' },
|
||||
]"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue