×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

[Solved] How to recover images from non-booting (broken?) SD card?

  • Bart
  • Bart's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Professional tinkerer
  • Posts: 143
  • Thank you received: 25
Hi all,
I have had a night with good images of the rosette nebula (a nice mosaic!).
Later in the night, Kstars crashed more often than usual, so I figured: let's reboot.
Didn't work: boot. Looking at it with a monitor attached to the hdmi, I see the Stellarmate 'startup dots' but it doesn't continue from there.
My guess is that the SD card is full, but this shouldn't ever result in a problem, right?

My questions:
a) How can I recover the images? These are precious because of the very few clear nights here.
b) What could have happened? How can I prevent this from happening again?

Stellarmate 1.6.0 on Rpi 4B 8Gb.
64Gb SD card Sandisk Extreme Pro.

Thanks a lot!!
Bart
Latest Stellarmate on Rpi 4B, 294mm-pro, EFW-8, CEM70
Last edit: 8 months 3 weeks ago by Bart.
8 months 4 weeks ago #80954

Please Log in or Create an account to join the conversation.

  • Posts: 237
  • Thank you received: 49
Hi Bart,

Do you have a PC/(MAC ???) with a built in sd card slot?
You can use something like Ubuntu Live to boot from and get access to the sdcard contents or clean up the filesystem if just full.

Do you have a USB based sd card holder?
You can make another fresh PI master sdcard then plug the reader into the PI to get access to the sdcard.

Hopefully just full and not corrupted. If corrupted, prior to any fsck's maybe not too bad and can get the images off. After an fsck things could be gone.

Gene
The following user(s) said Thank You: Bart
8 months 4 weeks ago #80956

Please Log in or Create an account to join the conversation.

  • Bart
  • Bart's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Professional tinkerer
  • Posts: 143
  • Thank you received: 25
Hi Gene,

Thanks for your help!
I have a backup of this SD card, but without the images, so I can indeed use this 'broken' SD in de Rpi using a usb card reader.
But there doesn't show up a device/ volume, comparable to if I plug in a usb SSD.
I see the added device in /etc/disk/...(by id)
But can't access the data somewhere. Perhaps SM gets confused because the file system is/ folder names are identical?
In Windows, I see the disks, but aren't accessable because of different file system.

Trying with an boot-from-usb-disk Ubuntu now.

As you can guess, I'm not so familliar with Linux, so perhaps some things are obvious to you that I'm not even aware of.
Thanks!
Latest Stellarmate on Rpi 4B, 294mm-pro, EFW-8, CEM70
Last edit: 8 months 4 weeks ago by Bart.
8 months 4 weeks ago #80957

Please Log in or Create an account to join the conversation.

  • Posts: 237
  • Thank you received: 49
Hi Bart,

Depending on how your stellarmate is configured for automount, you may need to manually mount the 'drive's

With the sd card reader plugged in, do a
ls /dev/sd*

Do you see /dev/sda1 and /dev/sda2?

Do a
df

do you see /dev/sda1 and /dev/sda2 in left column and in right column should be the mount point
(e.g. /media/SOMETHING/boot and /media/SOMETHING/rootfs in right column)

cd to the mount point

On my Astroberry play system I get a popup asking to open in file manager and when I do it shows the root and bootfs contents.

To force an attempt at manual mount if they do not show up automounted

ls /dev/sd*

Do you see /dev/sda1 and /dev/sda2 ?

If yes, then
mkdir /tmp/sda1
mkdir /tmp/sda2
sudo mount /dev/sda1 /tmp/sda1
sudo mount /dev/sda2 /tmp/sda2

cd /tmp/sda1
and
cd /tmp/sda2
8 months 4 weeks ago #80958

Please Log in or Create an account to join the conversation.

  • Bart
  • Bart's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Professional tinkerer
  • Posts: 143
  • Thank you received: 25
Allright, using Ubuntu I can 'just' open the disk, no problem. Great!
How could this also 'just' work with Stellarmate?

And indeed the disk was entirely full. I've removed a few files (got permission using chmod -r 777)
And now SM boots up again, no problem, no corrupt SD.

So, how can we prevent this sort of issue from happening? Meaning:
Kstars crashes significantly more often when the disk approaches full, even with 8 GB ram. And when full, it can't boot anymore.
Maybe a warning would help already? Or just don't write more than 95% of disk?

Obvious lesson learned for me: use an external drive to store data.
Latest Stellarmate on Rpi 4B, 294mm-pro, EFW-8, CEM70
8 months 4 weeks ago #80959

Please Log in or Create an account to join the conversation.

  • Posts: 237
  • Thank you received: 49
Hi Bart,

Good news!!!

For your PI question, see my previous response.

Now for full disk's, welcome to linux not booting :-(

To be honest, no matter how large a file system, you will fill it up sooner or later :-(

And for SD card issues, I gave up on SD card's a -long, long- time ago and now use a USB3 to Sata SSD adapter.
It enlarges the footprint of the PI but old time hard corruption of the sd card are gone.
An adapter is $11 (I have 4 of them, using since 2016) coupled with cheap 120 and 240gb SSD's.

The adapter I use is USB3S2SAT3CB, FWIW

The only main issue with SSD's is garbage collection, i.e. 'trim' support. To alleviate the somewhat, only use 30% or 40% of the SSD space (back to the 'space' issue again :-)

If this is true Stellarmate, maybe open an issue to add the capabilities for system monitor, if does not exist already.
The following user(s) said Thank You: Bart
8 months 4 weeks ago #80961

Please Log in or Create an account to join the conversation.

  • Bart
  • Bart's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Professional tinkerer
  • Posts: 143
  • Thank you received: 25
Thanks Gene :)

I have a 2 Tb sandisk I could use, very fast, but lack free USB ports on the Pi. And don't want to further clutter the back of the scope, that's why I still used the internal storage. Something to change now. :)

Thank you for the prompt response and help! It's appreceated.
I'll see if I can post the mosaic here soon, or post a link.

Cheers!
Bart
Latest Stellarmate on Rpi 4B, 294mm-pro, EFW-8, CEM70
8 months 4 weeks ago #80962

Please Log in or Create an account to join the conversation.

Time to create page: 0.457 seconds