Migrate to Atmosphere with new sd card

Thardus

Active Member
OP
Newcomer
Joined
Jun 19, 2018
Messages
37
Trophies
0
Age
39
XP
729
Country
United States
Hello! I'm hoping to be pointed in the right direction. I know this is probably been covered at length in many places but I'm having problems getting started. I bought a v1 switch with a sxos modchip several years ago, not sure what I have exactly, but I can hold Volume+ Power to start SXOS 3.0.5, which boots into emunand.

I have a 512GB microSD card with an Emutendo folder that's 32G, but I also have a sxos folder so I'm not exactly sure if I have the filesystem emunand vs hidden partition emunand. When people say hidden partition are they referring to the disk level partition you can see in a partition manager? Because I don't see that.

I run MacOS so if I make any changes to the sd card I have to run the following commands otherwise I get a black screen after the SXOS screen.

Bash:
dot_clean -m /Volumes/TXNAND/
sudo chflags -R arch /Volumes/TXNAND/
sudo chflags -R noarch /Volumes/TXNAND/Nintendo/

What's strange is I see that in DiskUtility it shows my TXNAND sd card as Windows_NTFS. I was not expecting that. The SD card I'm using is really cluttered and I want to start fresh. It looks like there are failed artifacts from when I messed with it before: several years ago before I upgraded SXOS successfully I thought I needed atmosphere so there are a bunch of atmosphere artifacts floating around.

I think I can save my saved games. I've also backed up my XCIs. I'm curious how I backup the installed games, or I guess maybe I don't need to if they're available again in the hbg shop.

I want to keep OFW untouched and run atmosphere in CFW (holding Volume+ Power to boot into it). It looks like I have access to SXOS boot menu so I can do things like CREATE EmuNAND and Delete EmuNAND though I'm a hesitant to start messing around here since I don't have a dongle or jig; not sure if I need them.

So, I want to set up a fresh 512gb micro sd with atmosphere. I don't think I need to dual boot sxos vs atmosphere but I guess it would be nice to maybe go back to SXOS if I wanted to mess around with it. Do I need to use hekate to make a new emunand and point the sxos loader to that?

I have several other homebrew consoles I set up myself but I need a little help with this one. Thanks!

EDIT: my current CFW SXOS version is 10.2.0
 
Last edited by Thardus,

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
6,341
Trophies
3
Age
46
Location
At my chair.
XP
18,648
Country
Colombia
use search at top of page and search for migrate sxos to atmosphere, there are two tutorials about you are asking, even there is one for have atmosphere and SXOS at same time.
 

Thardus

Active Member
OP
Newcomer
Joined
Jun 19, 2018
Messages
37
Trophies
0
Age
39
XP
729
Country
United States
use search at top of page and search for migrate sxos to atmosphere, there are two tutorials about you are asking, even there is one for have atmosphere and SXOS at same time.
Yes, I know the title of my thread seems redundant. Did you happen to read my post? If I mess up any steps, am I locked out of the console unless I have the dongle/jig? Can I or should I get my current set up working with a new SD card, then migrate to atmosphere? Thanks
 

Thardus

Active Member
OP
Newcomer
Joined
Jun 19, 2018
Messages
37
Trophies
0
Age
39
XP
729
Country
United States
Wow, I learned a lot tinkering with this. I think I'm starting to get it now, haha. The title of the OP probably should have been "How do I back up and restore working SXOS sd card to new sd card from scratch on Mac/Linux" or something. I know there are a bunch of Windows tools but I didn't see much in the way of MacOS probably because most can be done through command line.

I realized you can't just have SXOS create your new emunand with CFW on a new sd card because where will it get it from? It will set up your new sd card partitions for emunand correctly but I believe it just copies your OFW sysnand to your CFW emunand after it partitions everything for you. Which won't work if you have a newer, more recent OFW version. Maybe this isn't correct but I think that's what happened. I would get a black screen after SXOS load screen no matter if I had the correct contents (Emutendo/, Nintendo/, switch/, boot.dat, license.dat) on the visible FAT32/Windows_NTFS/vfat/whatever filesystem portion.

