Skip to contentSkip to conversation

(Re ** 4)[1]: Extending "thin_trim" (about pseudo-raid)

DISCUSSION Thomas Brücker 2 participants 2 messages Nov 19, 2024 Device mapper

lore
Share & tools
lore
#0 lore raw

Dear Mr. Kabelac,

I have (at first) not been aware, that at the end of your mail, you asked me probably 'about pseudo-raid'. It is difficult for me to give you an abstract definition of it, so I give you an example:

* splitting the device '8:16' == /dev/sdb into 17 chunks of equal size by the following table:

* "dmsetup table ..." --> extended by the mappig 'from the names' to /dev/dm-<n> (omitting "dmsetup ls", --> mapping "name -> /dev/dm-<n>" in a separate list).

  /dev/dm-20 <-- AFE37B55.A0:  0 86183752 linear 8:16 8
  /dev/dm-21 <-- AFE37B55.A1:  0 86183752 linear 8:16 86183760
  /dev/dm-22 <-- AFE37B55.A2:  0 86183752 linear 8:16 172367512
  /dev/dm-23 <-- AFE37B55.A3:  0 86183752 linear 8:16 258551264
  /dev/dm-24 <-- AFE37B55.A4:  0 86183752 linear 8:16 344735016
  /dev/dm-25 <-- AFE37B55.A5:  0 86183752 linear 8:16 430918768
  /dev/dm-26 <-- AFE37B55.A6:  0 86183752 linear 8:16 517102520
  /dev/dm-27 <-- AFE37B55.A7:  0 86183752 linear 8:16 603286272
  /dev/dm-28 <-- AFE37B55.A8:  0 86183752 linear 8:16 689470024
  /dev/dm-29 <-- AFE37B55.A9:  0 86183752 linear 8:16 775653776

/dev/dm-30 <-- AFE37B55.A10: 0 86183752 linear 8:16 861837528 /dev/dm-31 <-- AFE37B55.A11: 0 86183752 linear 8:16 948021280 /dev/dm-32 <-- AFE37B55.A12: 0 86183752 linear 8:16 1034205032 /dev/dm-33 <-- AFE37B55.A13: 0 86183752 linear 8:16 1120388784 /dev/dm-34 <-- AFE37B55.A14: 0 86183752 linear 8:16 1206572536 /dev/dm-35 <-- AFE37B55.A15: 0 86183752 linear 8:16 1292756288 /dev/dm-36 <-- AFE37B55.A16: 0 86183752 linear 8:16 1378940040

* having a raid4 with these chunks (see /proc/mdstat):

  md255 : active raid4 dm-36[17] dm-35[15] dm-34[14] dm-33[13] \
          dm-32[12]    dm-31[11] dm-30[10] dm-29[9]  dm-28[8]  \
          dm-27[7]     dm-26[6]  dm-25[5]  dm-24[4]  dm-23[3]  \
          dm-22[2]     dm-21[1]  dm-20[0]
          689438720 blocks super 1.0 level 4, 4096k chunk,     \
          algorithm 0 [17/17] [UUUUUUUUUUUUUUUUU]

(Ok. its actually "raid4", because distributing reads / writes on diffe- rent legs is not sensible, if these legs reside on the same disk.)

* according to them man page "md": MD(4)
[...]
In later kernels, a read-error will instead
cause md to attempt a recovery by overwriting the bad block. i.e. it will find the correct data from elsewhere, write it over the block that failed, and then try to read it back again.
[Modern hard disks have spare sectors; a defective sector is at least, when it is written to,(sorry for my english) replaced by such a spare- sector.]
[...]

Sincerely

Thomas

============================================================================

Quoted 13 lines · Zdenek Kabelac

Dne 17. 11. 24 v 11:26 "Thomas Bruecker" napsal(a):

Quoted 1 line

[...]

[...]

Quoted 7 lines

[...]
* My name: "pseudo-raid": raid5 with legs on the same device, especially a hard disk. Ok, I admit, its slow.
* Reason:
* Modern hard disks are able to correct defective sectors, if the driver ('md') knows, what should be in these sectors.
* You may not equip a notebook with additional hard disk.

Is this some sort of 'raid1 + writemostly' ?
And there is also another target 'dm-era' - which is however not supported (yet)  by lvm2...

#1 lore raw

Dne 19. 11. 24 v 3:11 "Thomas Brücker" napsal(a):

Quoted 6 lines

Dear Mr. Kabelac,

I have (at first) not been aware, that at the end of your mail, you asked me probably 'about pseudo-raid'. It is difficult for me to give you an abstract definition of it, so I give you an example:

Hi

Hmm I'm not even sure I want to know here more details about this construct :)
but why don't you just simply create 'regular' raid4 LV where those legs are located on the same storage device/PV ?

It's certainly not a 'default' nor 'suggested' way of using raid, however with 'lvcreate --alloc anywhere' you can certainly create any sort of mapping without doing those very strange dmsetup mapping yourself.

And while I can 'see' a small value in having the same data stored multiple times on the same drive - the protection you get from this is close to nothing - especially with NVMe/SSD - where they in the most cases collapse in a 'total' way - so you simply have no access to drive at all. However what you get for 100% is a major drop of your storage performance.

With prices of storage these days I'd simply recommend to simply use the raid the way it's supposed to be used.

Regards

Zdenek