Sun Mar 04, 2018 8:42 pm
Get another SDCard and a USB reader.
Build a fresh copy of Raspbian Stretch on the new SDCard. Boot that in your RPi. Open an LXTerminal and get root authority shell with sudo -s.
Mount the borken card in the Reader. Insert the reader in your RPi. The automounter will pop-up, cancel any windows that pop-up.
Run
for i in /dev/sda*
do
umount $i
fsck -f -y $i
done
ignoring any errors.
Mount the rootfs (/dev/sda2 if not NOOBS, /dev/sda6 if it is NOOBS) with
mount /dev/sda2 /mnt # or mount /dev/sda6 /mnt
Mount some special filesystems
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount -o bind /dev /mnt/dev
Change to the /mnt directory and chroot the /dev/sda filesystem.
cd /mnt
chroot . # there's a full stop on the end of that one.
You now have the original card's filesystem available and you're running as root. Use
passwd pi
and follow the prompts to reset your pi password to a known string.
Exit the chroot, unmount everything. Poweroff, swap cards and you're good to go.
exit # the chroot not the root shell
for i in dev proc sys
do
umount /mnt/$i
done
umount /dev/sda2
eject /dev/sda
poweroff
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Criticising any questions is banned on this forum.
Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.