You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VMware虚拟机中Android 7.1-rc2模拟器内部存储空间扩容求助

Fixing Android 7.1-rc2 Emulator Storage Expansion in VMware

Hey there! I’ve dealt with this exact problem before—expanding the VMware virtual disk doesn’t automatically resize Android’s internal storage because the OS still uses the old partition table. Let’s fix this step by step using the terminal emulator:

Prerequisites

  • Confirm you’ve already expanded the VMware virtual disk through its settings (you mentioned you did this, so we’re ready to go)
  • Have the Terminal Emulator app installed on your Android emulator, or enable USB Debugging to use adb shell from your host machine
  • You’ll need root access (most emulators come with root enabled by default; if not, toggle it in the emulator’s settings)

Step 1: Verify Disk & Partition Status

First, let’s make sure Android recognizes the expanded disk:

  1. Open Terminal Emulator and run su to gain root privileges (tap "Allow" if a root access prompt pops up)
  2. Check your disk and partitions with:
    cat /proc/partitions
    
    You’ll see your main disk (usually /dev/sda or /dev/mmcblk0) has the new larger capacity, but the /data partition (where internal storage lives) is still stuck at its old size.

Step 2: Resize the /data Partition

We’ll use fdisk to adjust the partition table. Warning: This can cause data loss if done incorrectly—back up any important files first!

  1. Run fdisk /dev/sda (replace /dev/sda with your disk identifier from Step 1)
  2. Follow these prompts in fdisk:
    • Type d and press Enter to delete the existing /data partition (enter the partition number when asked—find it from cat /proc/partitions or fdisk -l)
    • Type n and press Enter to create a new partition:
      • Choose p for primary partition
      • Use the same partition number as the one you deleted (e.g., 3)
      • For the starting sector, enter the exact same value as the original /data partition (this is critical to keep your data intact—check this from the earlier fdisk -l output)
      • For the ending sector, just press Enter to use the maximum available space
    • Type w and press Enter to save the new partition table

Step 3: Reboot the Emulator

The new partition table won’t take effect until you restart the emulator. Reboot it either through Android’s settings or by running reboot in the terminal.

Step 4: Expand the File System

After rebooting, we need to stretch the file system to fill the new partition:

  1. Open Terminal Emulator again, run su to get root
  2. Run the following command (replace /dev/sda3 with your new /data partition path):
    resize2fs /dev/sda3
    
    If you get an error about needing to check the file system first, run:
    e2fsck -f /dev/sda3
    
    Then try resize2fs again.

Step 5: Verify the Fix

Check if the internal storage has expanded by running:

df -h /data

You should now see the new, larger capacity listed.


Troubleshooting Tips

  • If resize2fs fails because /data is mounted, reboot into recovery mode (hold power + volume up in the emulator) and run the resize2fs command from recovery’s shell
  • If you don’t have Terminal Emulator, use adb shell from your host machine: enable USB Debugging in Android’s Developer Options, connect via adb connect <emulator-ip>, then run the same commands as above

内容的提问来源于stack exchange,提问作者ElMeSaFeR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:02:49