SDSPLIT repartition your SDcard on phone (w/o a PC)

Search This thread

djwaz

Member
Nov 2, 2008
21
0
Every time I follow the instructions it says invalid argument and whatever file size I requested to the partition such as 'invalid argument 7000M'

What gives?
 

prscott1

Senior Member
Nov 5, 2007
807
23
Houston
Thank you for this! I used it a while back. I'm now seeing some random stale NFS file handlers on my ext2 partition. I tried to delete the partition and recreate it using another partition program, but I believe the errors are still there. It seems to have occurred during upgrading/updating various apps. I'm using a 4gb class 6 knockoff sd. (I did order a Sandisk this morning - it may help avoid these in the future).

Is there any way to run a fix for this on the ext2 partition directly on the android?

I'm more of a windows sys admin so not that experienced *yet* on Linux/Android.

TIA!
 

MartinFick

Senior Member
Mar 12, 2009
214
2
Boulder, CO
www.theficks.name
Every time I follow the instructions it says invalid argument and whatever file size I requested to the partition such as 'invalid argument 7000M'

Please, include some logs or at least your command line. Invalid argument means you gave it an illegal command line, post it if you want help.

Thank you for this! I used it a while back. I'm now seeing some random stale NFS file handlers on my ext2 partition. I tried to delete the partition and recreate it using another partition program, but I believe the errors are still there. It seems to have occurred during upgrading/updating various apps. I'm using a 4gb class 6 knockoff sd. (I did order a Sandisk this morning - it may help avoid these in the future).

Is there any way to run a fix for this on the ext2 partition directly on the android?

This does not sound like an error with your partition. It is strange indeed, I would search other threads, perhaps others have seen such problems. Are you even using NFS at all? Stale NFS files handles usually happen when you have a file open over NFS and someone deletes the file on the NFS server. Really, this likely has nothing to do with your EXT2 partition.
 

vr24

Senior Member
Nov 29, 2007
408
0
Showed an error copying files back over, but it did it anyways!

Worked like a charm, followed the Dummy instructions, used Marcus's Apps2SD app and within 5 minutes had my SD card setup and apps2sd working.

Thanks a ton for your contribution!!!!!
 

djwaz

Member
Nov 2, 2008
21
0
Please, include some logs or at least your command line. Invalid argument means you gave it an illegal command line, post it if you want help.



$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
Connecting to 64.105.21.209 (64.105.21.209:80)
wget: can't open 'sdsplit': File exists
# chmod 555 sdsplit
# exit
$ du -s /sdcard
4 /sdcard
$ df /data
/data: 76544K total, 24564K used, 51980K available (block size 4096)
$ su
# /data/sdsplit -nc 7500M

Usage(v1.6): sdsplit [options]

-h Usage --help Help

-nd|--nodata
-b|--backup -nb|--nobackup
-c|--configs -nc|--noconfigs
-p|--partition -np|--nopartition
-m|--mkfs -nm|--nomkfs
-r|--restore -nr|--norestore

-fm|--forcemkfs
-fu|--forceumount

-pme|--pmke2fs -pmd|--pmkdosfs
-pe|--pext2 -pb|--pbackup
-f32|--fat32 -f16|--fat16
-fs|--fatsize -es|--ext2size

===ERROR: invalid argument 7500M
#
 

djwaz

Member
Nov 2, 2008
21
0
What is this about?

I was going to use the command you gave me now I get this?

$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
Connecting to 64.105.21.209 (64.105.21.209:80)
wget: cannot connect to remote host (64.105.21.209): No route to host
# wget http://64.105.21.209/bin/lib/droid/sdsplit
Connecting to 64.105.21.209 (64.105.21.209:80)
wget: cannot connect to remote host (64.105.21.209): No route to host
# exit
$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
Connecting to 64.105.21.209 (64.105.21.209:80)
wget: cannot connect to remote host (64.105.21.209): No route to host
#
 

djwaz

