RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    [SOLVED] Restoring image using DD on Linux - quick question

    Scheduled Pinned Locked Moved Help and Support
    restoreimagelinux
    7 Posts 3 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RanmaR
      Ranma
      last edited by Ranma

      Hey folks. I made an image using the dd command on my Manjaro install about a week ago. I decided today to write it to a spare SD card to make sure it works. I got some feedback in the terminal I'm not sure about and I'm hoping you can help! Details below:

      [me@me-pc ~]$ sudo dd if=/home/me/Retropie/Retropie_Backup.img  of=/dev/sdb
      [sudo] password for me: 
      dd: writing to '/dev/sdb': No space left on device
      124735489+0 records in
      124735488+0 records out
      63864569856 bytes (64 GB, 59 GiB) copied, 15042 s, 4.2 MB/s
      

      I was a bit concerned about the "records in" and "records out" bit being a single digit out, and the "no space left on device" message too. Does it look like it's worked to you?

      I'm not really experienced enough with dd, so whatever knowledge you can impart is very much appreciated. Many thanks.

      1 Reply Last reply Reply Quote 0
      • RanmaR
        Ranma
        last edited by

        Lol, answering my own question. No it hasn't worked. "Could not mount device". In KDE:

        An error occurred while accessing 'retropie', the system responded: The requested operation has failed: Error mounting /dev/sdb2 at /run/media/me/retropie: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error
        

        Back to the drawing board!

        1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator
          last edited by

          Use pishrink on the .img file before attempting to write it again, that might get around the small difference in bytes.

          1 Reply Last reply Reply Quote 0
          • RanmaR
            Ranma
            last edited by

            Thanks for replying. I tried PiShrink as you say but it seems to hang on a black screen on reboot. I imagine it takes time to expand the filesystem, but it seemed to complete that (though I note no messages while it does), and it then went to the splash screen. But then...nothing! Is this a common problem? Many thanks.

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @Ranma
              last edited by

              @Ranma Without an actual error, there's not much to diagnose. Maybe disable the splash on the shrinked image and you can see if there are any errors displayed.

              1 Reply Last reply Reply Quote 0
              • BuZzB
                BuZz administrators
                last edited by BuZz

                Use kpartx to mount the image (easier than doing it manually working out partition offsets). Then tune2fs and shrink the ext4 partition. Then unmount, and write it. Can't give instructions as on phone. But should work.

                [Edit] you probably need to shrink the partition after also with parted.

                To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                1 Reply Last reply Reply Quote 0
                • RanmaR
                  Ranma
                  last edited by

                  Thanks for the replies folks. Turns out the whole black screen thing on reboot is me being impatient while it restores the space on the new SD card.

                  I tried it all again from scratch with Pishrink, only this time left it for about 20 minutes after the splash screen then black screen thing. It went to the black screen as before but I decided to be patient this time and after about 20 mins or so it rebooted itself into Emulationstation as it should. Everything seems to be running absolutely fine. Thrilled to bits! Really wanted to keep this image as I'd put a lot of weekends into it!

                  Thanks again. :-)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.