So on android in 2010 I used to be into the idea of rooting my phone, and installing custom roms.

Distros are essentially custom roms for your pc. Same concept.

There was a program called TWRP that I could use. Back then it would make a full backup of EVERYTHING on your internal drive. It was mostly used after you already had a custom rom.

But it backedup EVERYTHING. If you wrote a txt message as a draft, and didn’t sent it, then backed up with TWRP, whenever you restored on a new phone, that txt draft was there too. It was literally like your phone took an all encompassing picture of everything on your phones internal drive, every single file and setting, and made a backup. Saving it to your sd card.

So I’m thinking, linux should theoretically be able to do this. Maybe it does.

What if my current install is on a 250gb drive, and I buy a completely different 4TB drive? What if I want to do this total backup, save the backup to a usb hard drive, then put in a NEW hard drive, and have it restore the backup so now my entire old hard drive is now on my new hard drive? And every setting, every file, every last detail is an exact replica.

Could I do that?

  • Possibly linux
    link
    fedilink
    English
    11 day ago

    You don’t need anything special. Just dd the old drive to the new drive and then expand the partitions.

  • @[email protected]
    link
    fedilink
    English
    132 days ago

    Yes of course, any software that makes a full image of your drive will do this. dd is the old school and very manual way of doing this. But there are programs like Veeam Agent or Rescuezilla that make it much easier.

    • @Lost_My_MindOP
      link
      English
      32 days ago

      Really don’t understand the one guy downvoting you. This seems like helpful advice, considering my lack of knowledge.

      Unless it’s because Veeam Agent costs money. But that’s nitpicky. Costing money is for ME to decide if it’s a deal breaker. I mean, for me it is, but you giving that advice shouldn’t be downvoted. For others it may not be.

      And RescueZilla according to google is just a gui front of dd. So that sounds like my best option.

  • zelifcam
    link
    English
    6
    edit-2
    2 days ago

    Yes, restoring from a backup is far from a new concept.

    clonezilla dd borg rsync

    • @TechnologyChef
      link
      English
      22 days ago

      Yup lots of options, even things far advanced like SyncThing that can safely keep things in sync between many devices and locations without having to think about it. Anyways, this is a Reddit post to see what people are using, while I wrote my own setup using rsync and dm-crypt.

  • @[email protected]
    link
    fedilink
    English
    5
    edit-2
    2 days ago

    You can, and there are a number of options.

    Easiest IMO is to install both drives, and then use dd to copy drive A to drive B, and then resize the partitions with gparted to fill the rest of the disk.

    Do this from a live USB so that your not currently using drive A.

    https://serverfault.com/a/4912

    Note that /dev/sda might not be your first disk, so make sure you get them correct. Gparted can help you identify your disks.

    • @[email protected]
      link
      fedilink
      English
      12 days ago

      Does linux have an equivalent of VSS on windows? I always thought it was odd that Linux needed to be offline to do a disk image whereas on windows I can just do it without rebooting or anything.

      • @[email protected]
        link
        fedilink
        English
        2
        edit-2
        2 days ago

        VSS equivalent would be btrfs snapshots or zfs snapshots.

        Can you really copy a VSS to a new disk? For a new install, at some point you’ll need to reboot and go offline, so I don’t see the point in trying to keep uptime. If uptime matters, dont upgrade a disk, replace the entire system.

        • @[email protected]
          link
          fedilink
          English
          1
          edit-2
          1 day ago

          You don’t directly copy VSS to the new disk, it freezes a point in time that you can then backup with other software.

      • hendrik
        link
        fedilink
        English
        1
        edit-2
        2 days ago

        Is VSS even a backup? I thought it just copies old revisions of files into that shadow area so you can revert them to an old version after you modified them… But I don’t think it’s a full backup or allows you to restore something like a broken filesystem or any severe error?! I guess you could achive a similar thing with practically any linux backup solution on online filesystems, just that the restore will be a bit more cumbersome. Or something like a snapshot, that’ll do everything and even more… Or take one of the backintime clones, if it’s userdata…

        • @[email protected]
          link
          fedilink
          English
          21 day ago

          It freezes a point in time that you can then make an image of without worrying that files will be broken from being backed up while in use.

        • HorseChandelier
          link
          English
          3
          edit-2
          2 days ago

          Is VSS even a backup?

          Nope, not even close.

          I thought it just copies old revisions of files into that shadow area

          It just copies the deltas…

          Backups can use vss to get a static image of the volume (deltas are written to the shadow area, which isn’t backed up, whilst the backup is running) it’s a little different for vhdx files on VMs but basically the same.

          It’s magic… And often means that I don’t have to restore lost files from backup, just view the old versions and grab a copy from there.

      • zelifcam
        link
        English
        12 days ago

        deleted by creator

  • @Caboose12000
    link
    English
    22 days ago

    it seems like a lot of people have already posted good responses, so I hope its ok to just say I never knew TWRP was a software, I know it as my favorite band!

  • @[email protected]
    link
    fedilink
    English
    22 days ago

    Yes and no. Android has separate OS and data partitions. On Linux, this is configurable; in most installer defaults, root and home partitions are not separated. But it’s trivial to do after the fact, if you have some unpartitioned space or can shrink your root partition.

    However, unless you’re using flatpaks or something, it’s not guaranteed that installed programs containerize their data in the same way as Android apps.

    • hendrik
      link
      fedilink
      English
      32 days ago

      I mean this doesn’t really matter for the use case… The only difference is you’d need to tick two boxes to clone both partitions, or just one, if it’s one. And if you just dd everything onto a bigger disk, you don’t even need to worry about anything. Just clone the whole storage and it’ll be the exact same (cloned) partition layout, whatever it is.

      • @[email protected]
        link
        fedilink
        English
        22 days ago

        Oh, I misread the post. I thought they were talking about installing a new ROM and keeping the data partition. Yes, moving everything is trivial (if to an equal or larger disk).

  • @WhiteOakBayou
    link
    English
    22 days ago

    I Always use dd for this kind of thing. Others have mentioned some other tools but I have never had any problems with it that I didn’t cause myself.

    • @Lost_My_MindOP
      link
      English
      12 days ago

      Oh, me causing the issue myself is a HUGE risk. I’m an idiot when it comes to linux. I would be very happy if there were a thing in linux called “guardrail”. And all guardrail would do is stop you from doing the stupid things. Like “ah, you’re attempting to fuck up. Are you SURE you want to fuck up?” And I’d be like “uhhhhhhh, imma click no for now…”

      Then later I findout I would have erased my hard drive without guardrail, or somehow launch nukes at Canada.

      What I’m trying to say is that I should still be on training wheels, but linux is all too happy to let you fall on your face.

      But dd? No idea what that is. My instinct says “disc drive”, but I could be wrong. I’m probably wrong.

      • @WhiteOakBayou
        link
        English
        22 days ago

        Read through this scroll a little to find your use case, it’s in there. I’m sorry if being suggested to read seems rude or uninviting or something but I really think for this it’d be faster for you to do so. These people’s articles have always helped me and I’ve been using Linux for 20 years. dd stands for data duplicator and I just had to look that up lol.

        No guardrails but you have a second to reconsider when typing your password. The other day I used some gui util as sudo and deleted my /bin folder somehow. I would have noticed that in the cli.

    • @Lost_My_MindOP
      link
      English
      12 days ago

      Hehehe, I saw that comment before you deleted it! Aw, it’s ok. Everybody makes mistakes. hug

      I make mistakes all the time. Like…way bigger than you. I have no idea what I’m doing in life.