I'm assuming you have full-size personal computer to work on, otherwise where would your share be connected to! So..., can you mount and read the SDHC card from the Pi on that PC? If you think you might be able to, the read on:
My Debian Linux machine automatically mounts and attaches all the partitions it can find on the card from my Pi if I insert it into the card read/writer it has and then it would be fairly easy to edit the file /etc/fstab
on partition that gets the label root
and which gets mounted to /media/root
on the PC. I would just then comment out the bad line in fstab with a leading #
(to mark the rest of that line as a comment which gets ignored) and then correctly flush and unmount any partitions that got automagically mounted before removing from the PC. I'd imagine most reasonably modern Linux distributions would allow the same - though as the file concerned is typically read only except for root you will probably have to use sudo on the PC to get to write to the file, which, in my case would be, remember, at /media/root/etc/fstab
on the PC, don't touch the PC's own fstab at /etc/fstab
!
If your PC is a Mac then I guess the procedure would be broadly similar.
If your PC is a Windows one then it can be a bit tricky, however the ext2fs "Ext2 File System Driver for Windows" may be helpful to be able to read and write to that root file-system, I'd exercise caution in using it for editing/writing data to a Ext4 file-system (use it just to mount the file-system just so you can comment out that one line in fstab with say a safe text editor). Be careful NOT to screw that very important file up with a Windows based text editor that does not use the right End-Of-Line characters {just Line-Feed characters - a.k.a. Unix EOL} for "unix" type files...! I do not know how good the support in ext2fs is for more exotic features of Ext4 filesystems, though I've never had any trouble with 2 or 3 with this Windows FOSS. Driver and you are not likely, IMHO, to run into them on a flash card at today's few 10's of GByte max sizes.
As for getting into recovery mode - if it was the older Wheezy Debian based Raspian I'd expect you to have an apparent bash shell asking you for the root password before allowing you to proceed further into a system maintenance shell which means you could use vim-tiny
(probably aliased to vi
) as root to edit /etc/fstab directly (though there might be other editors like nano
available). As the default for Pis is not to have a root password I'm not sure how it would progress - I guess it would leave you at a bash super-user prompt (the one ending in #
not $
). Trouble is the new-fangled systemd
is the default in the current Jessie Debian based Raspian now and the start-up process is very different from sysv-init
that I have grow to know and sometimes sigh about - and I, personally, am in the don't touch it with a barge-pole camp on systemd and am looking to uninstall it on the Pis I had for a week (I've been a Linux user for many years though) to avoid having to find out the differences when things go pear-shaped on start up like they have for yourself... 8-(