Originally I had my flash drive and a powered USB hub plugged directly into the Pi, and then my hard drive plugged into the USB hub, so that I would have extra USB ports available should I need to plug in a keyboard for any reason. However, I finally realized the hub was causing problems, and I was having problems similar to this post: http://www.raspberrypi.org/phpBB3/viewt ... 9&p=373974 and I would get messages like this on boot-up (device number 6 refers to my external hard drive):
Sometimes it would just keep resetting the device on reboot and the hard drive wouldn't register at all and thus would fail the boot-time file system check, and I would get booted into a maintenance shell. When this happened, SSH would be unavailable so I would have to plug a keyboard into the hub to safely reboot the Pi. (It would say something along the lines of "A maintenence shell will now be started. After performing system maintenance, please CONTROL-D to terminate the maintenance shell and restart the system. ...".)
Code: Select all
[ 3.655985] usb 1-1.2.1: new high-speed USB device number 6 using dwc_otg [ 42.456535] sd 1:0:0:0: [sdb] 976754645 4096-byte logical blocks: (4.00 TB/3.63 TiB) [ 42.469645] sd 1:0:0:0: [sdb] Attached SCSI disk [ 77.345887] usb 1-1.2.1: reset high-speed USB device number 6 using dwc_otg [ 115.346084] usb 1-1.2.1: reset high-speed USB device number 6 using dwc_otg [ 146.306013] usb 1-1.2.1: reset high-speed USB device number 6 using dwc_otg [ 177.345978] usb 1-1.2.1: reset high-speed USB device number 6 using dwc_otg [ 208.305948] usb 1-1.2.1: reset high-speed USB device number 6 using dwc_otg [ 210.581991] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
Now that I've realized this is the hub's fault, I'm plugging my hard drive directly into the Pi and everything is working. This is fine, since I want to run it headless anyway, but I have a question: is there any way to ensure that even if I get dumped back into that maintenance shell again for any reason that SSH is available? Because if the Pi ends up dumping me into a maintenance shell again I won't be able to SSH into the machine, but without the hub I have no extra USB ports, and without any way to plug in a keyboard I won't be able to shut the Pi down safely. I would have to either unplug my hard drive without unmounting it to free up a USB port for my keyboard, or just pull the plug on the Pi itself, neither of which is good for either the Pi or my hard drive. Is there any settings I can modify, either in fstab or elsewhere, to ensure that no matter what I will always have SSH available to me as long as my LAN is functioning, especially even if my hard drive fails the fsck for any reason (since it's just storage anyway, it's not a huge deal if it can't mount at boot for some reason, though I'd still like it to do so automatically if possible).
This is my current fstab for reference:
The UUID mounting at / is my flash drive, and the UUID mounting at /media/USBHDD1 is my external hard drive. The commented-out /dev/mmcblk0p2 refers to my SD card, which I am no longer booting from.
Code: Select all
proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 #/dev/mmcblk0p2 / ext4 defaults,noatime 0 1 /dev/disk/by-uuid/3bcc8e11-359e-4e5b-b028-c530a201f0db / ext4 defaults,noatime 0 0 /dev/disk/by-uuid/930b3cae-d060-4ff3-923b-4c918885bb00 /media/USBHDD1 ext4 defaults,noatime 0 2