Sd card corrupted

#1

somehow, even thou i powered down the pi with sudo halt, the sd card got corrupted

if i can do an rescue of some sort are there a folder where i can see what plugins i had installed?

i'm not worried about lost data as the only really important was filament manager data and data takes 30 mins to put the spools on a scale and reenter

#2

I assume it's the sudo halt. Ongoing write procedures may be halted at once too. That can corrupt your SD card.
Better use is sudo shutdown -h that waits ongoing write jobs are finished.

#3

and what folder can give me a clue on what plugins i had installed?

of course that assumes i can get at least read access to the sd card

#4

anyway.... i have a rescue util trying to read the sd card

19% read after 1 hour and 42 mins so a long way to go :smiley:

#5

You may can find infos in the logs:

pi/.octoprint/logs

#6

Here you can find informations on the difference of halt, shuddown etc:
https://www.tecmint.com/shutdown-poweroff-halt-and-reboot-commands-in-linux/

#7
cat ~/.octoprint/logs/octoprint.log |grep "|" | grep "= /home/pi/" | grep -v bundled | sort | uniq | sed 's|\|||g'

Yields, for example:

  Bed Visualizer (0.1.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_bedlevelvisualizer
  EEPROM Marlin Editor Plugin (1.2.1) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_eeprom_marlin
  GCODE System Commands (0.1.1) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_gcodesystemcommands
  Navbar Temperature Plugin (0.9) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_navbartemp
  Themeify (1.2.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_themeify
1 Like
#8

@OutsourcedGuru

just what i needed, but i think it will take a day at least for the rescue software to get through the entire drive

its not even at 20% yet :frowning:

#9

It might be worth backing up your OctoPrint from time to time. I created a script for this.

#10

i think i will go with the script

i just tried to do: sudo find / -name octoprint.log and it did not find it

so either the card is 100% screwed or i did the search wrong

it is an octopi image and the octoprint dir is spelled OctoPrint

will try and look for the log but mjeeeh, i think its gone

#11

found the log.... there are 7 but the 6 of them are with a date appended to them

#12

As you noticed, there are two mount points boot and rootfs, the second would be the one with all the good stuff on it.

Under ~/.octoprint is the bulk of what you'd want to backup. Run my command from earlier that begins with cat (the conCATenate command is good for showing the contents of a text file). That command I gave you will simply report the plugins you added to the installation (from the octoprint.log file).

#14

The file named just octoprint.log is the latest. Anything with a date decorating the end of that is progressively older, in archive terms, depending upon the date you see in the filename.

1 Like
#15

shutdown -p now (-p = power) remember you can use either [ shutdown --help, or man shutdown, or any other command you have a question about]

#16

Halt is in my opinion, using .NIX OS's for almost 30 years. Halt is "hokey" it stops the services, but not the underlying kernel. And SD cards are not the best "hard drives" Yes buy the "uber" version, but they all get hosed. SanDisk has a WinTel tool, that kind of works. Personally I use GParted. It is a multi platform tool. Yes, you hose the drive, put a new partition on it, format it the way you need it. In our case fat32. But 128gb sd cards use a different format type so windows can find it. ext32 I believe. Gparted doesn't have that format type. I can refresh a 128, using fat32 with relative success. Your results may vary!

#17

I think I'd go with: "Use Etcher to flash the microSD with the IMG file of your choice whether that be the OctoPi image or the Raspbian Stretch Lite image".

The act of formatting a microSD leads to more problems than you can imagine (when there are actually two partitions of different types on a standard Raspbian hard drive).

#18

OG,
Ground Gparted on it a few times... finally it mounted & fixed.

TY VM
JLH

1 Like