Alright, long story short, I've been running a copy of Raspbian Lite for a while on a RPi 4, off a MicroSD card. I'm using it along with a couple of USB3 drives as a makeshift NAS, where I store my media for my Plex Media Server. It's been running really well for a while, until today.
This evening, I realized it won't boot anymore, and the message I was getting was the ol' "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)". I've looked it up, been trying to find a way to fix it, but no luck so far. The last thing I've tried is from this thread: Kernel panic-not syncing: VFS: unable to mount root fs on unknown- block(179,6) running Raspbian on top of NOOBS
But I keep bumping into write-protect issues.
I'm not sure at this point if it's fixable, and being the dumb noob I am, I did not have a backup of my SD card...
One thing I picked up on during my research is the ability to boot the RPi from a USB drive. I had an old 120GB SSD collecting dust somewhere, with an enclosure, which should be a lot more stable than a MicroSD card. Using another guide and a fresh install from a different MicroSD than my bad one, I installed Raspbian Lite on the USB SSD, and now it's booting perfectly from it.
With that in mind, I'm now a lot less interested in fixing the old SD card back into functioning if this setup is viable.
Where I'm stuck is: is there way to copy my entire setup, users, programs, mounts, etc... from my "bad" MicroSD, onto my new fresh install on my SSD, effectively making it effectively an exact clone of my old setup, avoiding me from having to set up everything all over again?
I see a lot of guides on how to clone an existing, correctly running install onto a different card or USB drive, but I can't seem to find a guide on how to clone one's setup from a bad, but mountable, readable SD card... I've confirmed that I'm able to mount both partitions in read-only mode, so I have access to all the data.
I have backed up both partitions to separate directories on my SSD install using rsync.
I'm assuming it wouldn't easily be done by just copying all the data onto the corresponding directories on my new install, but hey... wouldn't be nice if it was that easy...
Any thoughts? Thanks in advance
sudo umount /dev/sda1; sudo umount /dev/sda2
ignore any errors. Then runsudo fsck -f -y /dev/sda1;sudo fsck -f -y /dev/sda2
. Power off, swap back to the original SDCard and keep calm and carry on.0X41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt
, but it can't run in update mode