Member
Nov 2, 2008
21
0
Ok this is first time it did all this so it looks correct but then I get a small error at the end is this normal or ok?


$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
Connecting to 64.105.21.209 (64.105.21.209:80)
sdsplit 100% |***********************************************| 13530 00:00:00 ETA
# chmod 555 sdsplit
# exit
$ su
# /data/sdsplit -nc -fs 7000M
--------------------------------------
+Checking validity of mkdosfs
1+0 records in
1+0 records out

--------------------------------------
+Checking validity of mke2fs
--------------------------------------
+Cannot find a mke2fs executable, see if we can download it from http://64.105.21.209/bin/lib/droid/mke2fs
Connecting to 64.105.21.209 (64.105.21.209:80)
mke2fs 100% |***********************************************| 247k 00:00:00 ETA
--------------------------------------
+Backing up /sdcard to /data
--------------------------------------
+Partitioning sdcard
--------------------------------------
+ Blank out the 4 first blocks of the sdcard so that mountd does not try to remount it on fdisk write preventing a kernel partition table re-read.
4+0 records in
4+0 records out
--------------------------------------
+ Wipe partition table and create FAT32 7000M/EXT2 partitions
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.

The number of cylinders for this disk is set to 242560.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.

The number of cylinders for this disk is set to 242560.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): Command action
e extended
p primary partition (1-4)
Partition number (1-4): First cylinder (1-242560, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-242560, default 242560):
Command (m for help): Selected partition 1
Hex code (type L to list codes): Changed system type of partition 1 to b (Win95 FAT32)

Command (m for help):
Disk /dev/block/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 213624 6835960 b Win95 FAT32

Command (m for help): Command action
e extended
p primary partition (1-4)
Partition number (1-4): First cylinder (213625-242560, default 213625): Using default value 213625
Last cylinder or +size or +sizeM or +sizeK (213625-242560, default 242560): Using default value 242560

Command (m for help): Partition number (1-4): Hex code (type L to list codes):
Command (m for help):
Disk /dev/block/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 213624 6835960 b Win95 FAT32
/dev/block/mmcblk0p2 213625 242560 925952 83 Linux

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table
--------------------------------------
+Creating FAT32 Filesystem
opening /dev/block/mmcblk0p1
/dev/block/mmcblk0p1: 13645232 sectors in 1705654 FAT32 clusters (4096 bytes/cluster)
MBR type: 11
bps=512 spc=8 res=32 nft=2 mid=0xf0 spt=13671920 hds=0 hid=0 bsec=13671920 bspf=13326 rdcl=2 infs=1 bkbs=2
--------------------------------------
+Creating EXT2 Filesystem
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
57984 inodes, 231488 blocks
11574 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=239075328
8 block groups
32768 blocks per group, 32768 fragments per group
7248 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
--------------------------------------
+Mounting FAT Filesystem
mount: mounting /dev/block/mmcblk0p1 on /sdcard failed: Device or resource busy
--------------------------------------
+Mounting EXT2 Filesystem
insmod: can't open '/system/modules/2.6.27-00392-g8312baf/kernel/fs/ext2/ext2.ko'
--------------------------------------
+You should now have a FAT partition on /sdcard and an EXT2 partition on /system/sd. If things worked, you should see an entry for /sdcard and /system/sd below:

/sdcard: 6822616K total, 16K used, 6822600K available (block size 4096)
/system/sd: 911352K total, 1144K used, 910208K available (block size 4096)

--------------------------------------
+Restoring /data/sdcard to /sdcard
Permission setting errors are normal on a FAT system

===ERROR: restore failed!
 

MartinFick

Senior Member
Mar 12, 2009
214
2
Boulder, CO
www.theficks.name
Ok this is first time it did all this so it looks correct but then I get a small error at the end is this normal or ok?

...

--------------------------------------
+Restoring /data/sdcard to /sdcard
Permission setting errors are normal on a FAT system

===ERROR: restore failed!

