Nexus 7 Error: Failed to mount /cache I had a problem with my Nexus 7 (2013, 2nd gen) tablet.

I restarted my tablet and when it was rebooting again, it showed "Google" logo and then stood there.
I wait it (around 20 minutes) but it did not do anything else.

Trying factory reset... [failed]

I have check many videos that suggesting apply a hard reset or factory reset, so I tried to do this.
Once in Recovery mode, I notice that some error messages appear at bottom of screen, they are:

E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E:Failed closing /dev/block/platform/msm_sdcc.1/by-name/misc (I/O error)
E:failed to mount /cache (invalid argument)


Then I selected wipe data/factory reset option and execute it. It started to formatting /databut then similar errores were flushed (here I copy log):

-- Wiping data...
Formatting data...
E:failed to mount /cache (invalid argument)
Formatting cache...
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
Data wipe complete.
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E:failed to mount /cache (invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E:Failed closing /dev/block/platform/msm_sdcc.1/by-name/misc (I/O error)
E:failed to mount /cache (invalid argument)


Here I show an image of recovery error messages

Trying unlocking device... [failed]

Some pages and forums suggest to flash and install another ROM, I have selected Cyanogenmod and following steps shown inCyanogen wiki page. The first step is unlocking device, this process starts formatting /data and then formatting '/cache', but again it cannot be mounted.



Finally...
How can I fix these issue?
Try booting into fastboot and run fastboot format cache and then fastboot erase cache.