Problems with DD partition size to a backup copy

particlefeever

New Member
Credits
119
I need to make a copy of my system so I can mess with it and come back in time, if I need. I am not happy with backup options I found, and I am not sure GParted copy is reliable - besides, I need to boot in an USB stick otherwise it does nothing.

DD seems to do the job right. But here is the mystery: I have my experimental Debian in a 32GB partition, so I created a 32GB (exactly) in an external disk using the same ext4 specs. But the attempt of copy results in an error - no espace enough. So I increased the size in 4GB, than DD copied without any errors, but the partition have now 4GB unused space. And most important, how I will copy the partition back if it is bigger than original? Any copy need a bit more space? How much? Is there a way of make a compressed clone?

Also, I don't know if this is the better tool or the better way of doing this, a good tutorial will be nice!
 


f33dm3bits

Gold Member
Gold Supporter
Credits
2,679
What other options have you tried? I have never had any problems with timeshift(used for going back to a point in time), and if you really want to use dd you can have a look here and here. You could also have a look at clonzezilla, from what I remember from clonezilla is that does all the work for you that only have to make sure that the disk you or copying your clone to is at least the same size.
 
Last edited:

particlefeever

New Member
Credits
119
What other options have you tried? I have never had any problems with timeshift(used for going back to a point in time), and if you really want to use dd you can have a look here and here. You could also have a look at clonzezilla, from what I remember from clonezilla is that does all the work for you that only have to make sure that the disk you or copying your clone to is at least the same size.
Never heard about timeshift, will investigate... I already used Clonezilla in the past, and I don't remember had this kind of trouble. I didn't used because was looking for a backup that won't need a bigger space than actualy used by data (if was using 20GB from 32GB, the backup should use 20GB or less if compressed). But since DD got this size issue, I might consider Clonezilla, even if I have to boot from USB each time...
 

f33dm3bits

Gold Member
Gold Supporter
Credits
2,679
timeshift is more like a snapshot idea, to restore your system to a certain state in time for example to restore your system to a working state or something like that. So you could install your system and configuration, create a snapshot and then afterwards you can tinker with your system until it breaks and then are able to restore to your snapshot to a work system. I think for what you described it is more what you are looking for, and in my opinion easier to use. Clonezilla has a lot of extra functions that I don't think you will be using since you are only going to be using it for the one system you were talking about or that's the idea I got from what you described.
 

jglen490

Well-Known Member
Credits
1,981
Correct, out of the box Timeshift defaults to snapshots. Nothing wrong with snapshots, until they occupy the remaining space on a partition. So Timeshift needs to be managed. Timeshift needs to learned, and configured to do what job(s) you want it to do.

For a pure backup of valued data, rsync cannot be beaten. And rsync has GUI front ends that assist and ease its own configuration. A great combination would be a managed Timeshift for snapshots, if that's important to you, along with a managed rsync to backup valued data "offsite" or at least off-machine would be a great solution.

Personally, I don't use Timeshift, and have never had a need to do so. I do use rsync on a routine basis, with a plan, to backup my data and configuration files, and have multiple target off-machine drives used on a rotation schedule. I may regret not using Timeshift, someday, but for now I don't.
 

particlefeever

New Member
Credits
119
Well, I'm still learning how to use it, but it seems a fine solution.

But I am still curious about why DD could not make a duplicate from a 32GB partition to another 32GB partition, that was odd...
 

Vrai

Well-Known Member
Credits
1,782
But I am still curious about why DD could not make a duplicate from a 32GB partition to another 32GB partition, that was odd...
Perhaps the software used to create a 32GB partition does not "see" the disk exactly the same as dd.
Perhaps dd needs some room to work (so to speak).
Maybe the 32GB partition created on the external hard drive had too many "bad" sectors.
 

jglen490

Well-Known Member
Credits
1,981
Also, another thing to consider is that "32GB" is not an exact number, depending on what you are doing . If you create a 32GB partition, using just about any filesystem, part of that 32GB will be taken up by overhead - some small amount of space to accommodate the space that the filesystem itself needs. So if your 32GB of data is going to a 32GB filesystem that may only be 30GB of actual available space, then there is a problem. So 32GB does not always equal 32GB.
 

particlefeever

New Member
Credits
119
Also, another thing to consider is that "32GB" is not an exact number, depending on what you are doing . If you create a 32GB partition, using just about any filesystem, part of that 32GB will be taken up by overhead - some small amount of space to accommodate the space that the filesystem itself needs. So if your 32GB of data is going to a 32GB filesystem that may only be 30GB of actual available space, then there is a problem. So 32GB does not always equal 32GB.
I know, but I did two 32768MB ext4 partitions exactly, I was careful on the numbers. The internal part, I mean, the ext4 layer should be exactly the same. If one byte is missing for some reason, it will generates an error in this case. Why? One reason is a bug in DD counting wrong (a common programming mistake), other... I don't know, we need some expert to examine the case!

/dev/sda4 64180224 131289087 67108864 32G Linux sistema de arquivos
/dev/sdc1 2048 67110911 67108864 32G Linux sistema de arquivos

See? The same number of sectors.
 

jglen490

Well-Known Member
Credits
1,981
Got it, but dd does a bit wise copy - of everything in the input source, and will expect that bit total to be available at the target source. It's not a bug, it is the way that dd works. Sector count is not in dd's computation. If the target is one bit too short, it won't copy, or at least it won't copy correctly.
 


Members online


Latest posts

Top