I’m looking to upgrade drives on two of my machines. My server running ubuntu has a 3.5" and will be getting a larger capacity HDD, while my personal computer running endeavor OS will be going from a 2.5" ssd to an nvme drive. (Not sure if it helps giving the drive types, but can’t hurt).

I’m fine with a clean install and reinstalling everything, but to save some time I’d of course like to minimize the effort that goes into it (importing settings etc). Any tips/tricks for either? Thanks in advance

  • schizo@forum.uncomfortable.business
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    11 days ago

    dd then resize the fs?

    Edit: one caveat here I forgot: if your fstab is using UUIDs, you’re going to have to update that, since the new drive won’t be the same UUID because, well, it’s not the same drive.

    • Drathro@dormi.zone
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      1
      ·
      11 days ago

      Absolutely this. Relatively quick and clean, no messing with installation or reconfiguration. That is, assuming your data isn’t completely corrupted and the old drive doesn’t just outright fail during transfer… But if that happens you were screwed to begin with.

      • Nednarb44@lemmy.worldOP
        link
        fedilink
        arrow-up
        2
        ·
        11 days ago

        The old drives are fine, just either too small or too slow, so it sounds like it may be an option

      • schizo@forum.uncomfortable.business
        link
        fedilink
        English
        arrow-up
        4
        ·
        11 days ago

        two commands: dd and resize2fs, assuming you’re using ext4 and not something more exotic.

        one makes a block-level copy of one device to another like so: dd if=/dev/source-drive of=/dev/destination-drive

        the other is used to resize the filesystem from whatever size it was, to whatever size you tell it (or the whole disk; I’d have to go read a manpage since it’s been a bit)

        the dd is completely safe, but the resize2fs command can break things, but you’d still have the data on the original drive, so you could always start over if it does - i’d unplug the source drive before you start doing any expansion stuff.

        • SavvyWolf@pawb.social
          link
          fedilink
          English
          arrow-up
          7
          ·
          11 days ago

          dd is completely safe.

          Only if you have the correct args and device names. Make a backup if you want to do it from the command line and aren’t feeling 100% confident.

        • Nednarb44@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          11 days ago

          Thanks, that’s really helpful. It can be hard to tell between commands and acronyms in conversation with familiarity

          • cmnybo@discuss.tchncs.de
            link
            fedilink
            English
            arrow-up
            2
            ·
            10 days ago

            Be absolutely sure that you get the source and destination drives correct. If you get them backwards, it will nuke your data. There is no confirmations, dd will start as soon as you press enter.