0

I have a failing HDD that I want to fully backup and replace withing the next few days. I am running OMV6 with my Plex Server attached to it. I watched a video on YouTube how to copy the content of mt HDD. I also was reading on how to compress the content of my drive and save it as an image, and then decompress it again when I am ready to restore it.

I did modify this to represent my current drives, The command I saw to use on YouTube is as follows:

sudo dd if=/dev/sdk of=/dev/sdf1 bs=1M status=progress.

My question is when reading if I'm to understand this correctly, to compress and make an image the command would be, take note I'm not writing to a SD card but rather an HDD:

sudo dd bs=1M if=/dev/sdk | gzip -c > /dev/sdn-copy.img.gz

And to decompress it:

gunzip -c dev/sdn-copy.img.gz | dd of=/dev/sdk bs=1M
MarianD
  • 1,026
  • The first / in gzip -c > /dev... in your second command is not good. You can or should save the output of the gzip command to a file under your home directory. – FedKad Mar 12 '23 at 09:15
  • 1
    You should also consider using ddrescue instead of dd. – FedKad Mar 12 '23 at 09:25
  • @ FedKad Thanks, but the problem with saving anything else on the drive, is that it is failing, and i will be replacing it within the next few days once the new one arrives. In the mean while i probably will have the system shutdown to prevent any further damage to the drive. It's a WD spindle drive being replaced with a Samsun SSD. – Bruce-Wayne Mar 12 '23 at 14:35
  • So should it be : gunzip -c /dev/sdn-copy.img.gz | dd of=/dev/sdk bs=1M. But you are saying i can also saying this is also a viable method of getting the same results: gunzip -c /dev/sdn-copy.img.gz | ddrescue of=/dev/sdk bs=1M – Bruce-Wayne Mar 12 '23 at 14:38
  • Why are you saving your gzipped file into a root-owned system directory (/dev)? Save it somewhere in your home directory or to an external disk. – FedKad Mar 12 '23 at 15:22

0 Answers0