5,604,367 Members 48,576 Now Online
XDA Developers Android and Mobile Development Forum

[HOW-TO] Increase the size of data.img for more "Device" storage

Tip us?
 
Kev007
Old
(Last edited by Kev007; 16th November 2010 at 08:42 AM.)
#1  
Kev007's Avatar
Senior Member - OP
Thanks Meter 10
Posts: 231
Join Date: Jan 2008
Location: Leipzig, Germany
Default [HOW-TO] Increase the size of data.img for more "Device" storage

Hi!
I've been getting an unholy amount of PM's asking for help. I would kindly like to redirect all of you Windows users to Viper Matrix Wireless' useful little tool: http://forum.xda-developers.com/showthread.php?t=824154







For those of us that love installing apps and tinkering around with Android on our HD2's, 256MB of "Device" memory simply isn't enough! This fix will increase the size of the data.img file so that there will be more free space available when it's mounted. This is especially beneficial for users running on Android 2.1! See the attached picture!


Download the data.img file corresponding to your build or resize your own by using the instructions at the bottom of this post.

1GB userdata.img for shubCRAFT CM6/Froyo/Themed RC1.1!
http://cid-1dff7e1df294438f.office.l...ed%20RC1.1.rar
http://dl.dropbox.com/u/7684410/xda-...ed%20RC1.1.rar (mirror)
http://www.vbnfiles.com/xda/birkoffs...ed%20RC1.1.rar Thanks to birkoffsjunk for the high speed mirror!

1GB data.img for mattc Leo + Froyo w/Sense RC1.2!
http://cid-1dff7e1df294438f.office.l...WSenseRC1.2.7z
http://dl.dropbox.com/u/7684410/xda-...WSenseRC1.2.7z (mirror)
http://www.vbnfiles.com/xda/birkoffs...WSenseRC1.2.7z Thanks to birkoffsjunk for the high speed mirror!

512MB data.img v1.1 for DarkStone's Desire v5!
http://cid-1dff7e1df294438f.office.l...esire%5E_v5.7z
http://dl.dropbox.com/u/7684410/xda-...e_desire_v5.7z (mirror)
http://www.vbnfiles.com/xda/birkoffs...e_desire_v5.7z Thanks to birkoffsjunk for the high speed mirror!

512MB data.img for dan1j3l's Froyo v1 (w/o Sense)!
http://cid-1dff7e1df294438f.office.l...oFroyo-1.0.rar
http://dl.dropbox.com/u/7684410/xda-...oFroyo-1.0.rar (mirror)
http://www.vbnfiles.com/xda/birkoffs...eoFroyo-1.0.7z Thanks to birkoffsjunk for the high speed mirror!

1GB data.img v1.1 for DarkStone's Froyo v1!
http://cid-1dff7e1df294438f.office.l...royo%5E_v1.rar
http://dl.dropbox.com/u/7684410/xda-...D2Froyo_v1.rar (mirror)
http://www.vbnfiles.com/xda/birkoffs...D2Froyo_v1.rar Thanks to birkoffsjunk for the high speed mirror!

1GB data.img v1 for DarkStone's Froyo v1!
http://cid-1dff7e1df294438f.office.l...royo%5E_v1.rar
http://dl.dropbox.com/u/7684410/xda-...D2Froyo_v1.rar (mirror)
http://www.vbnfiles.com/xda/birkoffs...HD2Froyo_v1.7z Thanks to birkoffsjunk for the high speed mirror!

1GB data.img v1 for DarkStone's Desire v5!
http://cid-1dff7e1df294438f.office.l...sire%5E_v5.rar
http://dl.dropbox.com/u/7684410/xda-..._desire_v5.rar (mirror)
http://www.vbnfiles.com/xda/birkoffs...e_desire_v5.7z Thanks to birkoffsjunk for the high speed mirror!


NOTE: It's best to reformat (or delete ALL your Android files) from your card before replacing the file. Alternatively, manually modify your data.img file using the instructions below.


Changelog
02/08/2010 - Added 1GB userdata.img for shubCRAFT CM6/Froyo/Themed RC1.1
02/08/2010 - mirrors added
29/07/2010 - Added 1GB data.img for mattc Froyo w/Sense RC1.2
29/07/2010 - v1.1 for Desire v5 fixes looping boot animation, screenshot: IMG_4331.jpg
29/07/2010 - Added 512MB data.img for dan1j3l-LeoFroyo-1.0
28/07/2010 - v1.1 fixes carrier issues for Froyo v1, Desire v5 unaffected
28/07/2010 - Added 1GB data.img v1 mods for DarkStone's Desire v5 and Froyo v1, screenshot:

Click image for larger version

