What's the unix dd command to backup/restore the 3ds nand?

Discussion in '3DS - Console, Accessories and Hardware' started by 3xkrazy, Jun 30, 2015.

  1. 3xkrazy
    OP

    3xkrazy GBAtemp Regular

    Member
    290
    58
    Jun 2, 2013
    United States
    So if my device node is /dev/sdb1 on Gentoo Linux, will the command look something similar to this?

    // unmount 3DS nand if mounted
    $ sudo umount /dev/sdb1

    // Backup 3DS nand
    $ sudo dd if=/dev/sdb1 of=nand.bin bs=1

    // Restore 3DS nand
    $ sudo dd if=nand.bin of =/dev/sdb1 bs=1
     
  2. BerserkLeon

    BerserkLeon Not-so-new member

    Member
    434
    63
    Mar 22, 2010
    United States
    Pennsylvania
    Why bs=1? and why not just su so you dont have to sudo every time
    Also you should be able to tell if the partition is mounted without needing umount.
    I could be wrong but as it's not a common file system format, I don't believe it gets automatically mounted.
     
  3. 3xkrazy
    OP

    3xkrazy GBAtemp Regular

    Member
    290
    58
    Jun 2, 2013
    United States
    typos...

    Using an Anker card reader, my Gentoo system detects the nand at /dev/sdb

    So for backing up the nand it should be:

    Code:
    $ sudo dd if=/dev/sdb of=nand.bin bs=1M
    I still can't figure out how to write back to the nand. Running:

    Code:
    $ sudo dd if=nand.bin of=/dev/sdb bs=1M
    gives me an error saying that the device is read-only. I switched it over to Windows and used Win32DiskImager and it writes fine. Maybe I need to mount the memory before restoring? If someone can point me in the right direction that would be great.

    I don't need to be a super user all the time so I don't use that command.
     
  4. 3xkrazy
    OP

    3xkrazy GBAtemp Regular

    Member
    290
    58
    Jun 2, 2013
    United States
    Just wanted to give a quick update for anyone using a hardmod and Linux. The commands in my second post are indeed correct, as I was able to read and write to the nand after making sure my SD card was properly seated in the adapter. When I tried to write to the nand earlier, my card wasn't seated properly, so it didn't short the write pin correctly, thus giving me an error about the device being read-only.
     
    BerserkLeon likes this.
  5. MDFang

    MDFang Member

    Newcomer
    48
    2
    Mar 25, 2011
    Netherlands
    Does the block size matter, or can I just leave it at default (512 bytes I believe)?