Would this work or would I have problems:

Using dd command to backup an entire SSD containing dual boot Windows/Ubuntu partitions into an .iso file, with the intent to then dd that iso back onto the same size SSD in the case of a drive failure?

17 points

Would this work

Yes.

or would I have problems

Also yes.

I used to do this backing up my “servers”. By that I mean some Raspberry Pis and random old PCs running Debian. I even did so successfully when needing to restore the images. But it was fragile and also failed at times, sometimes to great inconvenience when it was a machine serving something important.

I’ve since moved to a different backup strategy for servers, but if I were to do this with a bare-metal machine I want to preserve, I’d use something like Clonezilla. The maintainers of that project know a whole heck of a lot more than I do of the ins and outs of disk management, backup, and restoration than I do with my simple dd commands. If it is something you’re just wanting to do for fun and experience, dd can work. If you’re concerned with the security of your data/image, I’d use Clonezilla.

permalink
report
reply
10 points

Honestly, that just seems like you’re treating dd as some kind of arcanum. dd works just fine and I’ve been doing 1:1, full system backups for decades with it, no issues. Honorary mention for ddrescue / dd_rescue for recovery options, i. e. re-trying bad sector reads etc.

In fact, when Clonezilla doesn’t know your filesystem, it will simply employ dd to copy the data sector by sector.

I’d argue that Clonezilla (due to its use of partclone) is actually a less complete form of backup, since it will only copy used blocks, you don’t really end up with a clone of your devices, just a copy of what partclone believes to be your data. Don’t get me wrong, that is fine in most use cases, but there are some cases where this doesn’t cut it, e. g. wanting to backup / restore a storage device from a PLC where the vendor had the glorious idea to store licensing data in unused sectors, or when you want to create a forensic disk image, might want it look into d3dd then, although it absolutely works using regular old dd as well, d3dd just adds some amenities.

All I want to say is: dd is an absolutely reliable tool and can be a one stop solution for device backups. Also, I have absolutely no quarrels with Clonezilla, if it fits what you’re trying to do and it works, great.

permalink
report
parent
reply
4 points
*

As you seem to know a lot about Clonezilla, I’m allowing myself to ask you something.

Would Clonezilla work for doing a backup and reinstalling it on a completely different device?

I’ve already used it to backup and restore on the same device. I also tried to install my Surface Go device backup on an old Acer Computer but it failed to boot afterwards. I’m not sure if it’s because of the surface specific kernel or because it doesn’t work from one computer to another.

Would you know that?

permalink
report
parent
reply
2 points
*

Yes it can, but it’s up to your BIOS to be able to boot it. UEFI might work better, you still might need to manually add the boot entry to the efivars using efibootmgr. Many distributions also have documentation for a rescue boot and reinstalling the bootloader config.

permalink
report
parent
reply
2 points
*

In general, no, this won’t work. In your case, you’re lucky since at least the Surface Go is using an x86 CPU, so it’s not completely out of the question, but transferring the image as-is to a completely different device typically does not work without modification.

Simple example: your target device might not refer to existing hardware (let’s say a storage medium) in the same manner as your old device, so the existing references in your cloned image won’t work. There are other issues of course, e. g. missing drivers for different hardware present on the target device.

It’s possible to modify the image so it would boot, but given the Surface runs Windows, that’s going to be a chore. I’d consider this an interesting project if bored on a slow weekend, but I’d most likely just do a filesystem backup of relevant data and call it a day.

permalink
report
parent
reply
1 point
*

I forgot to say that I’m using Linux (Fedora 40). If you think it wouldn’t work, do you know another program which would?

My data is stored on the cloud, but I wouldn’t want to go through the hassle of setting everything up again if I move to another computer (extensions, mail, calendar, installed programs and settings).

permalink
report
parent
reply
2 points

I don’t know off the top of my head. I think that Clonezilla can modify images in such a way as they can be booted on a different type of device. My knowledge of the black magic of boot sectors and partition stuff is lacking. Also, you’d have to make sure the motherboard/BIOS is properly configured for reading the device in the same way that the original device was read. UEFI/BIOS stuff can be a pain in the ass to get right.

So my short answer is probably, but I wouldn’t be able to walk you through something like that. Wish I could be more helpful.

permalink
report
parent
reply
2 points

Okay thanks for the answer 🙏

permalink
report
parent
reply
10 points

As long as it’s not a mounted and running live system, it should work. Not the most efficient way to do such a thing, but I would think it should work.

permalink
report
reply
4 points

You can zero out the free space on each partition then pipe the output from dd into gzip if you want to save space.

permalink
report
parent
reply
10 points

Might as well just use partclone at this point

permalink
report
parent
reply
6 points

Seconding partclone here, it’s the easiest solution for imaging that only backs up the data on the partition that is used. Plus, it’s in RescueZilla, which is pretty intuitive and user friendly for those that prefer GUIs

permalink
report
parent
reply
1 point

Gzip runs at tens of MB/s. Zstd runs at least 10x faster, and then goes fasterer with multithreading (-T0).

permalink
report
parent
reply
7 points

Don’t do this. If you have a 1TB drive with only 10GB being occupied, your image will be 1TB, and you will need a >1TB drive to store it, and another to restore it.

If you only backup the data you could do it in a much smaller size drive and it will be a lot faster to perform backups (otherwise you will need hours every time you want to create a new image).

permalink
report
reply
1 point
Deleted by creator
permalink
report
parent
reply
7 points

Works fine, though it’s not an “iso” file. But it doesn’t matter what extension you use.

I used to do this to switch an old laptop between Windows and Linux. I’d backup one, overwrite with the other. Swap as necessary.

permalink
report
reply
6 points

Should work. You’d be better off dd’ing each partition separately.

permalink
report
reply
1 point

Why’s that?

permalink
report
parent
reply
3 points

If you dd a 1TB hard drive, it will create a 1TB image. You’d need to have a >1TB drive to store it. If you dd each partition separately, this won’t be the case.

Plus it will be easier to discriminate between different FS and mount them accordingly.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8.4K

    Monthly active users

  • 6.3K

    Posts

  • 172K

    Comments