Table of Contents

THIS WIKI HAS MOVED!

ACTUAL LOCATION:

2025/01/21 11:53 · torte

https://torte71.github.io/InsideSovolKlipperScreen/gcode_storage.html

.








2025/01/21 11:53 · torte

Sovol KlipperScreen (Makerbase MKS KLIPAD50)

Expand G-Code storage space

Experienced Linux users: Scroll down to For the linux gurus for a short sum-up what is required.


Sovol's KlipperScreen uses an 8GB emmc card for storage, of which about 7GB are used by the system.

If the empty space gets completely used up by gcode files, it will lead to problems, e.g. the PowerLossResume can cause a boot loop, because it cannot update its state file (saved_variables.cfg).

This can be prevented by using a usb-drive to store the gcode files to.

There is an automount script, which automatically detects inserted usb-drives and mounts them to ~/printer_data/gcodes/USB, but it does not automatically store the gcode files there.

Sadly, it is not an easy task getting the system to just use this “USB” subdirectory, it would require changing several config files (printer.cfg, mainsail.cfg, fluidd.cfg and the moonraker sources).

But it is possible to mount the usb-drive directly to ~/printer_data/gcodes. This way the gcode files will be written to the usb-drive, but to Klipper it looks like the usual directory. So none of Klipper's config files have to be changed, no matter if the drive is inserted or not.

Requirements

Beware: If all that sounds very gibberish to you and you are a complete linux novice, then it might be better to just leave the system as-is and just clean up the old gcode files manually.

If you mistakenly format or partition the wrong drive, you can brick your device in a way, that you have to reflash the whole emmc card!

You have been warned!

Instructions

NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda            8:0    1   7.5G  0 disk
└─sda1         8:1    1   7.5G  0 part /home/mks/printer_data/gcodes/USB_1
                                       /home/mks/printer_data/gcodes/USB
mmcblk1      179:0    0   7.3G  0 disk
├─mmcblk1p1  179:1    0   256M  0 part /boot
└─mmcblk1p2  179:2    0   6.9G  0 part /var/log.hdd
                                       /
mmcblk1boot0 179:32   0     4M  1 disk
mmcblk1boot1 179:64   0     4M  1 disk
zram0        251:0    0 455.5M  0 disk [SWAP]
zram1        251:1    0    50M  0 disk /var/log
zram2        251:2    0     0B  0 disk

mke2fs 1.47.0 (5-Feb-2023)
/dev/sda1 contains a vfat file system labelled 'VOLUME'
Proceed anyway? (y,N) y
Creating filesystem with 1958144 4k blocks and 489600 inodes
Filesystem UUID: b6164916-9a97-42d6-b270-172020e45486
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
lrwxrwxrwx 1 root root 15 Oct 18 10:54 AADC-9503 -> ../../mmcblk1p1
lrwxrwxrwx 1 root root 15 Oct 18 10:54 b45e999f-5a77-4788-8645-076f13ec1a4e -> ../../mmcblk1p2
lrwxrwxrwx 1 root root 10 Oct 18 11:04 b6164916-9a97-42d6-b270-172020e45486 -> ../../sda1
UUID=b6164916-9a97-42d6-b270-172020e45486 /home/mks/printer_data/gcodes ext4 defaults,nofail,x-systemd.device-timeout=9 0 0

Now let's check, if everything works as expected:
Reboot the device.

In Mainsail, the “G-CODE FILES” tab should show an empty list and a lot of free space (about 6.9GB for a 8GB card as in this example). Remember to use the “refresh current Directory” button. Do a small test print. There shouldn't be any error messages and the new gcode file should show up.

Shut down the device, remove the usb-drive and power up the device again: It should boot without problems. In Mainsail, the list of gcode files should now show the files, that have been there before all these steps. Remember to use the “refresh current Directory” button.

If everything is OK, power off the device, insert the usb-drive again and power it up. We are done.

Things to keep in mind

For the linux gurus

A last tip

When there is no usb-drive inserted, create a directory called “_NO_USB_MOUNTED_” (or whatever name you like) in the gcode directory. If the usb-drive is not inserted or broken, this directory will be visible and you know, that gcode files will not end up on the usb-drive, but on the internal file system.