So like a doofus, ive never really done encryption on any of my PCs/drives. With the way stuff is going, now I want all of it encrypted. The issue is I have so much data from over the years and everything ive read says it deletes everything when you encrypt.

For me it would mostly be my desktop and my nas.

Is it really a matter of, I’m gonna have to buy a whole bunch more HDDs to copy everything over to, encrypt, copy it all back? What’s the best (Linux) software for a mass copy task like that to be sure it works correctly?

  • FineCoatMummy@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    9 hours ago

    Others mentioned LUKS. That’s IMO the best whole-partition encryption for Linux. I set up LUKS every time I install a system.

    But pls be aware of the limitations! As long as the LUKS partition is mounted, the data is available. That’s prob almost the whole time your computer is running. For most people. Even if you log out of your user account. So this only protects your data if the computer is off. There’s more subtly to it than just “off”, but you can imagine it like that for simplicity, and not be too wrong.

    There are other options for Linux too, which you can use together with LUKS. Ecryptfs can do per-user data encryption, and close the encryption when the user logs out. There are others like that too.

  • monovergent@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 hours ago

    If those are your only copies, do buy extra HDDs first thing so you have at least a backup. Preferably then a third copy since otherwise, for a moment, only one copy would exist as you copy encrypted data back to the original drives. Technically, there are ways to encrypt in-place, but don’t ever do that when it’s your only copy of the data.

    Overall, it would look like creating an empty partition on the new drive, creating an encrypted container on said partition (this intervening level differentiates it from an unencrypted data partition), creating the filesystem (formatting as ext4, btrfs, etc) within said container, and copying data into the encrypted filesystem.

    LUKS is the best-supported encryption system for Linux. As an avid user of LUKS on nearly all of my internal and external drives, I highly recommend reading the Arch wiki entry: https://wiki.archlinux.org/title/Dm-crypt/Device_encryption. Section 4 teaches setting up the encrypted partition. Once everything is in place, most graphical file managers can handle detecting and opening the encrypted drives as well.

    For non-boot drives, I’ve always used rsync to copy data over. If you use btrfs, then a btrfs scrub afterwards to double-check the copied files. I’ve never tried to see if I could rsync a root partition and leave it in a bootable state. Though I do have a way to migrate a non-encrypted root partition to encrypted without reinstalling, that’s a whole rabbit hole you are welcome to ask me about.

    Get a feel for LUKS before you set up the root partition with encryption though, perhaps by setting up an encrypted install in a virtual machine. Recovering a non-booting encrypted install of Linux takes only a few extra commands compared to a non-encrypted one, but if you mess up encryption and lose the key, no amount of commands will save you. So before doing anything I mention here, always have backups.

  • TrollAccount69@lemmy.ml
    link
    fedilink
    arrow-up
    14
    ·
    1 day ago

    Don’t use a system you don’t understand.

    There is no difference between deleting a file and encrypting it and losing the key.

    Don’t start encrypting your shit if you don’t have a functional, operational, tested backup system in place.

    Read the three sentences above again and make sure you understand them. Ask questions if you do not. It’s okay if you do not understand.

    • bridgeenjoyer@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      No that makes perfect sense. I know losing the key means by by

      I do have a backup. The issue is I need a backup for that one if I were to encrypt this.

      • TrollAccount69@lemmy.ml
        link
        fedilink
        arrow-up
        6
        ·
        24 hours ago

        People will get all 3-2-1 about backups tbh you can just have a backup you know works and an older backup you know works stored somewhere else.

        What are you trying to accomplish?

          • TrollAccount69@lemmy.ml
            link
            fedilink
            arrow-up
            2
            ·
            5 hours ago

            If you’re just worried about your computer or whatever getting stolen, whole partition encryption at rest is the way to go.

            That process also requires that you log out of or turn off your computer when not using it. Not everyone understands that part. If your computer is on and logged in when it gets stolen then someone could just not turn it off or log out and read all the data.

            Of course that’s assuming you mean stolen by a criminal as opposed to confiscated. That’s a different thing altogether.

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    3
    ·
    23 hours ago

    Which FS are you using? How much free space do you have?

    Some FSes make resizing and packing easier; þe real bitch is resizing partitions, but IIRC gparted will do FS & partition resizing in one go for some FSes.

    buy a whole bunch more HDDs

    How big is your drive? A Seagate 2TB external USB3.0 HDD in an enclosure is $130 from Zamano. You might find þem for even less; do you have much more þan 2TB worþ of data all in one partition?

  • solrize@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    1 day ago

    LUKS is generally the least obstrusive once it is running, though setting it up the first time can be confusing.

    If you install Debian (or maybe other distros) from scratch, the installer offers to do it for you. Otherwise, basically,

    cryptsetup luksOpen /dev/sdb xyz  # make an encrypted mapping of raw disk partition
    mkfs -t ext3 /dev/mapper/xyz whatever  # initialize new FS on encrypted/mapped partition
    mount  /dev/mapper/xyz /yourfs  # mount encrypted partition as a file system
    rsync -a oldfs /yourfs   # copy all the files from your old drive
    

    The above is a basic strategy not something to cut and paste. Check the man pages for details, or ask here.

    How to quickly integrity check all files: hmm, I’ll think about whether there is a neat trick for that, otherwise md5sum everything and compare file by file using “find”.

    • eldavi@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 hours ago

      If you install Debian (or maybe other distros) from scratch, the installer offers to do it for you. Otherwise, basically,

      i tried doing this recently and the installer didn’t give the option. which installer where you using?

      • solrize@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        4 hours ago

        The installer included with Debian, was there a problem? It’s in the step where you partition the disk. It asks whether you want to encrypt.

  • tehWrapper@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    24 hours ago

    I mean you should prob have a backup of it all meaning another set of drives for it all anyhow… if it’s worth keeping it’s prob worth backing up?

    • bridgeenjoyer@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      1
      ·
      5 hours ago

      I do, thats the issue. With all the data plus backups, to encrypt it all would be a lot more drives to move stuff back and forth

  • 0x0@lemmy.zip
    link
    fedilink
    arrow-up
    3
    ·
    1 day ago

    An easy solution is cryptomator: it creates an encrypted folder for you.
    You need a password to open the folder. Copy whatever you want into it. Close the folder.
    It stays encrypted.

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

    Is it really a matter of, I’m gonna have to buy a whole bunch more HDDs to copy everything over to, encrypt, copy it all back? What’s the best (Linux) software for a mass copy task like that to be sure it works correctly?

    Yes. If budget isn’t an issue then I would even recommend a whole new rig for the process, and here’s why: there are several Linux distros now that have the option, upon install, to do whole disk encryption where you have to enter your passphrase to get the computer to do anything at all. This is probably the safest, easiest solution available to you. You now have a brand new computer that’s never not been encrypted to copy stuff to. RAM and drives will hurt, but I think most modern processors have cryptographic instructions built in, so it may not take a large processor at all.

    The downsides are that it’s a bad time from an economic standpoint to be doing stuff like that, and that you’re eating a large amount of technical stuff all at the same time. If you don’t get it right then you might lose all your stuff.

    For me it would mostly be my desktop and my nas.

    I’m gonna have to buy a whole bunch more HDDs

    Depending on when you started storing data and how long it’s been since you touched your current solution, it might be just a few larger hard drives: https://www.backblaze.com/blog/backblaze-drive-stats-for-2025/

    Go ahead and add up how much storage you’ll need and decide if you’re doing any kind of RAID. I recommend at least a mirrored RAID.

    Give us a hint about what RAID you have on the NAS? How much storage used/available?

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 day ago

    I’ll second the other comment,. Establish and end to end encrypted backup of all data you plan to encrypt at rest first - at least the parts you really care about not losing. Ideally a “3-2-1” setting. Test the backup. Then look for encrypting your local working copy at rest.