|
| 1 | +# :material-micro-sd: Dual SD Card Migration |
| 2 | + |
| 3 | +KNULLI runs fine as a single SD card CFW. However, some KNULLI-supported devices have more than one SD card slot which gives you the opportunity to run KNULLI in a dual-SD-card setup. |
| 4 | + |
| 5 | +## Advantages |
| 6 | + |
| 7 | +It is not technically required to run KNULLI in a dual-SD-card setup. However, using two dedicated SD cards for your KNULLI device brings a couple of advantages: |
| 8 | + |
| 9 | +* **Updating** KNULLI is **significantly** easier if all your games, saves, configurations, etc., are stored on a dedicated SD card. You can always simply shut down your KNULLI device, remove your primary SD (which has **only** the OS) and **simply re-flash** it with the newest version without a single worry about your user data. (Technically, for most KNULLI updates it is possible to just do a manual update as explained in the [Update section](../../play/update). However, **some updates require to re-flash**, which will be less of a hassle if you run with a dual-SD setup. |
| 10 | +* **Switching devices** is easier. Since some KNULLI-driven device are somewhat different, it might be **required** to **remove your `system` folder** and reboot to re-configure KNULLI from scratch if you migrate to a different device. However, all your games, BIOSes, screenshots, themes, saves, decorations, etc. can still be easily transferred to a new device if you simply plug your old SD 2 into your new device. |
| 11 | +* **Backing up your user data** can also be significantly easier if you can simply duplicate the entire SD card, e.g. by drawing an image from your original SD 2 and flashing it onto a new SD card. |
| 12 | + |
| 13 | +## How to migrate |
| 14 | + |
| 15 | +Before you start to migrate, make sure that you have the following tools at hand: |
| 16 | + |
| 17 | +* your KNULLI-driven gaming device |
| 18 | +* means to charge your KNULLI-driven device |
| 19 | +* a primary KNULLI SD card |
| 20 | +* a second SD card ready to be formatted |
| 21 | +* a computer |
| 22 | +* a working [SSH connection](../../configure/ssh) to your KNULLI device |
| 23 | + |
| 24 | +### Format the second SD card |
| 25 | + |
| 26 | +* Shut down your KNULLI device. |
| 27 | +* Add the new SD card that you want to use for your user data into the secondary SD card slot (TF2/Ext.) of your KNULLI device. |
| 28 | +* Turn on your KNULLI device. |
| 29 | +* Press the ++"Start"++ button to bring up the main menu. |
| 30 | +* Go to *System Settings* and find *Frontend Developer Options*. |
| 31 | +* In *Frontend Developer Options*, find *Format A Disk* in the *Tools* section. |
| 32 | +* In the *Format A Disk* menu, |
| 33 | + * make sure to pick your secondary SD card as *Device To Format*. (You should be able to recognize it by its size. **Make sure to not format the "internal" device!**) |
| 34 | + * make sure to pick the file system *ext4*. (Technically, it is also possible to format to *exfat*, but we do strongly advise against that, because *exfat* has only **very limited** PortMaster compatibility as explained [here](../../play/add-games).) |
| 35 | + * select *Format Now* **after** making the settings above. |
| 36 | +* Keep an eye on the upper-right corner of the screen where the formatter will inform you about it's state. |
| 37 | +* Reboot your device when the formatter appears to be done: Press ++"Start"++ to bring up the main menu, head to *Quit*, then pick *Restart System*. |
| 38 | + |
| 39 | +### Back up your user data |
| 40 | + |
| 41 | +* Press the ++"Start"++ button to bring up the main menu. |
| 42 | +* Go to *System Settings* and find *Backup User Data* in the *Storage* section. |
| 43 | +* In the *Backup User Data* menu, set *Target Device* to your secondary SD card (usually, you only have **one single option** here, which corresponds to your secondary SD card). |
| 44 | +* Select the *Start* button at the bottom of the screen after setting up your *Target Device*. |
| 45 | +* KNULLI will back up your userdata to the second SD card now, **which might take a while**. Depending on the size of your user data folder, it might be required to **plug the charger cable** to make sure that the device will not run out of battery while copying your data. |
| 46 | +* When copying is done, you will see a window with the word *Finished* and an *OK* button. |
| 47 | +* Hit the *OK* button. |
| 48 | + |
| 49 | +### Move your user data within your secondary SD card |
| 50 | + |
| 51 | +At this point, all your data has already been copied to the second SD card. However, the backup tool creates a folder `batocera` on your SD 2 and stores all your userdata **inside** that folder. Unfortunately, KNULLI expects all this data **outside** of the `batocera` folder, so we have to move all the files now within your SD 2. |
| 52 | + |
| 53 | +This section might look a little bit scary to Linux beginners, because we run a lot of text based commands in this section. However, **don't be scared**, as this guide will lead you through the process. |
| 54 | + |
| 55 | +!!! info "Some basic Linux commands" |
| 56 | + In this section, we will use three text-based Linux commands to navigate your data storage and move files around. |
| 57 | + |
| 58 | + * `cd` - means *change directory*, a command to enter or exit directories (also known as folders) |
| 59 | + |
| 60 | + * `ls` - means *list*, a command to list the contents of a directory |
| 61 | + |
| 62 | + * `mv` - means *move*, a command to move files and directories |
| 63 | + |
| 64 | +* Establish your [SSH connection](../../configure/ssh). |
| 65 | +* On the SSH prompt, type |
| 66 | + ``` |
| 67 | + cd /media |
| 68 | + ``` |
| 69 | + and press ++"Enter"++ to navigate into the `media` folder of your KNULLI file system. |
| 70 | +* Notice that your prompt has changed to |
| 71 | + ``` |
| 72 | + [root@KNULLI /media]# |
| 73 | + ``` |
| 74 | + where `/media` indicates which folder you are currently inside of! |
| 75 | +* Inside the `/media` folder, type |
| 76 | + ``` |
| 77 | + ls -lHa |
| 78 | + ``` |
| 79 | + and press ++"Enter"++ to list the contents of the `/media` folder. |
| 80 | +* You should see that your `/media` folder contains 3 subfolders: `BATOCERA`, `SHARE`, and `SHARE_1`. The output of the `ls -lHa` command should look something like this: |
| 81 | + ``` |
| 82 | + drwxrwxrwt 5 root root 100 Oct 29 22:51 . |
| 83 | + drwxr-xr-x 1 root root 160 Oct 29 22:51 .. |
| 84 | + drwxr-xr-x 5 root root 4096 Jan 1 1970 BATOCERA |
| 85 | + drwxr-xr-x 4 root root 4096 Oct 29 22:53 SHARE |
| 86 | + drwxr-xr-x 16 root root 4096 Oct 29 22:05 SHARE_1 |
| 87 | + ``` |
| 88 | +* One of the two `SHARE` folders corresponds to your SD 1, the other one corresponds to SD 2. Unfortunately, you cannot be sure which is which, so you have to explore both folders to learn, which is which: |
| 89 | +* Type |
| 90 | + ``` |
| 91 | + ls -lHa SHARE |
| 92 | + ``` |
| 93 | + and press ++"Enter"++ to see the contents of the `SHARE` folder, then type |
| 94 | + ``` |
| 95 | + ls -lHa SHARE_1 |
| 96 | + ``` |
| 97 | + and press ++"Enter"++ to see the contents of the `SHARE_1` folder. |
| 98 | +* Only **one of them** will give you a very simple list of only 2 folders (`batocera` and `lost+found`) like this: |
| 99 | + ``` |
| 100 | + drwxr-xr-x 4 root root 4096 Oct 29 22:53 . |
| 101 | + drwxrwxrwt 5 root root 100 Oct 29 22:51 .. |
| 102 | + drwxr-xr-x 16 root root 4096 Oct 29 22:05 batocera |
| 103 | + drwx------ 2 root root 16384 Oct 29 22:50 lost+found |
| 104 | + ``` |
| 105 | + **This is the folder you want, this is your SD 2 folder!** |
| 106 | +* Enter your SD 2 folder by typing `cd <name-of-your-sd-2-folder>`, so either |
| 107 | + * `cd SHARE` (if your SD 2 folder is `SHARE`) **or** |
| 108 | + * `cd SHARE_1` (if your SD 2 folder is `SHARE_1`) |
| 109 | + and press ++"Enter"++ to confirm. |
| 110 | +* Now, inside `/media/SHARE` (or `/media/SHARE_1`) move all the files from inside the `batocera` folder to the top level of the SD card by typing: |
| 111 | + ``` |
| 112 | + mv batocera/{.,}* . |
| 113 | + ``` |
| 114 | + (**Mind the spaces in this command, be very precise!**) |
| 115 | +* You might see a response like: |
| 116 | + ``` |
| 117 | + mv: cannot stat 'batocera/.*': No such file or directory |
| 118 | + ``` |
| 119 | + In this case: **Do not be alarmed!** |
| 120 | +* Type |
| 121 | + ``` |
| 122 | + ls -lHa |
| 123 | + ``` |
| 124 | + and confirm with ++"Enter"++ to see the contents of your SD 2 folder. The output should look something like |
| 125 | + ``` |
| 126 | + drwxr-xr-x 17 root root 4096 Oct 29 23:34 . |
| 127 | + drwxrwxrwt 5 root root 100 Oct 29 23:30 .. |
| 128 | + drwxr-xr-x 2 root root 4096 Oct 29 23:34 batocera |
| 129 | + drwxr-xr-x 11 root root 4096 Jul 21 04:27 bios |
| 130 | + drwxr-xr-x 2 root root 4096 Oct 29 22:05 cheats |
| 131 | + drwxr-xr-x 2 root root 4096 Oct 29 22:05 decorations |
| 132 | + drwxr-xr-x 2 root root 4096 Apr 12 2024 extractions |
| 133 | + drwxr-xr-x 5 root root 4096 Apr 12 2024 kodi |
| 134 | + drwxr-xr-x 2 root root 4096 Apr 12 2024 library |
| 135 | + drwx------ 2 root root 4096 Jul 21 04:29 lost+found |
| 136 | + drwxr-xr-x 2 root root 4096 Oct 29 22:38 music |
| 137 | + drwxr-xr-x 172 root root 4096 Oct 29 22:05 roms |
| 138 | + drwxr-xr-x 2 root root 4096 Apr 12 2024 saves |
| 139 | + drwxr-xr-x 2 root root 4096 Apr 12 2024 screenshots |
| 140 | + drwxr-xr-x 2 root root 4096 Apr 12 2024 splash |
| 141 | + drwxr-xr-x 13 root root 4096 Oct 29 23:30 system |
| 142 | + drwxr-xr-x 2 root root 4096 Oct 29 22:05 themes |
| 143 | + ``` |
| 144 | +* **Congratulations!** You have successfully moved all your userdata to the top level of your secondary SD card! Take a moment to be proud of yourself! |
| 145 | +* To make sure that there are no leftovers, type |
| 146 | + ``` |
| 147 | + ls -lHa batocera |
| 148 | + ``` |
| 149 | + and press ++"Enter"++ to list the contents of the `batocera` folder. It should be empty, so it should give you a response like |
| 150 | + ``` |
| 151 | + drwxr-xr-x 2 root root 4096 Oct 29 23:34 . |
| 152 | + drwxr-xr-x 17 root root 4096 Oct 29 23:34 .. |
| 153 | + ``` |
| 154 | +* Close the SSH connection - the hard part is already done! |
| 155 | + |
| 156 | +### Switch KNULLI to external storage |
| 157 | + |
| 158 | +Now, let's get back to your KNULLI device. |
| 159 | + |
| 160 | +* Press the ++"Start"++ button to bring up the main menu. |
| 161 | +* Go to *System Settings* and find *Storage Device* in the *Storage* section. |
| 162 | +* Switch *Storage Device* from *Internal* to *Any External* or to the **specific** external device you want to use. As before, it is most likely indicated by its size. |
| 163 | +* Reboot your KNULLI device to apply the storage change: Press ++"Start"++ to bring up the main menu, head to *Quit*, then pick *Restart System*. |
| 164 | + |
0 commit comments