Name:	snap20100728_134036.jpg
Views:	3100
Size:	24.8 KB
ID:	368449


-----------------------------------------------OR-------------------------------------------------


Manually edit data.img if you want a different size or use a different build!

I wrote this tutorial using a European HD2, 8GB microSD card, DarkStone's Froyo_v1 and a laptop running Ubuntu 10.04, your experience may vary.

Requirements:
  • Desktop/Laptop running some form of Linux.
    IMPORTANT NOTE: Both, a PC and a Mac, can resize the .img file but not modify (specifically - run resize2fs) the ext2 file system that Android uses. I was in a hurry to post the resizing instructions and didn't fully test the procedure on a PC. Currently, this procedure is only possible on a Linux based operating system. I apologize if your time was wasted.
  • data.img file
  • HD2, microSD card, microUSB cable etc, etc (you might be better off using a card reader)


--------------------------------------------(Running Linux)----------------------------------------------

Procedure:
1. UnZip Android or your present data.img file to your Home Folder. Or a folder of your liking (or even on your memory card!), just remember to cd before you do the following:
2. Open Terminal and Copy&Paste (Ctrl+C, Ctrl+Shift+V) this:
Code:
dd if=/dev/zero bs=1M count=XXX >> data.img
where XXX is the amount, in MB, by which data.img should be increased by.
My filesize started out as 256MB and I wanted a total of 512MB. That would mean I needed a extra 256MB, so I executed this:
Code:
dd if=/dev/zero bs=1M count=256 >> data.img
3. Run a file system check and file system resizer
Code:
e2fsck -f data.img
resize2fs data.img
e2fsck -f data.img
if prompted, press "y" for "yes"

4. Copy all of the Android files onto your SD card, put it into your phone, and run CLRCAD.exe and HARET.exe!



-----------------------------------------------TIPS!-------------------------------------------------

Don't know how to cd?
If you're running a modern build of Linux you can just mount your SD card (phone or cardreader), open File Browser and paste "dd if=/dev/zero bs=1M count=XXX >> " into your open Terminal. This way you can just drag and drop the file into Terminal rather than typing out the file location!



Mounting:
If you're switching between builds and need to copy more than just your apps (apps are easily backed up by ASTRO File Manager - found on the Android Market), mount your data.img file and copy/backup the relevant data before moving on!
Linux:
Code:
mount -o loop data.img /mnt/data
you can put your apps into the AndroidApps folder before booting for them to be auto-installed

---------------------------------------------------------------------------------------------------------------------

EDIT:
added screenshot
added modded data.img for non-Linux users
added modded data.img for non-Linux users for desire v5 too!
put files at the top of the post
added changelog
added mirrors
added instructions for PC
Attached Thumbnails
Click image for larger version

Name:	IMG_4331.jpg
Views:	1804
Size:	81.0 KB
ID:	369005  
XDA Neo (HTC Prophet) ROM: [WM6.1] [Build 20270.1.3.3]
XDA Atom Exec ROM: [WM6.5] [Build 23420.5.4.0]
Toshiba TG01 ROM: [WM6.5] [official O2 ROM]
Sony Ericsson x10 mini ROM: [Android 2.1] [official SE ROM]
HTC HD2 ROM: [NAND WP7.8] [NativeSD Android 4.2.2 CM10.1] [NexusHD2-JellyBean]
HTC One ROM: [Android 4.3 | Sense 5.5] [Android Revolution HD 30]
The Following 3 Users Say Thank You to Kev007 For This Useful Post: [ Click to Expand ]
 
aussiebum
Old
#2  
Senior Member
Thanks Meter 122
Posts: 1,437
Join Date: Dec 2008
Noice! I was exactly thinking about this since I started trying out Android on HD2 couple of days ago.

Might backup my data.img and give this method a go.
------------------------------------------------
Nexus 10 -> Sabermod + KTManta kernel

Samsung Galaxy Note 3 -> Stock MJ7 rooted

Samsung Galaxy NOTE II -> wanam lite stock something + perseus kernel

Samsung Galaxy S II -> Wanam Stock JB + siyah 6.0b4

Samsung Galaxy Tab P1000 - Overcome 4 @ 1.2ghz

HTC HD2 -> pdaimatejam WP7.5 Mango rom v7.8
 
GodsGift
Old
#3  
Senior Member
Thanks Meter 7
Posts: 155
Join Date: Sep 2008
This is awesome!

Please can chefs cook this into their builds....

My biggest problem (other than no USB and no bluetooth) is this space limitation.

Well done you!


GG
 
