Need help - Recovery tools (urgent!)

Hello! My IPFire APU SSD just went corrupt and my local network is down.

The APU will not boot so I cannot get to the WebGUI or to the terminal.

I do not have a replacement drive. And I do not have an adapter for the SSD to plug into USB…

Is there a Live USB recovery tool that someone could recommend to repair the SSD with fsck?

What about SystemRescue at https://www.system-rescue.org/ ?

It’s well maintained and has good doco.

1 Like

Thank you! I looked at that one and it did not have fsck. And none of the other repair utilities looked familiar.

:thinking: Maybe this toolkit will be helpful

2 Likes

Although not shown in doco fsck can still be run from a terminal session.

1 Like

Either Clonezilla clonezilla or gpartedlive gparted will have fsck.

I doubt that your whole SSD is corrupt. IPFire uses FAT filesystem, for /boot and (if applicable) /efi and that filesyste is not at all robust to unclean shutdown or power loss. It is only /dev/sda2 (/boot ? ) that is reported as “dirty”.

Does the IPFIre complete the boot sucessfully ? If so then simply unmount & fsck the /dev/sda2. If not, then use the rescue system to do the fsck.

3 Likes

Thanks all - I will take a look!

Never used it.

One point very important part I forgot. The APU (APU4D4) does not have a graphics card. So everything done is via the Terminal or Serial Console.

1 Like

SystemRescue packaged utilities can be run in a terminal session.

2 Likes

This page of SystemRescue doco confirms availability of fsck:

https://www.system-rescue.org/disk-partitioning/Standard-partitioning-tools/

2 Likes

SystemRescue to allows me to copy a few things. And for some odd reason fsck is not repairing my /dev/sda. So I need to look into the other repair utilities and learn one!

Thank you for getting me started!

1 Like

I have a question for you:
But did you have software damage or do you have major damage to the SSD?
In the case of software damage maybe you can fix it.
But if you have major physical damage to the SSD, I see it difficult (perhaps impossible) to remedy without replacing the disk. Obligatorily (if you can still access the disk and don’t have a previous backup), you should copy the var/ipfire folder (which contains the configuration) to a new disk, after reinstalling IPFire.

If you can log into the IPFire console, you can try typing the command shutdown -rF now

Taking a break - There is a Chicago Cubs (baseball) game and the family is watching via the internet. And I cannot try things. So I am on hold for a few.

@casabenedetti - not sure how much damage (yet).

I’ve order new drive but they will not arrive until Monday.

I’ve got recent backups, so /var/ipfire is covered.

@tphz - I cannot access the console. I think the boot drive is corrupt so the IPFire device does not finish booting.

@rjschilt and SystemRescue got me going in a good direction. And I was able to recover ( :crossed_fingers: ) the files that didn’t get a backup yesterday.

Thank you all for your help and suggestions!

I’ll start working on a Headless Recovery wiki next week!
(the “headless” part is referring to me!)

3 Likes

If you have a backup, OK :+1: :+1: :+1: :+1:. But the first step is to figure out if it’s software problems (like damaged partitions, damaged files…) or hardware problem (SSD disk). And I know that’s not always easy. But it seems very strange to me that IPFire damaged itself. I am increasingly suspicious that it is hardware damage.

A similar problem happened to me once. I had installed IPFire in a machine with an SD card as a disk. The card had broken. No machine was able to read it or format it. By replacing the SD card and reinstalling IPFire, everything worked again!

I have now switched to today’s mini PC :wink:.

Perhaps the first step would be good linux software that scans the disk surface for physical errors. But I don’t know if there is something live. I rely on other users for that.

For hardware, I am a little more prepared. I will follow this topic. I hope you will solve it soon.

I found a “crude” solution, but maybe it can put you on the right track.
Try using the Linux “dd” command. Download a live linux version that runs from the serial console. Create an image of the SSD drive in a file on a USB stick. If the operation succeeds, the SSD should be intact (At least in reading). If it fails, then certainly my guess may be valid. The USB flash drive must be equal to or larger than the SSD. What do you think?

Beware of using DD. It is very powerful. It can erase a whole disk like nothing.
DD has the same function as a disk cloning machine.
Plus it can create an .img file instead of classic cloning.
Linux has DD of its own. So there is no need to install anything.

I see that it is also built into IPFire.
I ran from putty dd --help from the IPFire shell.
And it gives me all the help.

1 Like

@(not an expert!)

If you want to run a (non-destructive) test of the SSD, in-situ, then “smartctl -t /dev/sdx” would be the most informative. It is in Clonezilla, which is CLI, but not suited to serial-console and does not automatically start network - so terminal access would not work.

IPFire does contain “smartctl”. You could try booting your install media for APU4D4 then bailing out of the install process.

Unfortunately there is not much you can do here. Typically, in the event of a disk failure, the standard approach is to utilize ddrescue, a disk cloning tool crafted to reduce the stress on the failing disk during the sector-by-sector copy process. This tool perseveres even when encountering unreadable sectors, enhancing the chances of retrieving your data. Once the copy is done, you work on the cloned system.

In your specific circumstance, I would focus on salvaging the contents of the root partition. You might attempt to run fsck on that isolated partition, followed by integrating it into a fresh installation. Assuming the root file system remains intact and viable, this strategy should restore your previous system to its state at the time of failure.

To break it down, a fresh IPFire installation will supply /boot, /boot/efi, and swap. You would then reintroduce the old / root file system, essentially reincarnating your previous IPFire setup, thereby reconstructing a working version of your former system. If necessary, I am available to provide a detailed tutorial to assist you in this process.

It is part of systemrescue used by @jon (either in the cd itself or available using pacman), which allows a serial terminal connection. This is by far one of the best tools available for data recovery. Not easy to use, but ideal for any specific need, as it is extremely flexible to accommodate any use case.