Create Disk Image of a Drive's Partition Using dd Commands

learn the dd command

1 Like

I managed to get it to output to another drive, but for some reason it really just does not want to cooperate with the whole disk identifier thing at the beginning of the of= output. I don’t get it.

edit: Command for separate drive added
dd if=/dev/sda1 of=/run/media/liveuser/DriveName/FileName.img

well /dev is like… the device itself

where the mount point is using the file system and stuff, if you point it at a device like /dev/sdb, it would just write exactly /dev/sda to /dev/sdb overwriting filesystem and everything, but if its already mounted and stuff might give issue

dunno never had it happen really… just always wrote it to through the mount point if i was creating a file or whatever(can use dd to make a file of zeros or whatever, to make say, a swap file, encrypted volume whatever)

the out part (of=) will overwrite if something is there so if you want to out to a drive thats fine but be sure that its the correct drive. sda is normally your boot/system drive. seems you may have something else with your live system. /dev/sda1 is device / drive A partition 1 of drive A so if your DDing from one disk to another its something like /dev/sda to /dev/sdb to copy the drive from first bit onward
or copy a disk to file would be /dev/sda to /home/user/Desktop/drivebackup.img

or just a partition if not needing boot info would be the partitions number after sdx like this > /dev/sda1 to /home/user/Desktop/externaldrive.img

EDIT: now im wondering what happens when you dd a drive to its self. would it pick that data up and place it back down giving you a completely unchanged drive because it was told to write its self to its self??

I was thinking about doing dd but directly to something like mega or my off serv (I have too much files on my vps and just a bit of free space QQ) is there any tool or something? Or do I just need to clean up my vps and get it off via sftp.

That sounds like something to start a new topic/thread over. I only did it to another drive because of SSDs and HDDs, I think yours relates more towards networking. I’m not expert, but knowing how cool Linux, I’d say it sounds possible. I’m thinking something like a plugin though. I really don’t know, sorry man. :\