Can't connect to the device with ADB when it's in recovery mode I am having some problems with my Samsung Galaxy S2 and I want to start an fschk session on the device.

So, I installed Android SDK with platform-tools. I can access to the device when it's normally rebooted but I couldn't list and connect to the device when it's in recovery mode.

How can I connect via ADB when the device is in recovery mode?
WARNING: fastboot oem unlock completely wipes your data!

adb is not available in the bootloader, try using fastboot instead

for a quick and dirty rundown of flashing your device with a new image using fastboot:

adb reboot bootloader
use fastboot devices to verify your device is visible, if not, you're probably running windows, and you have to install some funky drivers.
if you don't see 'unlocked' at the bottom of the screen, use the command fastboot oem unlock
then just:
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash recovery recovery.img

If you feel super confident you could just:
adb reboot bootloader &amp;&amp; fastboot oem unlock &amp;&amp; fastboot flash boot boot.img &amp;&amp; fastboot flash system system.img &amp;&amp; fastboot flash userdata userdata.img &amp;&amp; fastboot flash recovery recovery.img &amp;&amp; fastboot reboot

PS You should only use the flash commands if the referenced files are present, if not you may or may not brick your phone (haven't tried flashing a non-existent file to the device yet)

Warning: Unlocking bootloader wipes off data in your phone.