Repair an octopi install

Hi everyone.

My Octopi install (Pi3 B+) worked really well, until this morning, don't know why, I cant access it, web, ssh, ping, nothing work.

I tried to connect it on ethernet, same problem.

I can access and copyt my files, if I connect my sd card to my pc, But I cant find where my gcodes (not really important), plugins, and setup files (more important, to me)

So, Is there a way to fix my install, without erasing my previous setup and plugin?

Or a way to find a list of the plugin I installed, so I could install again to fresh install?

Thanks

Copy the whole /home/pi/.octoprint folder. This will contain your octoprint configuration, uploaded gcode files, timelapses, plugin settings, though not the plugins themselves. It is better to download them again once you are back up and running.

1 Like

HI, thanks for your fast answer.

When I plug my sd card to my pc, I only have access to the "boot" partition, is there a way to read the other one, windows can't natively, and suggest me to format.

thanks

Google search is your friend...

https://www.howtogeek.com/112888/3-ways-to-access-your-linux-partitions-from-windows/
https://helpdeskgeek.com/how-to/how-to-access-linux-partitions-in-windows/
https://www.howtoforge.com/access-linux-partitions-from-windows

sadly, none of this solution works, the partition is detect as linux, but in RAW format...

You could try setting up an OctoPi installation on a new sd card, and use an USB cardreader to mount the old sd card to read the files you need from it.

ok, I could do that.
I will.
but how can I access this sd card, with ssh?

I had problems with Ext2Fsd but Linux Reader worked flawlessly.

You access the RPi with PuTTY (SSH), login as the user pi.
You then plug your USB SD card reader into your RPi and mount the file system. On my system, the USB SD card reader is /dev/sda with two partitions, /dev/sda1 (/boot) and /dev/sda2 (/) so I type:

sudo mkdir /mnt/sda2
sudo mount /dev/sda2 /mnt/sda2

and the filesystem is available (ls /mnt/sda2).

thanks for helping me.

Ihave this error after pi@octopi:~ $ sudo mount /dev/sda2 /mnt/sda2

mount: /mnt/sda2: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.

seems I have a really corrupted partition or sd card

What does sudo fdisk -l /dev/sda show?

Blockquote

sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help):

Blockquote

sorry I dont know how to use linux command

My bad, I forgot the -l (lowercase L) on the command line.

Just about every linux command has a -h or --help switch. There is also man fdisk (man man for help on that command :wink:)

pi@octopi:~ $ sudo fdisk -l /dev/sda
Disk /dev/sda: 14.9 GiB, 15980298240 bytes, 31211520 sectors
Disk model: Storage Device
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6c586e13

Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/sda2 532480 31211519 30679040 14.6G 83 Linux
pi@octopi:~ $ cd /dev/sda2
-bash: cd: /dev/sda2: Not a directory

I can also acces file structure on the left of mobaxterm, but folders seems empty

I am "downloading" the entire sd card with mobaxterm, hope it will work

The output of fdisk looks normal. There's one more thing we can try...

sudo fsck /dev/sda2

Without a "suspect corruption" SD card, I don't know what the output should look like. If it's too big, pipe it to a file and post that (sudo fsck /dev/sda2 >fsck.log).

Another useful command for saving the output of linux commands is screen -L. This will create a log file (screenlog.0) in the current directory that contains the input and output of multiple commands until you type exit.

pi@octopi:~ $ sudo fsck /dev/sda2
[sudo] password for pi:
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
rootfs: recovering journal
fsck.ext4: unable to set superblock flags on rootfs

rootfs: ********** WARNING: Filesystem still has errors **********

pi@octopi:~ $ sudo fsck /dev/sda2 >fsck.log
e2fsck 1.44.5 (15-Dec-2018)
e2fsck: need terminal for interactive repairs

when typing screen -L
the command line window is erased and restar t!!!?!?!