https://torte71.github.io/InsideSovolKlipperScreen/gcode_storage.html
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.
~/printer_data/gcodes
, so we will have to unmount it before each step.sudo su
lsblk
.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
sda
with the partition sda1
(this is the default, if it is the only usb-drive inserted)./home/mks/printer_data/gcodes/USB_1
and/home/mks/printer_data/gcodes/USB
sda
as your usb-drive.sdb
, then change it in the next steps.umount /home/mks/printer_data/gcodes/USB
umount /home/mks/printer_data/gcodes/USB_1
lsblk
again.cfdisk /dev/sda
, it should give a screen like this:83 Linux
(by pressing ENTER).umount /home/mks/printer_data/gcodes/USB
umount /home/mks/printer_data/gcodes/USB_1
lsblk
mkfs.ext4 /dev/sda1
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
umount /home/mks/printer_data/gcodes/USB
umount /home/mks/printer_data/gcodes/USB_1
lsblk
ls -l /dev/disk/by-uuid/
.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
b6164916-9a97-42d6-b270-172020e45486
(points to “sda1”)./etc/fstab
and add the definition for our drive:nano /etc/fstab
UUID=b6164916-9a97-42d6-b270-172020e45486 /home/mks/printer_data/gcodes ext4 defaults,nofail,x-systemd.device-timeout=9 0 0
mount /home/mks/printer_data/gcodes
chown -R mks:mks /home/mks/printer_data/gcodes
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.
/etc/fstab
file)sudo mount /home/mks/printer_data/gcodes
) - or just reboot the device with the usb-drive plugged in./etc/fstab
use the parameters nofail,x-systemd.device-timeout=9
to allow booting if that drive is not inserted/etc/fstab
, this makes the automounter ignore this drivechown -R mks:mks <YOUR_MOUNTPOINT>
).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.