I believe that happens if you had a blank FAT partition to start with... I should fix that in the next update. I think you are safe to ignore it (if you indeed had a blank card to start with)
 

DSBP1

Senior Member
Mar 31, 2009
78
0
If you chose 4B) Restore your data from your PC. (Again, beyond the scope of this HowTo).

8) You're done! You should have two partitions now on your sdcard. The FAT one mounted at /sdcard and the EXT2 one mounted at /system/sd.

If your run into any serious problems, try to send me the file /data/sdsplit.log if you can get it off your phone.



ok..I just finished step number 8..this one and now I am getting a notification saying the sd is damaged..
 

djwaz

Member
Nov 2, 2008
21
0
Fair enough, yes it was freshly partitioned so it was a blank fat 32 8gb sd card, looks like its worked this time thank you for your help!:)

Now im off to reinstall the apps to sd card app in the market, do you have any experience using this app or how to make it work properly?
 

MartinFick

Senior Member
Mar 12, 2009
214
2
Boulder, CO
www.theficks.name
Adding JF1.5 warning

I've added a warning to the HowTo and First Post about JF 1.5. I am baffled, please, if you have succeeded with the JF 1.5 build (and rebooted), make sure that you leave a success post mentioning the build you use. Thanks!
 
Last edited:

MartinFick

Senior Member
Mar 12, 2009
214
2
Boulder, CO
www.theficks.name
Moving ChangeLog here since there is no space left in first post.

Planned:
* Force uppercase for size units

ChangeLog:
v1.7 2009-05-10 (usability improvements)
* Prompt on startup (confirm requested actions), use -f to override.
* Log invocation string to sdsplit.log
* Removed error when sdcard is empty
* If no ext2.ko is found output a message instead of an error.
v1.6 2009-05-02 (minor unimportant bug fix)
* Better mke2fs validity/availability checking
v1.5 2009-04-30 (minor workaround)
* Hardcoded theficks.name IP for downloads (workaround for apparent DNS problems which still seem to sometimes persist)
v1.4 2009-04-29 (Feature additions, large FAT partitions!!!, and robustness improvements)
* Added automatic logging to /data/sdsplit.log
* Create /data/local/bin if needed when downloading exes (to simply HowTo)
* Wipe first 4 blocks of sdcard before using fdisk to avoid partition table re-read problems.
* Test capability of mkdosfs and download better one if needed (to handle partitions greater than 2GB!)
* No longer backup partition table, no longer useful since we wipe part of the FS also.
* Mount partitions after creating them, even when not restoring data.
* Fixed free space reporting
* Worked around 'bad address' problem. (EDIT: apparently not, see v1.5)
V1.3 2009-04-6 (robustness improvement)
* Added a check to see if /system/sd is already mounted
* Added a --forceumount option to continue despite /system/sd being mounted (by unmounting it)
V1.2 2009-04-5 (feature improvement only)
* Added automated mke2fs download and intallation if executable is not found.
V1.1 2009-04-3 (bug fixes, do not use 1.0)
* Fixes mount point link creation (/system/sd)
* Load ext2.ko module during script so that a reboot is not required to see the new ext2 partition (/system/sd)
* Moved partition backup to a non reboot volatile directory (/data/local/tmp)
* Tried to improve help with respect to specifying partition sizes
V1.0 2009-04-2
* Original Release
 
Last edited:

DSBP1

Senior Member
Mar 31, 2009
78
0
well after 3-4 hours trying to unbricked my phone because this thing bricked my phone like no other...I am ready to give this a second try :)


I'm a masocist!!
 

DSBP1

Senior Member
Mar 31, 2009
78
0
yeah, I know...I should've use the "search" or think before panicking....anyways, thanks for the help...I'ma try this again tomorrow night...
 

Dimath

Senior Member
Nov 5, 2008
77
1
Los Angeles
Just did it on Jf1.5 build. It gave me insmod ext2 error and restoring error. The first I just ignored cause ext2 should exists in Jf build, and I finished the restoring myself and it works fine now.
Thanks for the good work!