[{"data":1,"prerenderedAt":319},["ShallowReactive",2],{"project-35359473":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":41,"post_text":45,"what":46,"said":68,"maker_in_thread":164,"shape":173,"grid":178,"attempts":283,"same_week":284,"maker_shows":43,"maker_hidden":311,"reader_version":312,"card":313},"35359473","go-nbd","A Pure Go NBD Server and Client","title","Show HN: go-nbd – A Pure Go NBD Server and Client","https:\u002F\u002Fgithub.com\u002Fpojntfx\u002Fgo-nbd","github.com","pojntfx",1680107001,2023,113,44,568,3109,19,"notable","infrastructure","network block device library","library",[24,25,26,27],"network block device","nbd","go library","block device server","curious",0.167,{"positive":31,"neutral":32,"mixed":33,"critical":34},4,7,0,2,13,{"idea":37,"docs":38,"execution":39,"performance":40},{"positive":31,"critical":33},{"positive":33,"critical":34},{"positive":33,"critical":33},{"positive":33,"critical":33},[33,33,42,43,43,44,33,33,44,42,33,43,33,33,42,33,42,33,42,33,33,33,42,33,42,33,33,33,43,33,33,33,33,33,33,33,33,33,33,33],3,5,1,"Hey HN! I just released go-nbd, a lightweight Go library for effortlessly creating NBD servers and clients with Go. Its a neat tool for creating custom Linux block devices with arbitrary backends, such as a file, byte slice or what I'm planning to use it for, a tape drive. While there are a few partially abandoned projects like this out there already, this library tries to be as maintainable as possible by only implementing the most recent handshake revision and baseline functionality for both the client and the server, while still being useful.\n\nI'd love to get your feedback :)",{"problem":47,"audience":53,"pricing":53,"motivation":54,"time_to_build":53,"stack":61,"openness":66,"stage":67,"team_size":66},{"value":48,"source":49,"evidence":50},"Creating custom Linux block devices backed by arbitrary backends such as files, byte slices or tape drives","maker",[51],{"id":52},"post",null,{"value":55,"source":49,"evidence":56},"Maker wants a maintainable NBD library, planning to use it for a tape drive backend",[57,58],{"id":52},{"id":59,"by":11,"text":60},"35361662","Thanks! I have not yet actually - I am planning to test this with MHVTL to get some artificial delay in there (for the upcoming tape backend), but something like this would be…",[62],{"value":63,"source":49,"evidence":64},"Go",[65],{"id":52},"unknown","launched",{"praise":69,"objections":86,"requests":105,"questions":127,"alternatives":145},[70],{"value":71,"source":72,"evidence":73},"NBD is a simple, useful protocol","commenter",[74,78,82],{"id":75,"by":76,"text":77},"35363000","rkeene2","NBD is a simple protocol, I used it to recover a RAID5 hardware array that lost parity [0] [1], in just a few lines of C. [0]…",{"id":79,"by":80,"text":81},"35368305","rvalles","NBD is fairly simple. I wrote a minimal server in Python[0]. It is just a few lines. 0. https:\u002F\u002Fgithub.com\u002Frvalles\u002Fpyamigadebug\u002Fblob\u002Fmaster\u002FNBDServer.py",{"id":83,"by":84,"text":85},"35365739","coppsilgold","I use NBD for my single-user NAS. You can use FDE (full disk encryption, luks) client-side. The system managing the physical block devices never sees unencrypted data. Such a…",[87,98],{"value":88,"source":72,"evidence":89},"Acronym NBD not spelled out in the repo docs",[90,94],{"id":91,"by":92,"text":93},"35361786","alias_neo","Did nobody else learn to spell out an acronym the first time it's used? I had heard of it, but I had to read \"NBD\" far too many times in that repo before I saw what it stood for.",{"id":95,"by":96,"text":97},"35367662","LouisSayers","I've always thought of it as common courtesy. It's super frustrating when you're reading something and thinking \"great, but wtf are you actually going on about?\"",{"value":99,"source":72,"evidence":100},"Error handling in NBD scenarios may be weak",[101],{"id":102,"by":103,"text":104},"35361523","cellularmitosis","Very cool! I'm curious if you've explored testing error cases yet? Years ago I fooled around with nbdkit and developed a \"bad sectors\" and \"bad disk\" plugin and found that the…",[106,117],{"value":107,"source":72,"evidence":108},"Use defer for mutex unlock and avoid naked returns",[109,113],{"id":110,"by":111,"text":112},"35361032","Thaxll","You should probably defer mutex unlock() and not use naked returns: https:\u002F\u002Fgithub.com\u002Fpojntfx\u002Fgo-nbd\u002Fblob\u002Fmain\u002Fpkg\u002Fbackend\u002Ffile.go#L17 Defering overhead is very small nowdays.",{"id":114,"by":115,"text":116},"35361184","philosopher1234","what about during a panic?",{"value":118,"source":72,"evidence":119},"Consider gnet for better networking performance",[120,124],{"id":121,"by":122,"text":123},"35360761","latchkey","Since this heavily involves networking, take a look into using gnet [0]. You might find some interesting performance improvements by using that over just net.Conn. [0]…",{"id":125,"by":122,"text":126},"35363225","You might be right. Different workloads will definitely have different effects. That said, implementing the gnet api is pretty easy and doesn't require a huge context switch. It…",[128,135],{"value":129,"source":72,"evidence":130},"How does NBD compare to iSCSI?",[131],{"id":132,"by":133,"text":134},"35361664","znpy","how does nbd compare to, say, iSCSI ? beyond likely being simpler to understand\u002Fmanage, i mean.",{"value":136,"source":72,"evidence":137},"How is NBD used over unreliable networks and how easy is it to corrupt data?",[138,142],{"id":139,"by":140,"text":141},"35396018","codethief","Thanks so much for the insights! > While at home things are fine, when not at home things can get bad What does \"bad\" mean exactly? Unrecoverable errors \u002F faulty writes? It might…",{"id":143,"by":84,"text":144},"35397936","NBD uses TCP. And I had no unrecoverable (journal) corruption happen. Imagine you had a physical drive which had unreliable reads and writes but that would always go through…",[146,150,156],{"value":147,"source":72,"evidence":148},"nbdkit",[149],{"id":102,"by":103,"text":104},{"value":151,"source":72,"evidence":152},"nbd-server and nbd-client",[153],{"id":154,"by":84,"text":155},"35372667","I just use nbd-server, nbd-client (kernel module nbd). While at home things are fine, when not at home things can get bad unless you use something like UDPspeeder…",{"value":157,"source":72,"evidence":158},"iSCSI",[159,160],{"id":132,"by":133,"text":134},{"id":161,"by":162,"text":163},"35361885","tptacek","It's much, much simpler than iSCSI, which is an advantage. It's possibly more idiomatically Linux. But the Linux iSCSI initiator might (last I checked?) do a better job of…",{"comments":43,"answered":34,"key":165},[166,167,170],{"id":59,"text":60},{"id":168,"text":169},"35361072","I did think of doing that, but from my understanding there is a slight performance hit from `defer`, and there is no other branch it could deadlock - or am I missing something…",{"id":171,"text":172},"35361297","Good point, thanks!",{"commenters":174,"max_depth":175,"maker_replies":43,"first_comment_mins":176,"lifespan_hours":177},30,6,67,142,[179,183,186,188,190,193,195,198,201,202,206,209,212,213,217,219,221,223,225,227,228,230,234,238,241,243,245,247,248,250,252,253,255,256,257,258,261,262,265,268,272,275,278,280],[180,33,33,181,182,33],"35360442","other\u002Fneutral\u002Fnone","davidjfelix",[184,33,33,181,185,33],"35361309","gpvos",[132,33,42,187,133,33],"project\u002Fneutral\u002Fidea",[161,33,43,189,162,33],"project\u002Fpositive\u002Fidea",[191,33,43,189,192,33],"35363896","duskwuff",[91,33,44,194,92,33],"project\u002Fcritical\u002Fdocs",[196,33,33,181,197,33],"35364539","naikrovek",[199,33,33,181,200,33],"35367370","asciii",[95,33,44,194,96,33],[203,33,42,204,205,33],"35362871","project\u002Fneutral\u002Fdocs","teenigma",[207,33,33,181,208,33],"35364884","zainhoda",[210,33,33,181,211,33],"35365665","emmelaich",[75,44,43,189,76,33],[214,44,33,215,216,33],"35369379","commenter\u002Fneutral\u002Fnone","thanatos519",[218,44,33,215,76,33],"35369893",[102,34,42,220,103,33],"project\u002Fneutral\u002Fexecution",[59,34,33,222,11,44],"maker\u002Fneutral\u002Fnone",[110,42,42,224,111,33],"maker\u002Fneutral\u002Fexecution",[168,42,33,226,11,44],"maker\u002Fneutral\u002Fperformance",[114,42,42,224,115,33],[171,42,33,229,11,44],"maker\u002Fpositive\u002Fnone",[231,42,33,232,233,33],"35363872","commenter\u002Fneutral\u002Fperformance","Patrickmi",[235,42,33,236,237,33],"35369854","commenter\u002Fneutral\u002Fexecution","foldr",[239,42,33,232,240,33],"35361538","kyrra",[121,31,42,242,122,33],"project\u002Fneutral\u002Fperformance",[244,31,33,229,11,44],"35360845",[246,31,42,242,162,33],"35361863",[125,31,33,232,122,33],[249,31,33,232,162,33],"35363450",[251,31,33,215,122,33],"35363849",[83,43,43,189,84,33],[254,43,33,215,140,33],"35368912",[154,43,33,215,84,33],[139,43,33,215,140,33],[143,43,33,215,84,33],[259,43,33,260,140,33],"35440357","commenter\u002Fpositive\u002Fnone",[79,175,33,181,80,33],[263,175,33,264,11,44],"35370668","maker\u002Fpositive\u002Fidea",[266,32,33,181,267,33],"35369041","lenkite",[269,270,33,181,271,33],"35360939",8,"i5heu",[273,270,33,181,274,33],"35360956","toxik",[276,270,33,181,277,33],"35361608","ronsor",[279,270,33,181,274,33],"35361971",[281,270,33,181,282,33],"35362073","msla",[],[285,290,295,299,303,307],{"id":286,"name":287,"points":288,"category":289},"35316679","Apple Notes Liberator",563,"productivity",{"id":291,"name":292,"points":293,"category":294},"35334848","Regex.ai",294,"ai",{"id":296,"name":297,"points":298,"category":294},"35313171","GPT-4 Reverse Turing Test",288,{"id":300,"name":301,"points":302,"category":294},"35350662","Libraria",271,{"id":304,"name":305,"points":306,"category":289},"35327112","Open AI is not Open",241,{"id":308,"name":309,"points":310,"category":294},"35301657","llm-security",238,false,"v2",{"id":314,"name":5,"line":6,"ai":311,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":315,"top":18,"kw":316,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":317,"url":9,"mix":318,"praise":71,"objection":88,"sub":21},35359473,0.17,[24,25,26,27],"0035510013050030303000303000500000000000",[31,32,33,34],1793991062831]