Hardware Reading/writing NAND using dd under Mac OS X / Linux

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
My n3ds is on its way back from being hardmodded and I've got a card reader which should be compatible. I'm a Mac user and don't have a Windows machine I can use. Windows isn't cooperating with my Mac so I can't use win32diskimager for reading/writing the NAND. I can use Linux on my RPi. Do any Mac or Linux users have experience of reading and writing the NAND from a hard modded 3ds? I'm comfortable with the command line and have used dd to write RPi Linux images to SD, but want to make sure I use the correct syntax and block size. I basically want to make sure the image I take is valid before potentially writing it back...
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
Yeah I know, as I said I have used that command before but want to make sure I get the block size etc correct. However, @gamesquest1 has taken and verified some NAND dumps so I should be safe to experiment with reading and writing images. I'll have a play with dd and once I find something that works I'll post up a tutorial.
 
  • Like
Reactions: CrispyYoshi

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
i remember using bs=1m in my command aswell, however it can be used without apparently
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
I also use bs=1m when reading/writing raspberry pi images. I'll take one image with this and one without and compare the md5sums to see if it actually makes a difference.
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
Just reporting back now I've got my 3DS back :) I was feeling brave so I made a NAND backup using EmuNAND9, and then used my hard mod to restore my 9.2 and 10.3 backups. The following commands worked on my Mac:

Code:
# read
$ sudo dd if=/dev/rdisk3 of=~/Desktop/9.2NAND.bin bs=1m

# write
$ sudo dd if=~/Desktop/9.2NAND.bin of=/dev/rdisk3 bs=1m

I actually read four images: two using bs=1m, and two without. The md5sums for all four were identical, meaning there was no difference in the NAND dumps. However, using bs=1m significantly reduced the time taken to read the NAND. The same applied when writing - copying the NAND dump back to the 3DS took over an hour without bs=1m, but when I added bs=1m it took significantly less time. They both worked fine once written, one was just much faster than the other.

Edit - you obviously need to change the device from /dev/rdisk3 to the actual device the 3DS shows up as on your system. On a Mac you can find this by typing "diskutil list" into the terminal and looking for the 2GB disk.
 
Last edited by mashers,
  • Like
Reactions: Tjessx

reeso3000

Member
Newcomer
Joined
Mar 2, 2016
Messages
7
Trophies
0
Age
42
XP
192
Country
Mashers - can you confirm that it as just the built in sd card reader on the mac and out of curiously the version of mac? im using a late 2013 macbook pro and looking to read and write using the commands you have posted. Thanks in advance!
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country

reeso3000

Member
Newcomer
Joined
Mar 2, 2016
Messages
7
Trophies
0
Age
42
XP
192
Country

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
Thanks for the quick reply! Just wondering if you have attempted it at all? I have written images to my orange pi (raspberry pi wannabe) which I believe is writing raw with the built in reader. I am assuming there would be no harm in trying to read the nand with it if no one has tried it?
I've just tried it on my mid-2011 iMac and it didn't work :( The 3DS just booted up as though the hardmod cable wasn't attached. When I used my USB card reader subsequently it worked, so I think the chipset of the iMac is simply not compatible with the 3DS NAND. Other Macs are probably the same. It's likely just a coincidence that your OPi just happens to have a compatible chipset.

There should be no harm in testing it on your Mac just in case it has a different USB chipset, but it's highly unlikely - I think all Macs use Intel integrated stuff for the built-in USB, graphics, audio etc. Your best bet is the Plugable USB adapter I linked above.
 

reeso3000

Member
Newcomer
Joined
Mar 2, 2016
Messages
7
Trophies
0
Age
42
XP
192
Country
I've just tried it on my mid-2011 iMac and it didn't work :( The 3DS just booted up as though the hardmod cable wasn't attached. When I used my USB card reader subsequently it worked, so I think the chipset of the iMac is simply not compatible with the 3DS NAND. Other Macs are probably the same. It's likely just a coincidence that your OPi just happens to have a compatible chipset.

There should be no harm in testing it on your Mac just in case it has a different USB chipset, but it's highly unlikely - I think all Macs use Intel integrated stuff for the built-in USB, graphics, audio etc. Your best bet is the Plugable USB adapter I linked above.

Thanks again for your prompt response and for the detailed info!
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
Thanks for the quick reply! Just wondering if you have attempted it at all? I have written images to my orange pi (raspberry pi wannabe) which I believe is writing raw with the built in reader. I am assuming there would be no harm in trying to read the nand with it if no one has tried it?
I attempted it, and it doesn't work.
Edit: retina macbook pro 13" 2014
 

reeso3000

Member
Newcomer
Joined
Mar 2, 2016
Messages
7
Trophies
0
Age
42
XP
192
Country
I attempted it, and it doesn't work.
Edit: retina macbook pro 13" 2014
Thanks for the info!! I have tried a few readers I managed to get hold of but they won't recognise the "sd card" once plugged into windows/osx but I get the correct blue screen (from pics I have seen and the numbers match).So im guessing its just the readers rather than my soldering. Have ordered one for delivery on monday which seems so far away right now with my 3ds in pieces on my desk!! ;p
 

reeso3000

Member
Newcomer
Joined
Mar 2, 2016
Messages
7
Trophies
0
Age
42
XP
192
Country
Sorry for the double post but just wanted to say thanks again for the info guys - Managed to use a cheap micro sd card reader I had lying around, ended up using windows as my mac wouldn't recognise even a micro sd card let alone read the nand.
 

mashers

Stubborn ape
OP
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
40
Location
Kongo Jungle
XP
5,074
Country
Glad you got it working mate :) make sure you take a few NAND dumps one after the other and compare the md5sums to make sure you got a valid dump :D
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: