Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

3DS:Rebuild Title Database: Difference between revisions

From Hacks Guide Wiki
Gruetzig (talk | contribs)
Ajl721 (talk | contribs)
No edit summary
 
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
title.db is a file. For more info check out [https://www.3dbrew.org/wiki/Title_Database 3dbrew].
This page is a guide to rebuilding the <code>title.db</code> file in your SD card.  


=== What you need ===
<code>title.db</code> is the name for two files - one on the 3DS' SD card, and one on its CTRNAND - which contain a list of all installed 3DS titles for its respective part of the filesystem (e.g. your SD card's <code>title.db</code> only has entries for titles installed to your SD card). For more information, check out [[3dbrew:Title Database|3dbrew]].


* The latest release of [https://github.com/wwylele/save3ds/releases save3ds] for your operating system
===What you need===
* The latest release of [https://www.python.org/downloads/ Python 3]
* a 3DS console with boot9strap
* [https://github.com/ihaveamac/3DS-rom-tools/raw/master/seeddb/seeddb.bin seeddb.bin]


=== Section I - Preparing the files ===
*The latest release of {{GitHub|wwylele/save3ds/releases/latest|save3ds}} for your operating system
*A version of [https://www.python.org/downloads/ Python 3.8 or later]
*A 3DS console with custom firmware
*{{GitHub|ihaveamac/3DS-rom-tools/raw/master/seeddb/seeddb.bin|seeddb.bin}} (direct download link)
*boot9.bin (same for all consoles) and movable.sed (specific to yours only) - dump with [[3DS:Dump system files]]


# Launch GodMode9 by holding START on boot
===Section I - Preparing the files===
# Navigate into <code>[M:] MEMORY VIRTUAL</code>
# Press A on <code>boot9.bin</code> then select "Copy to 0:/gm9/out"
# Press A to continue
# Press B once to return to the main menu
# Navigate into <code>[1:] SYSNAND CTRNAND</code> -> <code>private</code>
# Press A on <code>movable.sed</code>, then select "Copy to 0:/gm9/out"
# Turn the 3DS off
# Insert the SD card into your computer
# Go to https://github.com/ihaveamac/rebuild-title-database
# Click the green <big>Code</big> button, then click "Download ZIP" to download it
# Extract the contents of the <code>.zip</code> into a folder
#* Lets call this folder "rebuild folder"
# Go to <code>gm9</code> -> <code>out</code> on your SD card
# Copy <code>movable.sed</code> and <code>boot9.bin</code> to the rebuild folder
# Create a folder called <code>3ds</code> in the user directory (C:/Users/[your username]/)
# Copy <code>seeddb.bin</code> to the <code>3ds</code> folder in that directory
# Copy <code>save3ds_fuse.exe</code> from the  save3ds <code>.zip</code> to the rebuild folder


=== Section II - Section II ===
#Turn the 3DS off
#Insert your SD card into your computer
#Go to the {{GitHub|ihaveamac/rebuild-title-database|Rebuild Title Database}} repo's page
#Click the <big><span style="background:#008000">Code</span></big> button, then click '''Download ZIP'''
#Extract the contents of the downloaded <code>.zip</code> into a folder
#*This folder will be referred to as the "rebuild folder" from now on
#Copy <code>movable.sed</code> and <code>boot9.bin</code> to the rebuild folder
#*If you had just dumped them from your console, both are most likely in <code>sd:/gm9/out</code>
#Copy <code>seeddb.bin</code> into the rebuild folder
#Copy the <code>save3ds_fuse</code> binary from the save3ds <code>.zip</code> file into the rebuild folder


# Navigate to the rebuild folder in file explorer
===Section II - Rebuilding the database===
# Click the Address bar, then replace the address with <code>cmd</code> and press ENTER
{{info|If you are not on Windows, replace <code>py -3</code> with <code>python3</code> in all commands.}}
#* This should open a command prompt window
# In the command prompt, enter the following command: <code>py -3 -mpip install --user -r requirements.txt</code>
# Then enter the command: <code>py -3 rebuild-title-database.py -b boot9.bin -m movable.sed -s X: -o out</code>
#* replace X: with the drive letter of your SD card, which should be inserted into your Computer
# Next <code>save3ds_fuse --db sdtitle out --import --boot9 boot9.bin --movable movable.sed --sd X:</code>
#* replace X: with the drive letter of your SD card, which should be inserted into your Computer
# If you didn't get any errors, your apps should reappear, if not and they appear greyed out in System Settings -> Data Management -> Nintendo 3DS -> Software, run [[3DS:Faketik|faketik]]


=== Troubleshooting ===
{{warning|The commands in this section are case-sensitive. Enter them exactly as written, or there may be unintended consequences.}}


* Make sure you have boot9.bin and movable.sed in the rebuild folder
#Navigate to the rebuild folder in file explorer
* Make sure the SD card is inserted and you can view and edit its contents
#Hold SHIFT and right-click anywhere in the folder's empty space, then click the option that opens a terminal, PowerShell, or Command Prompt
* ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
#In this new window, enter the following commands one at a time:
** Make sure you are in the rebuild folder and that you extracted the contents of rebuild-title-database-master.zip in it
##<code>py -3 -V</code>
** When you fix this, delete the out folder and try the failing command again
##*If this does not print the Python version, it is either not installed correctly, or the wrong command was used. Please read the note above.
##<code>py -3 -mpip install --user -r requirements.txt</code>
##<code>py -3 fix-titledb.py -b boot9.bin -m movable.sed -s X:</code>
##*If you are on Windows, replace <code>X:</code> with your SD card's drive letter. If you are not on Windows, replace <code>X:</code> with your SD card's mount point.
##<code>py -3 rebuild-title-database.py -b boot9.bin -m movable.sed -S seeddb.bin -s X: -o out</code>
##<code>./save3ds_fuse.exe --db sdtitle out --import --boot9 boot9.bin --movable movable.sed --sd X:</code>
##*If you are not on Windows, remove <code>.exe</code> from this command
#If you didn't get any errors, your apps should reappear on the HOME Menu immediately
#*If they only appear in '''System Settings''' -> '''Data Management''', follow '''one''' of these sets of steps based on how they appear.
#**Appear normally: Check the contents of <code>sd:/Nintendo 3DS/<id0>/<id1>/title/00040000</code>; there should only be more folders inside that folder.
#***If there is a file inside this folder, your apps are at least partially corrupted - backup your SD card to your PC, [[Formatting an SD card|reformat it]], and then try to move the backed-up files back to the SD. If this fails or the apps do not reappear afterward, [[Checking SD card integrity|check your SD card for hardware damage]].
#**Appear with a grey block count indicator and an X through their icons: Run [[3DS:Faketik|faketik]].
#**Appear with white/corrupted icons, 0 block count, and/or corrupted name: Whatever destroyed your <code>title.db</code> has also permanently corrupted your apps. Backup your SD card to your PC,[[Formatting an SD Card|reformat it]], and then [[Checking SD card integrity|check it for hardware damage]].
#*If they do not appear anywhere in the system, you may want to [[Checking SD card integrity|check your SD card for hardware damage]], as the apps are likely gone.
 
===Troubleshooting===
 
*<code>boot9.bin</code> is missing from <code>[M:] MEMORY VIRTUAL</code>
**Follow the steps to [[3DS:Dump system files|dump your system files]] for more in-depth instructions, including those for bootloaders other than [[3DS:boot9strap|boot9strap]].
*The first command in Section II gave the error <code>ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'</code>
**Make sure you are in the rebuild folder and that you extracted the contents of <code>rebuild-title-database-master.zip</code> into it.
***Once this is fixed, delete the <code>out</code> folder and try the command again.
*The third or fourth command in Section II failed
**Make sure you have <code>boot9.bin</code> and <code>movable.sed</code> in the rebuild folder.
**Make sure your SD card is inserted and you can view and edit its contents.
*The fifth command in Section II failed
**If you are on macOS, try installing {{GitHub|osxfuse/osxfuse/releases/latest|osxfuse}}, either via its GitHub page or via [https://brew.sh Homebrew].
 
====<code>Input/output error</code> on fourth command in Section II====
{{info|These instructions are for Linux users, and will not work on Windows.}}
#'''''Unmount''''' the SD card from your computer.
#Open up a terminal window, and enter the following commands one at a time:
##<code>watch lsblk</code>
##*After running this command, re-insert the SD card into your computer. The terminal window should now show a new partition of some kind. '''This is the SD card's partition'''. For example, <code>sda -> sda1</code> may have appeared after re-inserting the SD card. Keep this in mind, as you'll need it later.
##*Once you see what partition the SD card is, press <kbd><kbd>Ctrl</kbd> + <kbd>C</kbd></kbd> to stop monitoring the output of <code>lsblk</code>
##<code>fsck /dev/[partition]</code>
##*<code>[partition]</code> is the partition that showed up in the terminal, when you inserted the SD card into your computer. (e.g. <code>fsck /dev/sda1</code> if the SD card showed up under <code>sda -> sda1</code>)
##*If you see <code>fsck: command not found</code>, run the command with <code>sudo</code> (e.g. <code>sudo fsck ...</code>)
 
You should now be given a few prompts, containing some choices. Below are some possible prompts, and what you should answer with.
*<code>There are differences between boot sector and its backup.</code>
**Choose option 2 for "<code>copy backup to original</code>".
*<code>Orphaned long file name part "[folder name]"</code>
**Choose option 2 for "<code>leave it</code>".
*<code>Free cluster summary wrong <nowiki>(####### vs. really #######)</nowiki></code>
**Choose option 1 for "<code>correct</code>".
 
Eventually, you will see the following:
 
<nowiki>
*** Filesystem was changed ***
The changes have not yet been written, you can still choose to leave the
filesystem unmodified:
1) Write changes
2) Leave filesystem unchanged</nowiki>
 
If you are happy with the options you chose, and aren't scared something will break, choose option <kbd>1</kbd> to write changes. After the changes have been written, try re-running the fourth command in Section II and continuing on from there.
 
[[Category:Nintendo 3DS guides]]

Latest revision as of 18:15, 3 October 2025

This page is a guide to rebuilding the title.db file in your SD card.

title.db is the name for two files - one on the 3DS' SD card, and one on its CTRNAND - which contain a list of all installed 3DS titles for its respective part of the filesystem (e.g. your SD card's title.db only has entries for titles installed to your SD card). For more information, check out 3dbrew.

What you need

Section I - Preparing the files

  1. Turn the 3DS off
  2. Insert your SD card into your computer
  3. Go to the Rebuild Title Database repo's page
  4. Click the Code button, then click Download ZIP
  5. Extract the contents of the downloaded .zip into a folder
    • This folder will be referred to as the "rebuild folder" from now on
  6. Copy movable.sed and boot9.bin to the rebuild folder
    • If you had just dumped them from your console, both are most likely in sd:/gm9/out
  7. Copy seeddb.bin into the rebuild folder
  8. Copy the save3ds_fuse binary from the save3ds .zip file into the rebuild folder

Section II - Rebuilding the database

Info icon If you are not on Windows, replace py -3 with python3 in all commands.
Warning icon The commands in this section are case-sensitive. Enter them exactly as written, or there may be unintended consequences.
  1. Navigate to the rebuild folder in file explorer
  2. Hold SHIFT and right-click anywhere in the folder's empty space, then click the option that opens a terminal, PowerShell, or Command Prompt
  3. In this new window, enter the following commands one at a time:
    1. py -3 -V
      • If this does not print the Python version, it is either not installed correctly, or the wrong command was used. Please read the note above.
    2. py -3 -mpip install --user -r requirements.txt
    3. py -3 fix-titledb.py -b boot9.bin -m movable.sed -s X:
      • If you are on Windows, replace X: with your SD card's drive letter. If you are not on Windows, replace X: with your SD card's mount point.
    4. py -3 rebuild-title-database.py -b boot9.bin -m movable.sed -S seeddb.bin -s X: -o out
    5. ./save3ds_fuse.exe --db sdtitle out --import --boot9 boot9.bin --movable movable.sed --sd X:
      • If you are not on Windows, remove .exe from this command
  4. If you didn't get any errors, your apps should reappear on the HOME Menu immediately
    • If they only appear in System Settings -> Data Management, follow one of these sets of steps based on how they appear.
      • Appear normally: Check the contents of sd:/Nintendo 3DS/<id0>/<id1>/title/00040000; there should only be more folders inside that folder.
        • If there is a file inside this folder, your apps are at least partially corrupted - backup your SD card to your PC, reformat it, and then try to move the backed-up files back to the SD. If this fails or the apps do not reappear afterward, check your SD card for hardware damage.
      • Appear with a grey block count indicator and an X through their icons: Run faketik.
      • Appear with white/corrupted icons, 0 block count, and/or corrupted name: Whatever destroyed your title.db has also permanently corrupted your apps. Backup your SD card to your PC,reformat it, and then check it for hardware damage.
    • If they do not appear anywhere in the system, you may want to check your SD card for hardware damage, as the apps are likely gone.

Troubleshooting

  • boot9.bin is missing from [M:] MEMORY VIRTUAL
  • The first command in Section II gave the error ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
    • Make sure you are in the rebuild folder and that you extracted the contents of rebuild-title-database-master.zip into it.
      • Once this is fixed, delete the out folder and try the command again.
  • The third or fourth command in Section II failed
    • Make sure you have boot9.bin and movable.sed in the rebuild folder.
    • Make sure your SD card is inserted and you can view and edit its contents.
  • The fifth command in Section II failed
    • If you are on macOS, try installing osxfuse, either via its GitHub page or via Homebrew.

Input/output error on fourth command in Section II

Info icon These instructions are for Linux users, and will not work on Windows.
  1. Unmount the SD card from your computer.
  2. Open up a terminal window, and enter the following commands one at a time:
    1. watch lsblk
      • After running this command, re-insert the SD card into your computer. The terminal window should now show a new partition of some kind. This is the SD card's partition. For example, sda -> sda1 may have appeared after re-inserting the SD card. Keep this in mind, as you'll need it later.
      • Once you see what partition the SD card is, press Ctrl + C to stop monitoring the output of lsblk
    2. fsck /dev/[partition]
      • [partition] is the partition that showed up in the terminal, when you inserted the SD card into your computer. (e.g. fsck /dev/sda1 if the SD card showed up under sda -> sda1)
      • If you see fsck: command not found, run the command with sudo (e.g. sudo fsck ...)

You should now be given a few prompts, containing some choices. Below are some possible prompts, and what you should answer with.

  • There are differences between boot sector and its backup.
    • Choose option 2 for "copy backup to original".
  • Orphaned long file name part "[folder name]"
    • Choose option 2 for "leave it".
  • Free cluster summary wrong (####### vs. really #######)
    • Choose option 1 for "correct".

Eventually, you will see the following:

 *** Filesystem was changed ***
 The changes have not yet been written, you can still choose to leave the
 filesystem unmodified:
 1) Write changes
 2) Leave filesystem unchanged

If you are happy with the options you chose, and aren't scared something will break, choose option 1 to write changes. After the changes have been written, try re-running the fourth command in Section II and continuing on from there.