How to install Android on a flash drive?
In this article, I will show you how to install Android 6.0 x86 on a flash drive so that the computer can boot from it and at the same time save all the changes that you have made to the system between sessions.
In a previous article on installing Android, I wrote how to install Android x86 on a logical drive on your computer next to or instead of your main operating system. Now we have another task – to install Android on a USB flash drive in order to use it on any of our x86 (32-bit) or x64 (64-bit) computers that support booting from external USB media.
Here’s what we need:
- Installation CD or DVD or installation flash drive. How to create an installation disk or installation flash drive was described in the article “Installing Android on a netbook or computer.” You can see all versions of Android here and here (when writing this article, I used a distribution kit with the latest version of Android 6.0).
- Flash drive or external hard drive where we will install Android. It is advisable to use a media with a capacity of at least 4 GB.
Please note that flash drives or external drives may have hidden partitions that are not deleted during normal formatting, and which will prevent the computer from booting from this media. To delete all partitions on a flash drive and format it at the same time, you can use the SD Card Formatter program. Also note that the SD Card Formatter program formats flash drives smaller than 4GB in FAT16 format, i.e. when installing Android, the flash drive will need to be formatted again in FAT32. You can check and delete partitions on an external hard drive using GParted or a similar hard drive editor.
After you have everything you need ready, insert the installation disc into the DVD drive or connect the installation USB flash drive to your computer. In the BIOS or UEFI of the computer, enable the computer to boot from the DVD drive or flash drive, respectively. Also connect a flash drive or external drive to the computer where you want to install Android. After that, restart your computer and you should see the Android installation menu on the screen. Use the arrow buttons to select the last menu item here “Installation – Install Android-x86 to harddisk” and press Enter.
On the next screen, you will see all the logical drives where Android can be installed. Among them should be your flash drive or external drive. I did not see my flash drive in the list, there were only hard drives, see the picture. As it turned out, the flash drive may not immediately appear in this list. To update this list, select the menu item “Detect devices“.
And, as you can see, after the update, the required flash drive appeared in the list. Now you can select it in the list and press Enter.
Be very careful at this step. You need to be 100% sure that you are choosing the right drive. If you select the wrong drive, then after installing Android on it, all data will be irretrievably lost.
At the next step, the installer will offer to format the selected drive. It is best to format the flash drive yourself to the FAT32 file system before starting the installation using the SD Card Formatter program, see above. In this case, at this stage, you can select “Do not format” and press Enter. If the flash drive is not yet formatted or has any files on it, select fat32 from the list. Once selected, press Enter.
I recommend choosing the FAT32 file system because my computers refuse to boot from a flash drive with other file systems, but you can ignore this advice and conduct your own experiments.
If you choose formatting, the installer will warn you that all data will be lost from the disk as a result of formatting. At this step, you need to answer “Yes”, press Enter and your flash drive will be formatted.
After we figured out the file system, you will see a question whether you need to install a bootloader GRUB. Here we set “Yes” so that GRUB is installed and configured automatically. GRUB will be needed to run our Android on computers that use the BIOS. Press Enter.
For the next question about installing the bootloader EFI GRUB2 also answer “Yes”. This bootloader is useful for new computers where UEFI is used instead of BIOS. Press Enter.
When you choose to install EFI GRUB2, the next question is whether to clean up the boot section of the flash drive. We don’t need it. Leave “No” and press Enter.
In the next step, the installer will ask if you need to set write permissions to the /system directory. Leave “Yes” here and press Enter.
After that, the installation of Android x86 on a USB flash drive or external drive began.
After installation, you will be asked if you want to create a disk image to store user data. The fact is that Android cannot fully work with FAT32 and NTFS file systems, and all your data (files) will be stored in one data.img file. Put “Yes” here and press Enter.
After that, the installer will ask what size the data.img file will be. The minimum value here is 512MB, and the maximum is limited by the size of your card and the capabilities of the FAT32 file system, i.e. about 4096MB. True, from here you still need to subtract the amount occupied by Android system files, which occupy about 1300MB (this size may vary from version to version). I used a 4 GB flash drive (actual size is about 3800 MB), so I’ll put 3800 – 1300 = 2500 MB here. Press Enter.
For conversion, you can use the Yandex converter. To use it, type in the Yandex search the line “4024954880 bytes to convert to mb”, where replace 4024954880 with the size of your flash drive. In my case, the result will be 3838.5 MB, I rounded it down to 3800.
At the end of the installation, if everything went well, you will see the message shown in the picture below. Remove the installation flash drive (leave the flash drive that Android is installed on), select “Reboot” and press Enter to reboot the computer. When rebooting, configure in the BIOS or UEFI so that the computer boots from the flash drive on which we just installed Android.
After the computer boots up, you should see the Android start window.
Now you can use the ready-made flash drive or external drive with any of your x86 (32-bit) or x64 (64-bit) computers that support booting from external USB drives.