开发者

Partitioning the filesystem on Android

I'm trying to re-partition an SDCard on Android, with root access.

I have the 512 byte MBR file, and it shows up as this:

 Pos MBRndx Type/Name  Size Active Hide Start Sector   Sectors
 --- ------ ---------- ---- ------ ---- ------------ ------------
  0    0    0C-FAT32X  5.9G   No    No            64   12,124,096
  1    1    0C-FAT32X  1.9G   No    No    12,124,160    3,932,160

What I'm trying to do is resize the 5.9GB partition into 3GB, and then make an EXT partition with the remaining space. I can think of two ways to do this, but I'm a bit stumped in doing either of them:

1) Cross-compile GNU parted, and run it on Android to modify the filesystem in pl开发者_Go百科ace. This would be my preferred method, but I've been trying to statically compile parted using scratchbox and haven't had much luck, and I haven't been able to dynamically compile for Android in scratchbox either.

2) Directly modify the 512 byte MBR using some utility on my computer, and then dd the file on Android. I have a tool to view the MBR (mbrwiz), but I don't know how to edit it.

Does anybody have any suggestions for either, or possibly a third route?


Maybe I'm not seeing the problem, but it does not look like you want to automate this or make a program with that functionality. So, why not take the SD card out of the Android device and partition it in a card reader on your desktop machine? You could even do a full backup beforehand and avoid losing any data with the partitioning.


You could use fdisk instead of parted, as we used for years before the later tool came about.

Many of the android community roms include a busybox-based fdisk, which with care you could probably install without replacing the actual rom (which may not yet have a fully functional galaxy version)

Not sure how this helps the kernel changing it back problem. You could have a look in /init.rc and see if there's something you can comment out there (you would need to extract, modify, and reflash the ramdisk to make a change to that, splitting and recombining it from the kernel if they did it the same way as the htc phones)

It may also be possible to partition it with external tools when it's in usb mount mode - if the usb storage gadget just treats it as a sea of blocks, presumably you could put a partition table on it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