Moving from SX OS SD-emunand to SD-hidden_emunand

Discussion in 'Switch - Tutorials' started by GraFfiX420, Dec 18, 2018.

  1. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    Thank you for the guide, I was looking to do the same, however I'm not familiar with dd.
    I want to flash the emunand.bin file (~29GB) to a 128GB microSD, If I flash that as you wrote in the OP, what will happen to the remaining space in the microSD?
     
  2. thaikhoa

    thaikhoa GBAtemp Advanced Maniac

    Member
    8
    Sep 16, 2008
    Will leave all the remaining space untouched.
     
  3. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    I tried to do this with dd for Windows, but if I try to flash the emunand image when the SD is already formatted it gives me an access denied error. If I remove the partition form the SD (leaving it as unallocated space) I can flash the image, but after the flash Windows just see the SD as raw partition and I can't do anything with the remaining space.
     
  4. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    I'm doing some research about this, I don't understand why we dump the first 1024 bytes, isn't the MBR long only 512 bytes? @GraFfiX420
     
    Last edited by massijay, Jan 12, 2019
  5. Kikolasi3D

    Kikolasi3D Member

    Newcomer
    2
    Jan 10, 2014
    I can get it to work a few times but suddenly the FAT32 partition with the emutendo folder and all my files loses its format. But it's still there with all my files, only without the format. Does someone know why is this happening?

    Edit with more details: Suddenly when I enter the sd again in the pc for transfering a file, it tells me to format the sd, and when I watch it with Diskpart or EaseUS Partition Master, the partition with all the files doesnt have his format anymore.
     
    Last edited by Kikolasi3D, Jan 12, 2019
  6. josete2k

    josete2k GBAtemp Fan

    Member
    4
    Apr 24, 2009
    Spain
    Spain
    You have to create your hidden emunand from SXOS menu.

    Once finished you can flash your own files in it.

    boot0.bin starts after the first 1kb.

    The first 1k MUST BE dumped from destination device.
     
    Last edited by josete2k, Jan 12, 2019
    massijay likes this.
  7. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    Yeah, I discovered that after a few tries, but it's a big waste of time.
    I saw with fdisk that in my SD with emunand there are 29.13GB (exactly 61087746 sectors, 61087746*512=31276925952 bytes) of unallcated space before the fat32 partition. That's exactly 1024 bytes more than the raw emunand files size.
    Instead of creating a new emunand from sx os and then flashing our previous files, why can't we just create those partitions (actually unallocated space + fat32 partition), then dump the first 1024 bytes and finally flash the files as the OP said?
    I'll try this when I have some free time.

    What's inside the first 1k?
     
  8. GraFfiX420
    OP

    GraFfiX420 GBAtemp Fan

    Member
    7
    Oct 14, 2009
    United States
    The mbr, and there's a line with reference to TX in plaintext, and I'm guessing some sort of trickery to hide the space.
     
  9. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    I managed to create the correct partition table manually and after flashing the emunand files, I think that I've understood well what's inside the first 1024 bytes, but I'm unsure about a few bytes in the second half of them.
    Can you post or PM me your first1024.bin? I'll write what I know after I fully understood that
     
  10. GraFfiX420
    OP

    GraFfiX420 GBAtemp Fan

    Member
    7
    Oct 14, 2009
    United States
    The text I see is "TXNAND" and "Team Xecuter ñ Rocking the Switch forever and beyond", here's a first 1024, mostly zeroes.
     

    Attached Files:

  11. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    Thank you

    I wrote a small explaination of the first 1024 bytes' content:
    first 1024 bytes
     
    gnilwob, Garou and GraFfiX420 like this.
  12. kublai

    kublai GBAtemp Fan

    Member
    5
    May 29, 2008
    United States
    I installed EMUNAND but I forgot if its v2.3 or v2.4, is there a way to find out which version of EMUNAND is installed?
     
  13. Kikolasi3D

    Kikolasi3D Member

    Newcomer
    2
    Jan 10, 2014
    Any help? :cry:
     
  14. GraFfiX420
    OP

    GraFfiX420 GBAtemp Fan

    Member
    7
    Oct 14, 2009
    United States
    This is great info, maybe divine can create a utility for backup/migration now.
     
  15. GraFfiX420
    OP

    GraFfiX420 GBAtemp Fan

    Member
    7
    Oct 14, 2009
    United States
    Possibly a bad/fake sd?
     
  16. Kikolasi3D

    Kikolasi3D Member

    Newcomer
    2
    Jan 10, 2014
    I have been using it since July and no problems, it's an original 128gb Kingston
     
  17. GraFfiX420
    OP

    GraFfiX420 GBAtemp Fan

    Member
    7
    Oct 14, 2009
    United States
    What are the exact steps you're using, and are you moving to a larger SD card or just moving from SD emunand to hidden?
     
  18. Kikolasi3D

    Kikolasi3D Member

    Newcomer
    2
    Jan 10, 2014
    I'm just moving from SD emunand to hidden in the same sd card. I backed up the first 1024 bytes like in the OP, concatenated the files with HxD since it gave me errors the other way, and then used this in Windows:
    dd if=F:\emunand.bin of=\\?\Device\Harddisk3\Partition0 bs=2M conv=noerror,notrunc --progress
     
  19. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    You should first verify if your sd card is not fake with h2testw.
    After the software above confirmed the sd card is good you can proceed creating emunand with sx os (I haven't managed to create the partition table correctly with only Windows yet).

    On Windows the commands should be:
    Read the first 1024 bytes
    Code:
    dd if=\\?\Device\Harddisk1\Partition0 of=first1024.bin bs=1024 count=1
    Concatenate emunand files
    Code:
    copy /b first1024.bin + boot0.bin + boot1.bin + full.00.bin + full.01.bin + full.02.bin + full.03.bin + full.04.bin + full.05.bin + full.06.bin + full.07.bin emunand.bin
    Write emunand on the sd card
    Code:
    dd if=emunand.bin of=\\?\Device\Harddisk1\Partition0 bs=2M --progress
    Obviously you have to specify the correct disk/partition and paths
     
    Last edited by massijay, Jan 15, 2019
    Kikolasi3D likes this.
  20. massijay

    massijay Member

    Newcomer
    4
    Dec 15, 2011
    Italy
    On Linux (I used Ubuntu) you can create the correct partition table this way (you are going to format the target sd card, make a backup first if needed):
    (Obviously you have to specify the correct disk/partition and paths)
    Code:
    sudo fdisk -l
    sudo umount /dev/sdc1          // Unmount disk
    sudo fdisk /dev/sdc            // Select disk
    d                              // delete existing partition
    n                              // new partition
    p                              // primary
    1                              // partition 1
    61087746                       // First sector
    (leave empty)                  // Last sector
    Y                              // Yes, remove signature
    t                              // Partition type
    c                              // FAT32 (LBA)
    w                              // Write changes
    sudo mkfs -t vfat /dev/sdc1    // Format new partition Fat32
    Then, dump the first 1024 bytes
    Code:
    sudo dd if=/dev/sdc of=first1024.bin bs=1024 count=1
    Now open the first1024.bin file with an hex editor and do the following:
    • Set to zero the first 0x1BE bytes (from 0 to 0x1BD)
    • Paste the "Team Xecuter signature" in the last 512 bytes (right after 55 AA)
    The final result should be as in this picture (The red and orange areas should match the same areas in your file)
    Now, the procedure is almost the same as in the original post.
    Concatenate emunand files
    Code:
    cat first1024.bin boot0.bin boot1.bin full.00.bin full.01.bin full.02.bin full.03.bin full.04.bin full.05.bin full.06.bin full.07.bin > emunand.bin
    Write emunand on the sd card
    Code:
    sudo dd if=emunand.bin of=/dev/sdc bs=2M conv=noerror,notrunc status=progress
    Finally, copy your files in the sd card and SX OS will recognize the emunand!
     
    GraFfiX420 likes this.
Loading...