Can i "save" an image of my Windows Installation through Linux?

So, Situation is, i have two OS SSD’s. One with Windows 10, one with Linux (Getting a third, bigger one tomorrow). I currently don’t need my windows Install and would like to free up the bigger SSD it occupies for my Linux Install. But i’d like to keep it’s current state in case i missed something and need it back.

So, can i just “dd” the whole /dev/sda/ to a file on my storage drive and in case i need it “dd” it back to an SSD, or do i need to do something special to have it back bootable in the end? Is there something faster than dd to make this process?

Final question: I missed setting up my Ubuntu with LVM (regrettably so). One big “/” partition. Can this be transfered to a bigger drive and extended? If not, i might just reinstall, but the option would be nice. I know i can theoretically extend ext4 partitions (just not shrink), but am not sure what to look after in terms of bootability, grub and UEFI partition etc when moving to another drive.

dd should do exactly what you want to backup your windows install. No special sauce needed since its low level. Its going to copy even the blank space though so to restore the image youll need atleast the same amount of space on the target drive.

LVM should make extending the Ubuntu partition easier in theory. I have no practical experience with the practice of doing it though. Either way I dont see why you couldnt just use gparted to extend it.

As long as you dd /dev/sda and not one of the individual partitions, you can use dd to restore it. But you don’t have to fully restore it to just get files from it. You can always “mount” the image and use it like a regular file system.

Edit: ninja’d by adubs

Oh, i have no Problem extending LVM partitions. Did so many times. This one is ext4, one single big partition sadly. But since i wanted to give Fedora another shot anyways, that’ll go onto the Windows Drive and the Ubuntu will have to make due with 120G for now.

Yeah, thought so. dd’ing 240G to a spinning 5400rpm drive as we speak. This might take a while :wink:

One caveat is you probably want to run your “dd if=/dev/sda of=yourimage.iso …” command from something like a live boot usb and not from the system that you are cloning so changes to system don’t affect the clone.

Yeah no Problem. I’m cloning my Windows Install from my current Productive Linux on a different drive, so should be no Problem.

Lol, I knew that too, it just went completely out of my mind. Woops

I would recommend looking at:

https://wiki.archlinux.org/index.php/Dd#Disk_cloning_and_restore

You can also compress the image to reduce the size of it (All that empty space)

dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /path/to/backup.img.gz

1 Like

Only about 10G where left on that drive, so i’m not gonna worry saving 10G on a 4TB drive as i’m half way through the Tranfer. I’ll keep it in mind though for the next time i do that!

download and burn a copy of clonezilla, study it and learn to use it.
I use it extensively and there are many options to choose from for cloning a drive.
you can also resize partitions during choice of cloning method.
you can also clone machine to machine and network clone.
clonezilla is fast and a big bonus its free!

1 Like

You certainly can however i would suggest (not firmly, just a warning) you

  • use safe® tool (with warnings) for it
  • be prepared for disaster if you decide to do it the man’s way with DD

I’ve seen plenty of people DD to the wrong location accidentally in the past (e.g., writing to a device instead of a file, or picking the wrong device name to DD to, or accidentally backing up the wrong device name and then having nothing to restore from, etc.) and if you’re doing it with DD you have no safety net. it will do exactly what you tell it to :smiley: