Just woke up and made my coffee, found that my migration is complete!

I built a nas when I was fresh out of college with 3 drives in raid5 but because btrfs was relatively new at the time, I decided to go with ext4 for the file system. Essentially it defines how the 1’s and 0’s are arranged on the disk and how reads/writes etc work. Btrfs boasted some neat new features, but I just wanted reliable storage so I went with the established tech. I also left the 4th bay open because drives were expensive as frig at the time.

Now that time has passed and btrfs is more widespread, I found myself missing some of the features like snapshots and copy-on-write, so I decided to both add a hd and convert at the same time.

Only thing is that there isn’t really a way to convert an ext4 drive to btrfs - you have to copy everything off and back on. Some of the files I’ve got I’ve had for more than a decade, so I was understandably terrified of the thought.

I ended up making my new drive in the final bay into a standalone volume which I manually copied everything to, then wrote a bash script to recursively check the hash of every file on both sides to make sure they’re the same. This took 4 days of straight copying and reading/verification.

And cuz I’m a paranoid fek, I repeated the process with an old external drive I bought so I’d have two copies, one on the raid volume and on the external. Less chance of something going wrong on both simultaneously.

Even with two verified copies I had to take a deep breath and think real hard about anything I maybe forgot before I deleted that >10yo volume full of photos, legal docs, etc. Terrifying.

But this morning the restore has finished! Now I just verify the restored files and I can nuke the temporary standalone and add it into the raid cluster, and I’ll have a shiny new ginormous storage volume with all the lovely btrfs features I’ve been reading about.

The nice thing about this project is that I realized that this single drive failure that my raid cluster isn’t really the same as a full separate backup on a separate media. So I’ve left the cheap external that spins down if not accessed and set up a job to spin it up once a night and back anything new or changed to it.

This morning I’m sitting here excited about my objectively dull accomplishment. I think if I explained this to anyone I know irl their eyes would glaze over in the first paragraph, but I’m living my best boring life and it’s fantastic.

  • Xaphanos@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    1 day ago

    Nice info. Helpful. Directly useful and applicable to me. But not really dull. Just not of interest to non-technical folks. Thanks for the post, but in the future you should try to be duller to fit in.

    • whodatdair@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      Ha, my apologies - I wrote it out to be somewhat entertaining to read but in reality I moved some files around in a paranoid way and then reformatted some hard drives…

      Most of my friends would glaze over the moment I mentioned file system types 🤣

  • afk_strats@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 days ago

    That’s so cool. I wasn’t brave enough to try btrfs with my storage either. c/Homelab would enjoy this post and I would die to see your copy/verify script

  • hsdkfr734r@feddit.nl
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Btrfs is great, with copy on write by default and (offline) dedup and subvolumes/ snapshots. No need for LVM and reserving a fixed amount of disk space for a VM.

    It adds a lot of complexity and I’m not sure what to do when it breaks (hopefully aunt google will help me then).

  • Sergio@slrpnk.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 days ago

    That is really cool. I’ve been meaning to set up a NAS for a while – I just have a bunch of external USB hard drives that I need to get better organized.

  • harsh3466@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    That’s awesome. I’ve got my raid on ext4 as well, and have been eyeing btrfs, and am also paranoid about data loss.