Yeah, I think that is actually what I did (using strings to filter out the obvious garbage). I couldn't quite remember which command I ended up using.Heater wrote:Oh yeah, trawling though disk blocks trying to find lost data. Fun, fun fun...
Don't forget the "strings" command. Helps to get the textual data out of a lot of binary gunk. For example:
Code: Select all
$ strings /dev/sdb | less
Decades ago, a PHD student came to me with a problem, his thesis which he had spent 3 years working on, was on a computer - and the hard disk failed! No backups, nothing.
Definitely. Consider the problems if a fire destroyed the building and so on.
The "digital camera" advice - or, really, any method of formatting the SD card back to "normal" (aka, "Factory Default") - is generally given in the context of NOOBS (i.e., PINN), where it is important to format the card properly before putting the software (NOOBS/PINN) on it.Also note that if your card is working properly, it's only you file system(s) that are scrambled, then it is not necessary to format it before writing a new Raspbian or other image to it. That operation does not care about whatever format is on there beforehand.
Code: Select all
cd \Program Files\Oracle\VirtualBox\ VBoxManage internalcommands createrawvmdk -filename "C:\Users\<username>\VirtualBox VMs\<Machine Folder>\raspi1.vmdk" -rawdisk \\.\PhysicalDrive1
You've discovered while upgrading a kernel that Raspberry Pi OS moves everything out of boot and copies what it needs back at the end. This is an obviously fragile technique that results in a non-bootable system if power is interrupted during the upgrade. I think you should be able to copy the old boot directory back in place and then proceeded with the upgrade. I would back up any important data on the SD card at this time if you haven't already done so.LDighera wrote: ↑Sat Oct 31, 2020 1:07 amWhile updating/upgrading Raspberian, power was interrupted resulting in the following when attempting to reboot:
Ubuntu mounted the SD card, and I found the root of sda1 with lots of kernel images, etc. The boot directory was empty.
I ran fack on the SD card partitions. sda1 fscked without issue. sda2 indicated a good deal of corruption in the rfs.
I presume copying the contents of the boot directory from the raw image may be a logical first step?
Any clues on how to proceed in restoring the card is appreciated.
Great advise Heater. Git is a must for programmers.Heater wrote: ↑Tue Dec 01, 2015 5:39 am....
If you have 4 months of coding in any language you might like to think about keeping it in a version control system like github or bitbucket or even just use git on your local machines.
git is not a backup solution by itself but it makes it dead easy to "clone" your code to multiple machines and keep track of all your revisions. It gives me great peace of mind know that it''s almost impossible for me to lose even one line of code even if I delete it from file myself!
Having all my revisions neatly numbered and commented means I can easily go back and see what I was doing and where I might have broken a feature.
Many things I guess.
The reason backups are offline is to avoid problems with user error and malware that might delete everything that is online. While it's possible that GitHub may delete your code from their end to satisfy a third party beyond your control and it's also possible to delete things oneself out of confusion, another danger is some malware gets your git keys and deletes the entire repository using your own access before you notice what's going on.Heater wrote: ↑Sat Oct 31, 2020 10:10 amThey all get sync'ed up to the latest versions as and when required. They all contain a complete history of what has happened.
"backups" are such an old fashioned idea. From the time we only had one computer, a mainframe say, and needed to save whatever it had to tapes and such incase of failure. The world is not like that anymore. Our actual live, in progress, data can be distributed all around, if any instance of it gets destroyed it is not a problem. No old fashioned backups required.
That is a very good point.
No I did not. Sounds like a very good idea. Thanks for the heads up on that.ejolson wrote: ↑Sat Oct 31, 2020 2:02 pmThird factor authentication can help, but I think it is it is also possible to set up GitHub so the credentials you use to update your own repository don't have the authority to delete it. Did you do that? Then only the credentials with delete authority need to be offline.
Thank you very much for the clue.ejolson wrote: ↑Sat Oct 31, 2020 2:37 amYou've discovered while upgrading a kernel that Raspberry Pi OS moves everything out of boot and copies what it needs back at the end. This is an obviously fragile technique that results in a non-bootable system if power is interrupted during the upgrade. I think you should be able to copy the old boot directory back in place and then proceeded with the upgrade. I would back up any important data on the SD card at this time if you haven't already done so.