Nexus 5/6P Flashing Factory Image fastboot error: mke2fs failed with status 1, Cannot generate image for userdata

During flashing of Nexus factory image, running flash-all.sh or simply

# fastboot -w update image-hammerhead-m4b30z.zip

fails with message

/usr/bin/mke2fs failed with status 1
fastboot: error: Cannot generate image for userdata

If you remove ‘-w’ from the fastboot command, the installation can complete without formatting (wiping) userdata partition. However that is not an ideal situation and may cause first boot to freeze or loop.

mke2fs is part of Android platform tools that also come with adb and fastboot.

The error is caused by older platform tools version where mke2fs is not compatible with the newer factory images.

Install the latest platform tools from Google Android Developer website.

Check for correct PATH where platform tools are located. Eg. /usr/bin/ and /usr/loca/bin to make sure you only have one and latest copy of adb, fastboot and mke2fs in PATH

When done correctly, mke2fs will format (wipe) the userdata partition with the fastboot -w update command.

# fastboot -w update image-hammerhead-m4b30z.zip
......
......
Erasing 'userdata' OKAY [ 10.202s]
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 3351034 4k blocks and 838832 inodes
Filesystem UUID: 5e6cb2b1-73ad-4645-8e75-27dddcacd9fd
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
......

However, the latest mke2fs may still cause first boot freeze or bootloop especially for Nexus 5. Wiping Dalvik and Cache will help. To do this, use third party recovery tools such as Team Win Recovery Project (twrp) for wiping partitions.

Download latest twrp recovery images from:
twrp recovery image for Nexus 5
twrp recovery image for Nexus 5X
twrp recovery image for Nexus 6P

If you have other model, just replace the model code name (hammerhead/bullhead/angler) in the url with your model. Then flash the recovery with fastboot

# fastboot flash recovery twrp-3.3.0-0-hammerhead.img

Reboot into recovery (it should start Team Win Recovery), and perform Wipe-> Format Data, then Advanced Wipe select to wipe Dalvik / Art Cache, Data, Internal Storage (optional) and Cache. (Leave System unchecked unless you want to re-flash factory image)

You may re-flash factory image and restore stock recovery. If you like, leave out the ‘-w’ option to bypass format of userdata partition.

# fastboot update image-hammerhead-m4b30z.zip

Mobile Studio for Recording and Streaming with OBS Studio

OBS Studio is an open-source broadcast quality software that you can use to create a mobile recording and streaming studio.

OBS Studio is supported on Windows, MacOS and Linux laptop. Once installed, you have a full-fledged multi-scene, multi-source, audio-visual recording studio with capability of streaming on your favorite platform such as YouTube and Twitch.

Now, you can use the microphone and webcam for sources. This would be a basic setup for recording and streaming personal messages.

Things start to get interesting once you connect external sources. It can be setup for recording/streaming live events, music recording…

External IP camera:

OBS Studio using Android Phone as IP-Camera

OBS Studio is an open-source broadcast quality software that you can use to create a mobile recording and streaming studio. This guide shows you how to connect an external IP Camera to OBS studio.

The example here use your Android phone as a wireless video camera.

Install IP Webcam app from Google Play Store (Free, or paid a few dollars for ads-free Pro version), start the app and click “Start Server” at the bottom. It is that simple. Note the URL (eg. http://192.168.1.173:8080) shown at the bottom of the screen.

In OBS Studio, add (+) a Media Source source, and select Create new and give it a name, say Camera 1, and hit OK.

Uncheck “Local”, then enter the URL that is shown on the phone, with a trailing “/video”, eg. http://192.168.1.173:8080/video and hit OK

If you setup username/password security, then enter the URL as http://username:password@192.168.1.173:8080/video

Voila, your IP camera is now connected live.

You can resize the source by dragging the red outline, to accommodate multiple sources. You may also define different sources in separate scenes, so that you can transition from one scene to another.

The phone battery probably won’t last very long, so you want to have the phone charger plugged in, especially for event functions

For live event or other reason, you may also want to mount it on a tripod with a phone attachment head.