Kev007
Old
(Last edited by Kev007; 2nd August 2010 at 07:08 AM.)
#4  
Kev007's Avatar
Senior Member - OP
Thanks Meter 10
Posts: 231
Join Date: Jan 2008
Location: Leipzig, Germany
info moved to first post...
XDA Neo (HTC Prophet) ROM: [WM6.1] [Build 20270.1.3.3]
XDA Atom Exec ROM: [WM6.5] [Build 23420.5.4.0]
Toshiba TG01 ROM: [WM6.5] [official O2 ROM]
Sony Ericsson x10 mini ROM: [Android 2.1] [official SE ROM]
HTC HD2 ROM: [NAND WP7.8] [NativeSD Android 4.2.2 CM10.1] [NexusHD2-JellyBean]
HTC One ROM: [Android 4.3 | Sense 5.5] [Android Revolution HD 30]
 
Nightstorm99
Old
#5  
Nightstorm99's Avatar
Member
Thanks Meter 2
Posts: 65
Join Date: Feb 2008
Location: Brandenburg
works beautifully!!!

Thank you
Work Calendar 3.0.13 for Android
You are shift workers or someone having to work with changing times and it sucks up every day in the calendar change individually?

Then you look at the “Work Calendar” !


Seeking beta testers and translators. The Google translator is trash!
Please contact me via my website.

Demon_man Old
#6  
Guest
Thanks Meter
Posts: n/a
How would you fancy doing each version as testers for us, as some people on here dont use Linux?? and is there a way you can provide a screen shot showing the phone running android with more storage?
 
futureshock
Old
#7  
futureshock's Avatar
Senior Member
Thanks Meter 203
Posts: 1,016
Join Date: Aug 2006
Location: Linz
any changes to extend a used img. file?!

also sofar my linux knowing is this command:

dd if=/dev/zero bs=1M count=256 >> data.img

just writes zeros to the end of the data.img...
shouldn't this work with a used file too?

another idea (can't try because mac osx didn know the resize2fs commands..)

dd if=/blabla/data.img bs=1M count=512 > data_new.img ?!
so it just copies the hole data.img in a new file ...
My Windows Mobile History:
Vodaphone VPA Compact II (Wizard); HTC TyTn (Hermes); HTC Touch (ELF); "Samsung SGH-F700 (QBOWL)"; HTC Touch Diamond & O2 Diamong; HTC Touch HD; Sony Xperia X1; actual: HTC MteoR (Breeze) & HTC Touch HD2

Please Donat a few Bucks if you think my time and work is worth it!


MIUI for HD2 NAND Build
MIUI German for HD2 SD Build
WM6.1 for Breeze/MTeoR
Demon_man Old
#8  
Guest
Thanks Meter
Posts: n/a
holy COW great work you clever little bunny lol, maybe you should message the devs see if they wanna add this to there work
 
Kev007
Old
#9  
Kev007's Avatar
Senior Member - OP
Thanks Meter 10
Posts: 231
Join Date: Jan 2008
Location: Leipzig, Germany
Quote:
Originally Posted by futureshock View Post
dd if=/dev/zero bs=1M count=256 >> data.img

just writes zeros to the end of the data.img...
shouldn't this work with a used file too?
I was thinking that too...
I tried it at least 3 times, but Android still displayed 0.00 MB free memory (heh heh, i know )
Maybe because the system registers the size of the mount after the initial boot and never bothers checking it?!?
XDA Neo (HTC Prophet) ROM: [WM6.1] [Build 20270.1.3.3]
XDA Atom Exec ROM: [WM6.5] [Build 23420.5.4.0]
Toshiba TG01 ROM: [WM6.5] [official O2 ROM]
Sony Ericsson x10 mini ROM: [Android 2.1] [official SE ROM]
HTC HD2 ROM: [NAND WP7.8] [NativeSD Android 4.2.2 CM10.1] [NexusHD2-JellyBean]
HTC One ROM: [Android 4.3 | Sense 5.5] [Android Revolution HD 30]
 
futureshock
Old
#10  
futureshock's Avatar
Senior Member
Thanks Meter 203
Posts: 1,016
Join Date: Aug 2006
Location: Linz
any change to extend the img inside android?!
maybe there are also the commands built in the linux kernel?
My Windows Mobile History:
Vodaphone VPA Compact II (Wizard); HTC TyTn (Hermes); HTC Touch (ELF); "Samsung SGH-F700 (QBOWL)"; HTC Touch Diamond & O2 Diamong; HTC Touch HD; Sony Xperia X1; actual: HTC MteoR (Breeze) & HTC Touch HD2

Please Donat a few Bucks if you think my time and work is worth it!


MIUI for HD2 NAND Build
MIUI German for HD2 SD Build
WM6.1 for Breeze/MTeoR

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...