HN user

jspiros

99 karma

I used to write application software for Mac OS X (in Objective-C), now I make my living writing web apps with Python.

Posts0
Comments54
View on HN
No posts found.

Very cool.

I wrote up a spec very similar to this (though I just used the hash itself for the folders, as in HA/HAS/HASH structure [there's probably a name for that scheme]), but haven't gotten around to implementing it. My main problem with actually implementing such a system is that I don't really like depending on Django or web-based interfaces; I'm a huge fan of files, and UNIX-style tools that operate on them, I just don't like the hierarchical filesystem. I've considered that a FUSE frontend to such a system would probably address most of my concerns, but at that point it's still a big huge abstraction layer that I start to feel uncomfortable for nebulous reasons aside.

But, very nice. It's nice to hear that I'm not the only person driven to such extremes. :)

I hate hierarchical filesystems.

A lot of my older files, sadly, are stored in "SORT/Sort Me/To be sorted/Old computer/Sort again/Miscellaneous..." and the like. My server has an mlocate index, so I'll use mlocate, and I'll use find sometimes. I make sure to preserve metadata like last-modified/created dates, so I can use that to narrow things down.

Newer stuff, I try to keep a bit more organized, but I still have lots of unmanaged stuff floating around. For big projects, or big files, that's easy enough; my photos are sorted into a Y/M/D hierarchy, my VHS digitization projects are fairly well organized, some other things have their own structure. For my scanned documents, I just dump them all into a mess of folders, but then have a custom Django app with a management command that indexes them and gives me a nice "document management" website, and then I just search based on OCR'd text or title or date.

I really hate hierarchical filesystems. After using computers for this long, I'm convinced that hierarchy-optional, metadata-driven stuff is the only future I'll be happy in. I long for the ability to save things without really having to say anything about where it's saved, and still be able to find it... So, sorry, I don't think I have a satisfactory answer for you, as I don't think there's a good solution to this problem as long as we have filesystems where the organizational primative is a hierarchy. Even with tag-based systems that build on top of that, it's usually clunky and you still fundamentally have to figure out where to save something "first", even if you plan to access it via tag/metadata later. Such a pain.

It's not pool-wide, it's vdev-specific. You can add new vdevs with more optimal ashift values. With my pool, half of the vdevs have sub-optimal ashift, the other half are good.

Yeah, my oldest vdevs were configured with 512B block size, because that was the default and the ZFS community wasn't being particularly loud about ashift=12 being a good idea until later. As far as I know, there is no easy way to solve that problem? Is it possible to replace one vdev with another? Off the top of my head, my understanding is that you can replace individual disks, but replacing entire vdevs isn't possible?

If it is possible, yeah, I'll definitely replace the older vdevs entirely with new ones that have better ashift. And, while I'm at it, I'll probably switch to all 6-disk raidz2s, since that's another thing that I only learned too late, that raidz2 works best with an even number of disks in the vdev...

Almost all of the bitrot I see is on the oldest vdevs, which at this point probably contain mostly only old snapshots that are almost never accessed. My oldest vdevs are... 4-5 years old.

My understanding is that some significant (thousands of bytes) silent corruption is inevitable when you start reaching huge capacities over long-ish periods of time; even cosmic radiation has the potential to flip a few bits here and there every once in a while.

http://en.wikipedia.org/wiki/Data_corruption#Silent_data_cor...

So, yes, I think even with the best hardware, and proper maintenance, seeing some data repaired in a scrub is to be expected.

(That said, I did spend way too long using technology [SATA PM] that often failed and made it impossible for me to run a scrub. It's very possible that normal error rates are more like what I'm seeing now, a single byte every month or so, and that the megabyte figure is representative of errors from the days of my arrays dropping out unexpectedly.)

Well, if you don't get a kick out of "tweaking and worrying", yes, I definitely recommend FreeNAS. Although I'm confident in my system now, it took a long time to get this way, and I could've saved hundreds of hours by just going with something like FreeNAS (had it existed); I stuck with it because I kinda enjoy doing things the hard way.

As far as I'm concerned, the most identifiable characteristic of Debian is the packaging system, dpkg/apt. I've used FreeBSD occasionally, and that's what I always end up missing about Debian. I did consider going with Nexenta or Debian GNU/kFreeBSD, but whatever, ZoL works well enough. :)

I only have 32GB of RAM for ~73TiB under ZFS management, so I have huge SSD cache devices in my pool. The cache devices really lower ZFS' need for RAM, and it works well for me. Before the cache devices, 32GB felt very tight.

So, yes, you definitely need a lot of RAM. Consider cache devices if you can't do the GB/TB ratio.

ZFS still protects you from bitrot when compared to ext4 over mdraid. When you get to many terabytes of data, it's almost guaranteed that you're going to lose something to bitrot. In my case, my most recent scrub detected and repaired 1.58MB of bitrot. And in any given month, `zpool status` will show one or two checksum errors as having been corrected in real-time, as I was working with the corresponding files directly.

This is probably the number one thing that excites people about ZFS over any other solution, and it's something that isn't really easily implemented on a standard RAID + standard filesystem arrangement, since this sort of functionality depends on the filesystem knowing about the underlying disk arrangement.

"ZFS uses its end-to-end checksums to detect and correct silent data corruption. If a disk returns bad data transiently, ZFS will detect it and retry the read. If the disk is part of a mirror or RAID-Z group, ZFS will both detect and correct the error: it will use the checksum to determine which copy is correct, provide good data to the application, and repair the damaged copy."

https://blogs.oracle.com/bonwick/entry/zfs_end_to_end_data

By "something like this", do you mean ZFS? I am a HUGE fan of ZFS, and I do think that it's worth using in any situation where data integrity is a high priority.

As far as ZFS on Linux, it still has its wrinkles. I use it because, like you, I'm comfortable with Debian, and I didn't want to maintain a foreign system just for my data storage, and I still wanted to use the machine for other things too. (I actually started with zfs-fuse, before ZFS on Linux was an option.)

So, I don't know. If you just want a box to store stuff on, you might want to just look into FreeNAS, which is a FreeBSD distribution that makes it very easy to set up a storage appliance based on ZFS. FreeBSD's ZFS implementation is generally considered production-ready, so you avoid some ZFS on Linux wrinkles, too.

So, I'd recommend checking out the FreeNAS website, and maybe also http://www.reddit.com/r/datahoarder/ for ideas/other opinions. I do a lot of things in weird idiosyncratic ways, so I'm not sure I'd recommend anyone do it exactly how I have. :)

As you can see, I do not perform scrubs as often as I should. Until I switched to SAS a year ago, I wasn't able to complete a scrub at all. The scrub you see is one of the few I've been able to complete. I need a week or two where I'm not using the filesystem that much, because the scrub really kills performance of the filesystem with the version of ZFS on Linux I'm running. I'm intending to do an upgrade to the latest version of ZoL, and then run a scrub, sometime in the next 3 months.

I haven't upgraded because, well, I haven't really seen a need to? The original reason is that this pool began under zfs-fuse, and when I switched to ZoL I kept the version at the last version supported by zfs-fuse so that I could switch back if needed. I doubt I'll ever switch back, but I do like the idea of maintaining compatibility with other ZFS implementations in case of any problems. I suppose when the OpenZFS unification stuff actually finishes, I'll be happy to upgrade to the latest version?

I've got some external hard drives that I rotate in and store off-site but still nearby (down the street) for some data. I also have constant online backups running to various locations/services (Linode, AWS, CrashPlan, Dreamhost, some private services). I don't backup everything, only the irreplacable personal data (so, I'm not backing up Wikipedia dumps); at current count, at most 6TiB of the data is irreplacable. I also prioritize, so even out of that data, the absolute most important data is backed up more often, to more locations, and the less important data is backed up to fewer locations.

I've got some external hard drives that I rotate in and store off-site but still nearby (down the street) for some data. I also have constant online backups running to various locations/services (Linode, AWS, CrashPlan, Dreamhost, some private services). I don't backup everything, only the irreplacable personal data (so, I'm not backing up Wikipedia dumps); at current count, at most 6TiB of the data is irreplacable.

I haven't experienced ANY drive failures. Which means I'm probably on track for one soon...

When I started out, I began with a single 5-disk vdev using a SATA port multiplier enclosure to connect the drives. Over time, I bought more SATA port multipliers, but eventually ran into tons of problems with the SATA PM technology. I do not recommend anyone use SATA PM for anything that really matters, and if you must use it, do not run more than one port multiplier on a single system at a time. So, I had tons of failures where the drives would just drop out due to their enclosure, at least once a month.

After switching to SAS and SAS expanders for drive connectivity, about a year ago, I have had NO problems at all. Rock solid.

Edit: I think I've lucked out by choosing very good, slow, low-temperature drives, first the HD204UI by Samsung, then the WD Red series. With my air conditioning, and the airflow in my rack, the drives average around 32 degrees C (a little colder than Google's report would suggest is best, but close). I would get very anxious if I were running with faster/hotter drives, or "green" drives not designed for 24/7 use.

It is running 24/7; I don't feel comfortable powering it down regularly; that is something I would worry about from the OP's setup, I wouldn't want to subject all those mechanical drives to so many power cycles over time. I don't have figures for only that machine, but my entire rack, which includes a router machine, two ISP modems, the ZFS-running machine and two SAS expanders, averages around 330 watts.

After setting it up, I wouldn't say that it requires any time to manage. Getting it all set up just right, with SMART alerts and capacity warnings and backups and snapshots, all of which I roll myself with various shell scripts, took a long time. Besides that initial investment, the only "management" I have to do is respond to any SMART alerts, add more vdevs as the pool fills up, and manage my files as I would on any other filesystem.

I use the space for just about everything. Lots of backups. I use the local storage on all of my workstations as sort of "scratch" space and anything that matters in the long term is stored on the server. The highest density stuff is, of course, media: I have high definition video and photographs from my digital SLRs, I have tons of DV video obtained as part of an analog video digitization workflow, media rips, and downloaded videos. (I even have a couple of terabytes used up by a youtube-dl script that downloads all of my channel subscriptions for offline viewing, and that's something I doubt anyone would do unless they had so many terabytes free.) I keep copies of large datasets that seem important (old Usenet archives, IMDB, full Wikipedia dumps). I keep copies of old software to go with my old hardware collection. I have almost every file I've ever created on any computer in my entire life, with the exception of a handful of Zip and floppy disks that rotted away before I could preserve them, but that is only a few hundred gigabytes. I scan every paper document that I can (my largest format scanner is 12x18 inches, so anything larger than that is waiting for new hardware to arrive someday), so almost all of my mail and legal documents are on there too.

(I had a dream the other night that someone got access to this machine and deleted everything. Worst. Nightmare. Ever.)

A cloud solution would not have met my use case, since one of the primary needs I have is to be self-sufficient in terms of storing my own data, and I also want immediate local access to a lot of the things on there. I do use various cloud solutions, but only for backup, never as primary storage.

Rolling it myself was definitely cheaper than any out-of-the-box hardware solution I've seen. The computer itself is a Supermicro board with some Xeon middle-of-the-range chip and a ton of RAM, and an LSI SAS card. Connected to the SAS card are two 24-bay SAS expander chassis, which contain the drives, which are all SATA.

I'd say that building something like this would cost you maybe about 4000USD, not counting the cost of the drives. The drives were all between $90 and $120 when I bought them, but of course capacity eventually started going up for the same price over time, so let's say another 3500USD for the drives.

I have a similar capacity solution running at home, though I have far more (fewer disks per) vdevs. I've been running it for a few years now, so some things aren't as optimized as they could be, but it still works well for my uses...

  # zpool list
  NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
  lanayru  73.3T  53.7T  19.6T    73%  1.00x  ONLINE  -

  # zpool status
    pool: lanayru
   state: ONLINE
  status: The pool is formatted using a legacy on-disk format.  The pool can
          still be used, but some features are unavailable.
  action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
          pool will no longer be accessible on software that does not support
          feature flags.
    scan: scrub repaired 1.58M in 201h47m with 0 errors on Fri Feb 21 13:37:24 2014
  config:
  
          NAME                                                  STATE     READ WRITE CKSUM
          lanayru                                               ONLINE       0     0     0
            raidz2-0                                            ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
            raidz2-1                                            ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
              ata-SAMSUNG_HD204UI_______________-part1          ONLINE       0     0     0
            raidz2-2                                            ONLINE       0     0     0
              ata-ST2000DL004_HD204UI_______________-part1      ONLINE       0     0     0
              ata-ST2000DL004_HD204UI_______________-part1      ONLINE       0     0     0
              ata-ST2000DL004_HD204UI_______________-part1      ONLINE       0     0     0
              ata-ST2000DL004_HD204UI_______________-part1      ONLINE       0     0     0
              ata-ST2000DL004_HD204UI_______________-part1      ONLINE       0     0     0
            raidz2-3                                            ONLINE       0     0     0
              ata-WDC_WD30EFRX-68AX9N0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68AX9N0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68AX9N0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68AX9N0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68AX9N0_WD-____________-part1    ONLINE       0     0     0
            raidz2-5                                            ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
            raidz2-6                                            ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
              ata-WDC_WD30EFRX-68EUZN0_WD-____________-part1    ONLINE       0     0     0
          logs
            mirror-4                                            ONLINE       0     0     0
              ata-KINGSTON_SV300S37A60G_________________-part1  ONLINE       0     0     0
              ata-KINGSTON_SV300S37A60G_________________-part1  ONLINE       0     0     0
          cache
            ata-KINGSTON_SV300S37A60G_________________-part2    ONLINE       0     0     0
            ata-KINGSTON_SV300S37A60G_________________-part2    ONLINE       0     0     0
  
  errors: No known data errors
If anyone has any questions, I'd be happy to try to answer.

The ReGIS support is nice, but with the custom functionality it would be nice if instead of echoing an ASCII string like "HTERMFILEXFER" it used actual escape sequences.

Terminology[1] does this correctly with its own escape sequences. But, unfortunately, it doesn't actually use the escape sequences to transfer file data, even though it could. Instead it just transfers URLs, which isn't as network-transparent as I would like.

(Background: I did some research a couple of months ago into what it would take to build a graphical terminal emulator, to support a backwards-compatible network-transparent TermKit[2]-like experience.)

(Edit: Apparently the latest nightlies of iTerm2 also supports this sort of functionality, and does so properly with escape sequences.[3] Thanks, gnachman.)

[1] http://www.enlightenment.org/p.php?p=about/terminology

[2] http://acko.net/blog/on-termkit/ and https://github.com/unconed/TermKit

[3] http://www.iterm2.com/images.html

Xpra: Screen for X 13 years ago

I've used xpra for about a year now, and I do recommend it if it seems like it would fill a need in your workflow.

For me, I'm using it primarily as a way to run Pidgin (for Jabber and AIM, primarily) on my server that I can connect to from the various machines I use around the house; analogous to how I use irssi in screen for IRC.

I also configured my screen instance to have a DISPLAY environment variable that corresponds to my Xpra instance, so if I run anything within screen that connects to an X server, I can be sure it's connecting to the X server I'm currently connected to anyway, and I'm mostly safe from sudden disconnection problems.