• 0 Posts
  • 20 Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle
  • So for padding, it sometimes depends on how your compiler works, but usually, it doesn’t pack bytes by default - that needs to manually be done. Otherwise, a uint32 followed by 2 uint16s, for example, will take up the space for 3 uint32s (in a 32-bit native compiler). If you manually specify packing (implemented differently depending on your compiler and such), then it will pack those all properly into just 2 uint32s.

    I do imagine 24 bits followed by 16 more in a bit field for a 32-bit number would potentially cause problems. But it’s late here and I could certainly be wrong so take that with a grain of salt.

    That also said, I typically don’t use bitfields directly in structures - it’s not usually good practice, at least where I work. I’d either do a uint8[3] or use a whole uint32 that is a union, and in the union would be your :24 followed by a reserved : 8, if that makes any sense. It’s sometimes worth it to leave a few extra bytes in there just from an organization standpoint.





  • Doombot1@beehaw.orgtoLinux@lemmy.ml*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 years ago

    Great explanation. Yes - I’ve done this before! Built up a system with a RAID array but then realized I wanted a different boot drive. Didn’t really want to wait for dual 15Tb arrays to rebuild - and luckily for me, I didn’t have to! Because the metadata is saved on the discs themselves. If I had to guess (I could be wrong though) - I believe ‘sudo mdadm —scan —examine’ should probably bring up some info about the discs, or something similar to that command.








  • These failures don’t have to do with where they’re manufactured - it seems like this is some sort of firmware bug. NAND doesn’t really just choose to wipe itself at random. Actual NAND chip failures are few and far-between, so this is very likely much more than a hardware issue.

    That said, I personally have done a lot of testing with WD-manufactured NAND, compared other companies’ NAND - and the WD NAND is pretty crap. I can’t really go into further details than that, though.

    Source - I’m an SSD firmware engineer.