How to backup NAND straight to Linux PC

Discussion in 'Switch - Tutorials' started by RosaliinaDaHacker64, Feb 16, 2019.

  1. RosaliinaDaHacker64
    OP

    RosaliinaDaHacker64 3DS hacker.

    Member
    5
    Oct 7, 2015
    Ireland
    Loot Lake
    No room for mSD card? Own a 32GB mSD but you have homebrew files in it? Can't do partial NAND restore for <16GB mSD because Hekate won't let you? No Problem!

    I'm gonna show you how to backup your Switch NAND straight to Linux PC. It should work on other distro's.

    I'll go for Ubuntu as it's easy.


    What you need:
    A Linux operating system (dual boot or persistent Live USB)
    GParted - sudo apt-get install gparted
    ddrescue - sudo apt install gddrescue
    fusee-nano - precompiled binary
    memloader


    Backing up NAND


    Go to Settings > Power
    Set Blank screen to Never. Make sure you turn off Suspend too.

    [​IMG]



    Boot your Switch in RCM.
    Drop both the precompiled fusee-nano file and memloader.bin into fusee-nano-master repo folder.
    Launch Terminal in this directory
    Code:
    sudo ./fusee-nano memloader.bin
    Once it injects the memloader payload to the Switch, pick "ums_emmc.ini".

    [​IMG]


    Keep the USB cable plugged in.



    Launch GParted,
    switch to a 29GB drive, that is an eMMC, remember the drive letter - /dev/sdX
    DO NOT TOUCH ANYTHING BELOW. Safely close the window.

    [​IMG]



    Go to desktop, press Ctrl + Alt + T (or right click anywhere in the directory you're gonna export to > Open in Terminal)
    Input here
    Code:
    ddrescue -B /dev/sdX SwitchRawNAND.img NAND-backup.log
    
    Replace X with the drive letter of your Switch eMMC.

    It will start backing up the NAND.

    [​IMG]


    Sit back and relax, it's gonna take about 50 mins.


    When it's done, you got a NAND backup. You can now unplug a USB cable.

    [​IMG]


    To have a complete backup, don't forget to backup BOOT 0 & 1 partitions with Hekate, they're just 4MB each.


    That's it. :)



    Restoring NAND

    Go back to Ubuntu,

    Launch memloader on Switch again,

    Input in Terminal
    Code:
    ddrescue -B SwitchRawNAND.img /dev/sdX NAND-restore.log
    PLEASE confirm that you picked the correct drive letter.



    If you get a purple screen of death after restoring, don't panic, it's not bricked. It happened to me once when I restored BOOT0&1.

    [​IMG]


    All you do is run GPTrestore and it'll boot fine.
     
    Last edited by RosaliinaDaHacker64, Mar 10, 2019
  2. RideOnTheStorm

    RideOnTheStorm Newbie

    Newcomer
    1
    Feb 1, 2019
    France
    you're a boss!
     
  3. Maritoguionyo

    Maritoguionyo Newbie

    Newcomer
    2
    Mar 13, 2018
    United States
    Yeet
     
    RosaliinaDaHacker64 likes this.
  4. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    9
    Apr 3, 2014
    United States
    Planet Earth
    Nice, will try this out and see how it goes!
     
    RosaliinaDaHacker64 likes this.
  5. June15th

    June15th Member

    Newcomer
    1
    Feb 19, 2019
    Italy
    Useful. No need to reboot from win to Linux if you inject payload from an Android phone
     
    RosaliinaDaHacker64 likes this.
  6. RosaliinaDaHacker64
    OP

    RosaliinaDaHacker64 3DS hacker.

    Member
    5
    Oct 7, 2015
    Ireland
    Loot Lake
    Some people don't have USB C/microB adapter for Android or dongles. I added a link of payload injector for Linux now.
     
    June15th likes this.
  7. GerbilSoft

    GerbilSoft GBAtemp Addict

    Member
    12
    Mar 8, 2012
    United States
    I'd recommend using ddrescue instead of plain dd. Among other things, it has a progress bar and supports resuming in case the process is interrupted.

    Ubuntu package: gddrescue

    Syntax:
    Code:
    $ ddrescue -B /dev/sde NAND.img NAND.log
    
    The third parameter, NAND.log, specifies a logging file. The log file is used to store the current status of the copy, so ddrescue can continue from where it left off in case it's interrupted. (It's also used for error handling in case sectors are unreadable, which is the 'rescue' part of ddrescue, but that shouldn't be too important here.)

    EDIT: The -B parameter tells it to use binary suffixes instead of decimal. I'm not sure why ddrescue defaults to decimal (e.g. 1 KB = 1000 bytes), but it seems to be a common thing a lot of systems are doing nowadays for some reason.
     
    Last edited by GerbilSoft, Feb 21, 2019 - Reason: -B
    RosaliinaDaHacker64 likes this.
  8. RosaliinaDaHacker64
    OP

    RosaliinaDaHacker64 3DS hacker.

    Member
    5
    Oct 7, 2015
    Ireland
    Loot Lake
    I didn't knew that better imaging command exists. Thanks for suggestion, I'mma edit my post.
     
Loading...