Full Disk Image Creation/Saving

from reading your posts above, it really sounds like you are (“I need it to copy over exactly everything”). but in any case, you asked for an example of how to use dd. If you want something else, you’ll need to clarify.

1 Like

Opening post says otherwise. Additionally, I’m not looking to clone it, because I want to load the image back on to the drive at my choosing. Cloning would directly copy from an entire drive to another entire drive. With an image, you get to choose when you want to load it. I made that clear in earlier posts.

“directly copy”, yes (which is what you want — you want “exact copies”).

“from/to another entire drive” is what I described in my post , but you could write it to a file also. just use a path to a file instead of to a disk. follow link for examples.

“I want to load the image back on to the drive at my choosing” that’s fine; nothing is stopping you from doing so.

if you still refuse dd as a solution, that’s perfectly okay. I’m not trying to force it on you. I don’t know of anything that will meet your requirements and not also qualify as “cloning,” but if you can explain further, maybe we can figure it out.

Oh. Why didn’t you just say so? lol

@_adrian how would I go about loading the file/image back onto the drive then once it’s saved using/used dd?

very high-level overview: do the same thing, but switch the if and of.

suggestions:

  • DO NOT try this without first reading and getting an understanding for what happens and how.
  • DO NOT try this with your actual drives until you’ve done it a number of times, with unneeded drives (e.g., USB drives) and unneeded data, and gotten the results you expect.
  • remember, it is NOT possible to double-check “too much” !

Will dd work at the every single bit level? I know someone said “block”, but I think I found the appropriate term I should be using.

yes, copies bit-for-bit

1 Like

Thanks. As upon reading the Arch Wiki, it appears my understanding of cloning was off. Thank you for the information. My original understanding was that cloning was literally from disk to disk (with no image involved etc…). I didn’t know it gave more options than that.

1 Like

You can do a block to block copy if you’d like, including empty space on the source disk. It’s usually called RAW copy or “sector-to-sector” copy and is only used on unrecognized file systems by default, but I’m sure you can force it if you’d prefer.

Note that there are only a few reasons I can think of off the top of my head that someone would want to use this method, and none of them are for simple disk imaging. One would be data recovery. I’ve used this to make an exact copy of a disk that someone accidentally formatted or wiped for whatever reason. I’d then use data recovery software on the clone. Another would be an encrypted disk. Both of these cases are similar because there is not a recognized file system on the disk and the OS is not sure what sectors have data and which are free, so you have to copy them all.

If you wanted to get a single file or directory off the image you made, clonezilla would require you restore the whole disk and then get the files you need. Many other disk imaging solutions allow you to mount the image and pull whatever files you need without a full restore to a phyiscal disk. It may have this ability now, but it didn’t the last time I used it.

-removed

So the commands to clone an entire drive to a drive’s partition and the resulting clone/what is being cloned over to the drive is/would be the cloned entire drive in image form, what would the code be exactly/how would I find out?

I don’t think I understand your question.

Perhaps I should be more clear — dd is a very low-level tool. That is, it does literally whatever you tell it to, even if what you tell it makes no sense. dd is not a user-friendly program packaged for users. It is a tool for people who have learned how to use dd. This is why I’ve repeated my advice to “read first,” and to practice with expendable hardware+files, and to be very very careful.

It’s also why I have not even attempted to give you “copy+paste” commands to run.

If you want something with a shorter learning curve and less risk of complete-data-loss-because-you-made-a-typo, then you should look at other solutions (e.g., clonezilla).

2 Likes

Okay, yeah that was probably asking for a bit much. I’m trying to construct the Terminal command at the moment.

Just to be clear, since I want to clone the entire drive, it should be something like:

dd if=/dev/sda

as the starting piece, right?

if you mean, “is this syntax correct,” then yes. if you’re asking whether that’s the correct path, I could not tell you.

start with copying files.

I assume you mean you’re not able to say because you don’t know for certain of the drive identifier, right?

If the drive’s identifier from the lsblk command or the fdisk -l command is sda, then it is entered correctly, right?

Or would you need more information?

If you want this on an entire network…

https://fogproject.org

FOG I’d what I run at home.
Backup via the Ethernet to a network share.
Remote management.
It’s free and can be run on a raspberry pi.

also, i don’t want you running the command until you know enough to be sure (on your own) that it’s correct. :wink:

I know. I’m going to use USB drives as a start and if it goes well, I’ll sue my main testing HDD and if that works I might try the real thing.

But it would help to know if what I asked is correct so I can progress forwards.