0

Following https://www.tomshardware.com/how-to/back-up-raspberry-pi-as-disk-image, I copied an image of Raspian OS lite (64-bit) from a 256 GB SSD to an external drive. After that I tried to shrink that image with pishrink and nohup. I think that did not work, because after several hours the 256GB file was still there.

Before running pishrink I displayed current processes with $$, because I was worried about the dd process maybe still running in the background (also started with nohup). $$ gave a process number and somethingalong the lines of "no command name found". Maybe I killed some important system process there? When I typed pidof dd it did not print anything. When I ran pishrink it printed something like [1] [process number] [command name].

  • What exactly is "RaspianOSlite64". There NEVER has been a 64bit Raspbian. If you want help explain using the official OS name rather than one you invented. – Milliways Nov 04 '23 at 21:47
  • Also write in paragraphs so your question is easier to understand. – Milliways Nov 04 '23 at 21:51

1 Answers1

1

It's impossible (for me anyway) to tell what you've done, and without that it's difficult to determine where you "went wrong".

I generally follow this advice when contemplating the use of dd: "If you're lucky, the filesystem corruption will be detected as soon as you try to mount the copy. If you're unlucky, it won't be detected until later". Therefore, my advice is to make a real backup of your system by creating an image file, and then write the image file to your bootable media.

How do I do that? You should use the image-backup utility that is part of image-utils. There is another Q&A here that explains the detailed steps - it's quite simple really.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • 1
    "using dd to copy a running system will typically end in disaster" -> That was my gut reaction too, until it occurred to me that most volatile information isn't on the SD card anyway -- /run, /tmp etc. are in memory mounts. There are still plenty of better ways to do this though, I don't know why someone would want to recommend that (we are all experts on the internet I guess...). – goldilocks Nov 05 '23 at 14:03
  • @goldilocks: I see your point ("most volatile information isn't on the SD card"), but I guess that also depends on what someone is doing with the computer? – Seamus Nov 05 '23 at 14:07
  • 1
    Sure. I only skimmed the article but I imagine someone who'd recommend that was not smart enough to also recommend that you leave the system as inactive as possible while doing this (and probably shut down the GUI, since bits of such tend to write bits of things to the user's home directory, which might mean the desktop could be screwed up when the image is first used). Probably best to avoid safety recommendations for driving a car blindfolded tho ("You can do this, you just have to be careful..."). – goldilocks Nov 05 '23 at 14:15