I wanted to understand what I had first before I started messing around with the working sd card so I did a full raw clone of the directly to a new card (which took forever, about 11 hours. BalenaEtcher speed was a ~1MB/s faster).

sudo dd if=/dev/rdisk2 of=/dev/rdisk3 bs=16M

Then I noticed the "hidden partition" when I stared at the output of "diskutil list" again. I don't know why I didn't notice this before...

# on MacOS this will show a ~31.3GB size difference between the disk (511.9GB) and the partition (480.6GB)
$ diskutil list /dev/disk2
/dev/disk5 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *511.9 GB disk2
1: Windows_NTFS TXNAND 480.6 GB disk2s1

When others referred to the "hidden partition" I was confused because it's not a partition in the context I thought it was. It's just the first bytes (0 to 31276925952, and starting at 0, size 1 MBR)

I had Disk Drill for MacOS installed and was able to see and backup an unallocated RAW partition in the following byte range that it saw, 0 to 31276925952. I exported the raw hidden partition to my system as hidden_emunand.dmg. This could have been done with the right "dd" shell command, something like:

sudo dd if=/dev/rdisk2 of=hidden_emunand.dmg bs=1 count=31276925953 # +1 because I think count starts at 1 instead of 0

"dd" here is slow because of the bs=1 but it's more accurate. I think I could have increased the block size but then I wasn't sure about ending on the correct byte. If you used bs=512 (the default) it wouldn't have ended on the exact byte. It was pretty easy with Disk Drill once I found it in their UI.

At this point I messed up my full clone when trying a bunch of gpt commands. So I erased it with disk utility FAT MBR on the mac just to be sure. But now I have my actual raw copy of the working emunand so instead of waiting all day to clone again, I just used that to rebuild a new working fresh from scratch SXOS sd card. (Overkill I guess since I'll be just switching to atmosphere but I wanted to know how it works. Now I can just store the 32GB SXOS emunand as a backup that I'll probably never use again, haha.)

## from original TXNAND micro sd card
sudo gpt -r show /dev/disk2
start size index contents
0 1 MBR
1 61087745
61087746 938655742 1 MBR part 7

Now that I had the hidden emunand backup ready, I copied it to my new micro sd card device (/dev/rdisk3) using "dd"

sudo dd if=hidden_emunand.dmg of=/dev/rdisk3 bs=16M status=progress #This transferred pretty fast. A little over 6 minutes at 81 MB/s.

Now I had to fix the visible FAT partition after this. I didn't have 'parted' on my mac so I plugged the new sd card in my steam deck. Linux FTW. haha. (Now I'm working with device /dev/mmcblk0)

I had to remove the index=1 partition and then recreate

parted /dev/mmcblk0 rm 1
parted /dev/mmcblk0 mkpart primary 61087746s -- -1s # or this should have worked parted /dev/mmcblk0 mkpart primary 61087746s 1001390080s

Then...

mkfs.fat /dev/mmcblk0p1

#lsblk ended up looking something like this
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
mmcblk0
└─mmcblk0p1 vfat FAT32


Now back on the Mac, just copy the correct contents (Emutendo/, Nintendo/, switch/, boot.dat, license.dat).

(I renamed my new FAT32 partition to SWITCH)

Don't forget to
dot_clean -m /Volumes/SWITCH
sudo chflags -R arch /Volumes/SWITCH
sudo chflags -R noarch /Volumes/SWITCH/Nintendo/

Now my "from scratch" sd card boots SXOS CFW like my original sd card but without all the cruft. I have a smaller backup of the working sxos emunand and I understand what's going on better.

I hope this helps someone. Maybe me in the future.

On to atmosphere.
 
  • Wow
Reactions: impeeza

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    NinStar @ NinStar: It will actually make it worse