maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Repartition the internal drive (https://talk.maemo.org/showthread.php?t=35122)

babyshamie 2011-01-17 22:02

Re: Repartition the internal drive
 
it looks like this==>

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ sudo gainroot
Root shell enabled


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/home/user # sfdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 977024 cylinders, 4 heads, 16 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/mmcblk0p1 1 884864 884864 28315648 83 Linux
/dev/mmcblk0p2 884865 950400 65536 2097152 83 Linux
/dev/mmcblk0p3 950401 974976 24576 786432 82 Linux swap / Solaris
/dev/mmcblk0p4 0 - 0 0 0 Empty
/home/user # mount
rootfs on / type rootfs (rw)
ubi0:rootfs on / type ubifs (rw,bulk_read,no_chk_data_crc)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,noatime,size=1024k)
tmpfs on /var/run type tmpfs (rw,nosuid,noatime,size=256k,mode=755)
none on /dev type tmpfs (rw,noatime,size=10240k,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noatime,size=65536k)
/dev/mmcblk0p1 on /home type ext3 (rw,noatime,errors=continue,commit=1,data=writebac k)
/home/opt on /opt type none (bind)
nodev on /sys/kernel/debug type debugfs (0)
/opt/pymaemo/usr/lib/python2.5 on /usr/lib/python2.5 type bind (bind)
/opt/pymaemo/usr/share/pyshared on /usr/share/pyshared type bind (bind)
/opt/pymaemo/usr/lib/pyshared on /usr/lib/pyshared type bind (bind)
/opt/pymaemo/usr/share/python-support on /usr/share/python-support type bind (bind)
/opt/pymaemo/usr/lib/python-support on /usr/lib/python-support type bind (bind)
/dev/mmcblk1p1 on /media/mmc1 type vfat (rw,noauto,nodev,noexec,nosuid,noatime,nodiratime, utf8,uid=29999,shortname=mixed,dmask=000,fmask=013 3,rodir)
/home/user #

michaaa62 2011-01-17 22:22

Re: Repartition the internal drive
 
Looks good so far, before carrying on assure yourself that it worked
Code:

df
Read the desired size for /home, aka optfs. But you have to apply a new partition table, because having MyDocs in the first partition is somehow hardcoded in Maemo.
Now after you are assured carry on with first
Code:

sudo gainroot
followed by this one command over these 5 lines
Code:

echo "unit: sectors
> /dev/mmcblk0p1 : start= 56631360, size= 4194304, Id= c
> /dev/mmcblk0p2 : start= 64, size= 56631296, Id=83
> /dev/mmcblk0p3 : start= 60825664, size= 1572864, Id=82
> /dev/mmcblk0p4 : start= 0, size= 0, Id= 0" > table

It parses the text between the "" to the file named table. Then apply the table to your device
Code:

sfdisk --no-reread /dev/mmcblk0 < table
Now reboot again to make that partition setup known to the kernel
Code:

reboot
After reboot carry on with creating the filesystem for MyDocs partition and mount it
Code:

sudo gainroot
mkfs.vfat -F32 -n MyDocs /dev/mmcblk0p1
mount /dev/mmcblk0p1 /home/user/MyDocs

Voila, your done!

babyshamie 2011-01-17 22:55

Re: Repartition the internal drive
 
Quote:

Originally Posted by michaaa62 (Post 922640)
Looks good so far, before carrying on assure yourself that it worked
Code:

df
Read the desired size for /home, aka optfs. But you have to apply a new partition table, because having MyDocs in the first partition is somehow hardcoded in Maemo.
Now after you are assured carry on with first
Code:

sudo gainroot
followed by this one command over these 5 lines
Code:

echo "unit: sectors
> /dev/mmcblk0p1 : start= 56631360, size= 4194304, Id= c
> /dev/mmcblk0p2 : start= 64, size= 56631296, Id=83
> /dev/mmcblk0p3 : start= 60825664, size= 1572864, Id=82
> /dev/mmcblk0p4 : start= 0, size= 0, Id= 0" > table

It parses the text between the "" to the file named table. Then apply the table to your device
Code:

sfdisk --no-reread /dev/mmcblk0 < table
Now reboot again to make that partition setup known to the kernel
Code:

reboot
After reboot carry on with creating the filesystem for MyDocs partition and mount it
Code:

sudo gainroot
mkfs.vfat -F32 -n MyDocs /dev/mmcblk0p1
mount /dev/mmcblk0p1 /home/user/MyDocs

Voila, your done!


thax.thax.thax..very much, I can now access it,wooo..but i have 25gb for installing apps and 2gb on MyDocs,,but its does not really matter though i wanted only 8gb for installing apps...thx again

michaaa62 2011-01-17 23:23

Re: Repartition the internal drive
 
Quote:

but i have 25gb for installing apps and 2gb on MyDocs,,but its does not really matter though i wanted only 8gb for installing apps
Man, you mentioned solution #1 here http://talk.maemo.org/showpost.php?p...&postcount=264
If you really want to repartition 8GB optfs and 24 GB MyDocs you have to backup all your stuff, because during the procedure both are deleted and one after the other rebuild from the backup like in solution #3
http://wiki.maemo.org/Repartitioning_the_flash

n900shamie 2011-01-18 06:11

Re: Repartition the internal drive
 
can anyone explain and give a table of how to have 10gb for install and the rest for MyDocs,i couldnt manage with the ideas provided on wiki.
thx

michaaa62 2011-01-18 07:44

Re: Repartition the internal drive
 
Quote:

Originally Posted by n900shamie (Post 922829)
can anyone explain and give a table of how to have 10gb for install and the rest for MyDocs,i couldnt manage with the ideas provided on wiki.
thx

Make sure you understand the solution fully, know about the risks of loosing everything if you not backup properly!
Read, digest, understand or ask your questions before doing something irresponsible, it saves your nerves!!!
This is the table for solution #3 only. It is the temporary table because of the two zero'ed partition type entries, which will not get mounted during reboot!
Code:

echo "unit: sectors
> /dev/mmcblk0p1 : start= 64, size= 39854080, Id=0
> /dev/mmcblk0p2 : start= 39854144, size= 20971520, Id=0
> /dev/mmcblk0p3 : start= 60825664, size= 1572864, Id=82
> /dev/mmcblk0p4 : start= 0, size= 0, Id= 0" > table

The types of the partitions will get changed later in solution #3 of the wiki http://wiki.maemo.org/Repartitioning...ome_and_MyDocs

Edit: Documentation of the calculation:
Start from the end, swap partition will not get changed [ignore it]. The first partition must start at 64!!!
Code:

10G=1024*1024*10*2=20,971,520 Sectors is the size of partition2
60825664 minus 20,971,520 = 39854144 is the starting value for partition2
39854144 minus 64 = 39854080 is the size of partition!

These three calculations will give you all the numbers for the table above.

n900shamie 2011-01-18 15:39

Re: Repartition the internal drive
 
i have tried the procedure that u just gave three times now but i still have the same memory style after the process..can u give a whole procedure for 10gb for installing plzz.

lalomartins 2011-01-18 16:22

Re: Repartition the internal drive
 
This is now fixed, I have my N900 running with ext4 MyDocs and no problems. My booting issues were due to the awk madness that generates the fstab (why???) barfing on two partitions having the same type. I disabled the whole thing and went with a static fstab like most linux systems in this reality.

Quote:

Originally Posted by lalomartins (Post 920230)
For me the motivation wasn't size, as I was satisfied with the partitioning, but I wanted MyDocs in a filesystem that preserves permissions (especially fed up with every file having +x when copied out of there).

I formatted it as ext4, changed a pile of scripts (there are instructions on page 18 of this topic), and actually remembered to change the ownership of the whole filesystem to the user before I even tried to use the camera — meaning I never actually experienced camera issues.

Right now I'm happily using my n900 with an ext4 MyDocs, no problems yet.

One thing I have to note though, since my uid on my work/home computers is obviously not the same, I had to do something to be able to write to MyDocs when mounted with mass storage. Best way to do that was with POSIX ACLs; man setfacl is your friend.


kyllerbuzcut 2011-01-18 16:45

Re: Repartition the internal drive
 
You can repartition and create new partitions WITHOUT losing any data with gparted. I managed it so anyone can. Just create a bootable cd. I did this even though I have a windows pc. When the machine boots off the cd, plug n900 in and resize the partitions. Took about 15 minutes from start to finish for me. I created a new partition of 2gb for android then gave home an extra 2gb, stealing 4gb from MyDocs. I can find the links or make a howto or something if really needed, but I think if I can do it when I'm a real n00b then anyone can.

brahim98 2011-01-18 17:58

Calculate partition size
 
Hello,
Here is a method to calculate the partition's table.
You must know that a bloc is 32k and it's better to use boundaries at 256k.
To calculate a size the rule is to change to KB and divide by 32.
Maybe an example will make it clearer :
To keep it simple, let's assume that you want at most 4 partitions.
1) Choose a partitionning layout
in my example
Quote:

p1=remaining (21GB) as fat, p2=8GB as ext3, p3=512MB as swap, p4=128MB as ext3
2) Get the highest block number of your device
Code:

sfdisk -l /dev/mmcblk0 | grep mmcblk | grep -v Empty | tail -n 1 | awk '{print $3;}'
This gives me 974974 (you can have a different number because i calculate the last used bloc)
3) Calculate the highest 256k bloc number
high256k=int((974974+1)/8)*8
Quote:

974974+1=974975
974975/8=121871.88
121871*8=974968
we have a difference of 974974-974968=6 blocs that will be added to the last partition
4) calculate the 4th partition
Quote:

size=128MB=128*1024KB=131072KB=131072/32 blocs=4096 blocs
add 6 blocs
Quote:

4096+6=4102 blocs
we know the end bloc and the size :
Quote:

end bloc=974974
size=4102
let's calculate the beginning bloc :
Quote:

beginning=974974-4102=970872
that is also the end of the 3rd partition
5) calculate the 3rd partition (it's nearly copy and past from 4)
Quote:

size=512MB=512*1024KB=524288KB=524288/32 blocs=16384 blocs
we know the end bloc and the size :
Quote:

end bloc=970872
size=16384
let's calculate the beginning bloc :
Quote:

beginning=970872-16384=954488
you guessed right ! that is also the end of the 2nd partition
6) calculate the 2nd partition (also the same as above)
Quote:

size=8GB=8*1024MB=8192MB=8192*1024KB=8388608KB=838 8608/32 blocs=262144 blocs
we know the end bloc and the size :
Quote:

end bloc=954488
size=262144
let's calculate the beginning bloc :
Quote:

beginning=954488-262144=692344
And yes, that's the end of the 1st partition too
7) calculate the 1st partition (the easiest part)
we know the start and end blocs
Quote:

end bloc=692344
beginning=0 (*)
let's calculate the size :
Quote:

size=692344-0 blocs=692344 blocs
Congratulations ! You just finished the caclulation of your partitions !
One last thing :
the type of partition is c for fat, 82 for swap and 83 for ext3
using sfdisk you just have to give beginning, size and type for each partition
----------------
(*) : I haven't any issue beginning with 0, the default is 1, many says to begin with 64 (losing 2MB)

n900craver 2011-01-18 18:50

Re: Repartition the internal drive
 
heeelp,,i was trying the #3,and when i was doing this code,(sfdisk --no-reread /dev/mmcblk0 < table # change partition table
reboot; exit),, the phone rebooted as it's said but my phone never boots up completely,,it starts booting for like 4seconds,and then it restarts....it never stops rebooting,,,and so i cant restore the system or reflash becoz the computer just recognize it for 3 seconds..any idea sooo plz heeeeeelpp

michaaa62 2011-01-18 19:12

Re: Repartition the internal drive
 
Pull the battery and let it rest for some second, than insert the battery and reboot.

n900craver 2011-01-19 16:09

Re: Repartition the internal drive
 
i have tried this by pulling out the batery for 24hr now but still no solution,,,i cant take it back to where i bought bcoz i bought in Sweden and i live in Holand,,soo any other idea plzzz,,i have tried my best but no way,,it reboots again and again before it even show the password request for the simcard,,sooo plzzzzz

michaaa62 2011-01-19 16:48

Re: Repartition the internal drive
 
Do you have multiboot or backup-menu or bootmenu-n900 installed, then try to start with keyboard switched out. If this is not working for you try to just flash the kernel http://wiki.maemo.org/Updating_the_t...a_FIASCO_image

Good luck

n900craver 2011-01-19 18:43

Re: Repartition the internal drive
 
thxx for ur help,,i had restored the phone ,so nothing was installed except rootsh,, and also PC(my computer) just recognises it for only like 3-4 seconds,then the phone switches off,so it keeps going on and off every 3 seconds,i dont know how i am gonna flash it.thxx i preciate ur help

michaaa62 2011-01-19 21:16

Re: Repartition the internal drive
 
Does it start just by putting the battery in? If not, try to prepare the phone by loading the battery. Also prepare the flasher utility and the fiasco image to be ready to flash the kernel only. The flasher utility could be started before and just waits for the phone, switched off, to be connected.

n900craver 2011-01-19 21:32

Re: Repartition the internal drive
 
Quote:

Originally Posted by michaaa62 (Post 924161)
Does it start just by putting the battery in? If not, try to prepare the phone by loading the battery. Also prepare the flasher utility and the fiasco image to be ready to flash the kernel only. The flasher utility could be started before and just waits for the phone, switched off, to be connected.


i just realised that the Flasher-3.5 does not work on windows 7-64version ,,damn,,

michaaa62 2011-01-19 23:33

Re: Repartition the internal drive
 
Any Debian or Ubuntu Live-CD should do, just keep the flasher utility .deb and the fiasco image on a place with easy access to them.

n900craver 2011-01-20 14:36

Re: Repartition the internal drive
 
am using my friends windows xp sp 3,but i am stuck at suitable USB device not found,waiting,,,do i need any extra driver for the usb,,coz the phone is not detected..thx

michaaa62 2011-01-20 15:11

Re: Repartition the internal drive
 
Does step 7 here make a difference http://wiki.maemo.org/Updating_the_t...rmware#Windows

n900craver 2011-01-20 15:27

Re: Repartition the internal drive
 
no difference

michaaa62 2011-01-20 15:52

Re: Repartition the internal drive
 
No windows knowledge here, sorry. Two more things go through my mind:
Is the battery fully charged? Try to charge it in another phone, may be in a Nokia Store, or an external charger.
Is the fiasco image in the directory, where you run the windows command shell? May be keep the directory as simple as possible.

n900craver 2011-01-20 17:42

Re: Repartition the internal drive
 
am gonna do that

n900craver 2011-01-20 21:23

Re: Repartition the internal drive
 
hh,i really feel exhausted of my phone,,charged and tried again but no promises,,i just cant find any other solution,,feel like i have tried what i can.damn

michaaa62 2011-01-20 22:04

Re: Repartition the internal drive
 
Well you could try some Ubuntu or Debian based Live-CD's! Did you also try to achieve some result with Nokia-Suite?

n900craver 2011-01-21 19:21

Re: Repartition the internal drive
 
i just managed to reflash ma phone since all the fear/stress i have had,,,i just wanted to thx U michaaa62 for the help & ecourage that u provided,,,,thhhxx

n900cracker 2011-01-22 00:21

Re: Repartition the internal drive
 
can someone make a table for 10gb for installing apps,and the rest for MyDocs plzz

michaaa62 2011-01-22 08:11

Re: Repartition the internal drive
 
Quote:

Originally Posted by n900cracker (Post 925783)
can someone make a table for 10gb for installing apps,and the rest for MyDocs plzz

http://talk.maemo.org/showpost.php?p...&postcount=286

tokag 2011-01-26 12:43

Re: Repartition the internal drive
 
I was able repartition my device successfully using "Solution #6: Custom repartitioning from a linux PC" in the http://wiki.maemo.org/Repartitioning_the_flash and my Ubuntu box. I now have 1 gb swap, 10 gb home, and the remainder 20ish gb MyDocs. gnu parted and my n900 fought for a bit when I tried to unmout some of the partitions to allow resizing, however i found that disabling and re-enabling the USB support on the n900 (u key) sever times was able over come this. after gnu parted was able to modify the disk everything went smoothly...well until i disabled r&d mode and tried to reboot. it would only boot to the four dots on the screen then turn off again. a quick reflash of the vanilla was able to fixed this. in conclusion, if you don't mind doing a reflash on your device, this is a relatively painless and easy way to resize your n900's internal flash partitions. hope this helps. if anyone had question, i would be happy to try to provide any assistance possible.

m4r0v3r 2011-02-24 18:02

Re: Repartition the internal drive
 
can't I just use gparted and resize the partitions?

michaaa62 2011-02-24 18:25

Re: Repartition the internal drive
 
Just install multiboot to do it, boot with keyboardt slid out, here you can export your internal memory card read/write and gparted will pick it up.

karatestarfish 2011-03-18 02:01

Re: Repartition the internal drive
 
Hi all,

I searched the thread, but couldn't find anyone with similar problems..

I've repartitioned the flash to give one large /home and a loopback file for usb according to the wiki instructions. It's working well so far, except for 2 problems:
  • mmcblk1p1 is not exported for usb anymore
  • When saving, the file dialog no longer shows an N900 entry for the MyDocs directory or vfat loopback

So I'm guessing something that was changed in the osso-usb-mass-storage-enable.sh file has caused problem 1, but I can't work out what.

Problem 2 is also annoying, because some file dialogs don't give the option to access the full filesystem, so it makes it difficult to save to the /home partition.

Has anyone faced anything like this before? Any ideas where I can start to debug it?

geneven 2011-03-18 03:12

Re: Repartition the internal drive
 
I recall reading somewhere that a misstep would cause MyDocs to be deleted. I don't remember the details, though.

divansantana 2011-04-04 21:17

Re: Repartition the internal drive
 
Hi All,
How have you hacked your phone so you can save to /home/user/* and not MyDocs. The "HildonFileChooserDialog"(I think) only says Nokia N900(/home/user/MyDocs) or Memory Card. I'd like to change this as /home/user is the large ext3 and /home/user/MyDocs is the small vfat partition.

Alternatively I'm thinking of unmount MyDocs and simply mount /home/user/MyDocs/DCIM as the vfat partition, since I only need vfat for camera app I think.

Any thoughts?

kyllerbuzcut 2011-04-04 22:10

Re: Repartition the internal drive
 
lookup 'parted'. that will do all that for you. You just create a bootable cd for your windows pc (or boot straight into linux if you have it) then connect your n900 and resize/repartition etc to your hearts content. Best thing is you wont lose any data. you can keep everything where it is (as long as theres not more stuff in there than the new partition size)

michaaa62 2011-04-05 06:06

Re: Repartition the internal drive
 
Let it be gparted instead of parted!!! Parted is a partition table editor, while gparted is a graphical partition manager, which may help you preserve the content of the partition.

zszabo 2011-04-12 20:58

Re: Repartition the internal drive
 
FWIW (YMMV -- just a heads up!), last time I used gparted together with backupmenu to change partition sizes, the geometry of all attached memory devices (internal 32GB + 8GB microSSD) was changed (from 4H/16S/*C to something like 64H/??S/*C). In addition, every time I ran sfdisk -l, it complained that the starting point of two of the partitions was other than expected.

Linux doesn't "care" about wrong head/sector count (since these are imaginary values in SSD memory anyway), but it does keep complaining (which some people might find annoying). Windows OTOH tends to be more finicky with wrong geometry values, which may or may not affect accessibility (at the worst future moment, probably). I just wanted it fixed because I was having other FS/IO problems at the time and thought the two might be related.

Also, at the time I couldn't think of a good way to return the values to their original settings without losing all data in the process (essentially, doing something like "sfdisk -H4 -S16 /dev/mmcblk0").

I have not tried this again since then, but I wonder if this happened because I used the wrong settings in gparted while modifying the partition sizes (by using cylinder offsets to redefine the boundary points, rather than the other option (whole MiBs?) -- or vice versa).

At any rate, you can fix it all by doing a complete re-flash (which I didn't know at the time, as it happened within the first three weeks after having purchased it).

laasonen 2011-04-15 20:49

Re: Repartition the internal drive
 
Quote:

Originally Posted by mikhmv (Post 481181)
Ok here is my way to convert storage to ext3:
Code:

sudo gainroot
cd /home/user
umount MyDocs
sfdisk -d > sf
nano sf # set 1st partition to 83
sfdisk --force /dev/mmcblk0 < sf
mkfs.ext3 /dev/mmcblk0p1

After this need make normal fstab. I am not sure is it used (fstab) some where on n900 or not but I prefer to have it clear...
You can modify /etc/event.d/rcS-late or /usr/lib/genfstab.awk.
I modified /usr/lib/genfstab.awk.
here my file:
Code:

#!/usr/bin/awk

BEGIN {
        # states so that we don't end up having more than one
        # of home or MyDocs; we can have as many swaps as we find
        __home = 0
        __fat = 0

        print "# autogenerated"
        print "rootfs / rootfs defaults,errors=remount-ro,noatime 0 0"
}

/^\/dev\/mmc/ { start=1 }
start == 1 && $6 == 82 {
        printf "%s none swap sw 0 0\n", $1
}

start == 1 && $6 == 83 && !__home {
        printf "%s /home ext3 %s 0 0\n", "/dev/mmcblk0p2", home_opts
        __home++
}

start == 1 && $6 == 83 && !__fat {
        printf "%s /home/user/MyDocs ext3 %s 0 0\n", "/dev/mmcblk0p1", home_opts
        __fat++
}

For mounting it and make it work need make some small fix in ke-recv. First file probably more simple to just rewrite. This is "/usr/sbin/mmc-mount". I tried to make more universal. It could work now with ext3 and vfat. In case vfat it is require 3 (original amount of parameters) or 4 arguments.
Code:

#!/bin/sh
# $1 - device
# $2 - mount point
# $3 - rw or ro mode for mounting
# $4 - file system vfat or ext3. If it is absent mount vfat.


. /etc/default/mount-opts #load standard parameters for mounting FAT and ext3
#home_opts="rw,noatime,errors=continue,commit=1,data=writeback"
#fat_opts="noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir"

case "$4" in       
        ext3)
                SYS=ext3
                PAR=$home_opts
        ;;
        *)
                SYS=vfat
                PAR="$3,$fat_opts"
        ;;
esac

COMMAND="mount -t $SYS -o $PAR "$1" "$2" > /dev/null"
#echo $COMMAND
eval $COMMAND
#mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null

Second file which need to change is "/usr/sbin/osso-mmc-mount.sh"
Differences is here:

And full file:
Code:

#!/bin/sh
# This file is part of ke-recv
#
# Copyright (C) 2005-2009 Nokia Corporation. All rights reserved.
#
# Author: Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

# Return codes:
# 0 - mounted read-write
# 1 - could not mount
# 2 - mounted read-only

PDEV=$1  ;# preferred device (partition)
MP=$2    ;# mount point

grep "$PDEV " /proc/mounts > /dev/null
if [ $? = 0 ]; then
  logger "$0: $PDEV is already mounted"
  exit 0
fi

if [ ! -d $MP ]; then
  mkdir -p $MP
fi


if ! [ $PDEV = /dev/mmcblk0 -o $PDEV = /dev/mmcblk1 ]; then
  # check the FAT magic number
  PNUM=$(echo $PDEV | sed "s#/dev/mmcblk[01]p##")
  DEV=$(echo $PDEV | sed "s#p[1234]##")
  PID=$(sfdisk -c $DEV $PNUM)
  case "$PID" in
    b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
        logger "$0: $PDEV partition type is '$PID'"
        FSys=vfat
        ;;
    83)
        logger "$0: $PDEV type '$PID' is not FAT32 or FAT16"
        FSys=ext3
        ;;
    *)
        logger "$0: $PDEV type '$PID' is not FAT32 or FAT16 or ext3"
        exit 1
        ;;
  esac
fi

# time limited check
#/sbin/dosfsck -I -n -T 10 $PDEV
#if [ $? != 0 ]; then
#  logger "$0: $PDEV is corrupt, trying to mount it read-only"
#  mmc-mount $PDEV $MP ro $FSys
#  if [ $? = 0 ]; then
#    logger "$0: $PDEV mounted read-only"
#    exit 2
#  else
#    logger "$0: Couldn't mount $PDEV read-only"
#    exit 1
#  fi
#fi

#echo "mmc-mount $PDEV $MP rw $FSys"

mmc-mount $PDEV $MP rw $FSys
RC=$?
logger "$0: mounting $PDEV read-write to $MP, rc: $RC"
#echo $RC

if [ $RC = 0 ]; then
  # create some special directories for user's partition
  if [ "x$MP" = "x/home/user/MyDocs" -a -w $MP ]; then
    # use global folder names
    USERDIRS="/home/user/.config/user-dirs.dirs"
    if [ -f "$USERDIRS" ]; then
      HOME='/home/user'
      source "$USERDIRS"
      mkdir -p "$XDG_DOCUMENTS_DIR"
      mkdir -p "$XDG_PICTURES_DIR"
      mkdir -p "$XDG_MUSIC_DIR"
      mkdir -p "$XDG_VIDEOS_DIR"
      mkdir -p "$NOKIA_CAMERA_DIR"
      if [ "$FSys" = "ext3" ]; then
              #chown -R user:users  "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR"
              chown -R user:users "$MP"
              chmod -R 774 "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR" 
              chmod -R ug+rwX "$MP"         
      fi
     
    else
      # fallback
      for d in .sounds .videos .documents .images .camera; do
        mkdir -p $MP/$d
      done
    fi
    touch $MP
  elif [ "x$MP" = "x/home/user/MyDocs" ]; then
    logger "$0: '$MP' is not writable"
  elif [ "x$MP" = "x/media/mmc1" -a -w $MP ]; then
    # use global folder names
    USERDIRS="/home/user/.config/user-dirs.dirs"
    if [ -f "$USERDIRS" ]; then
      HOME='/home/user'
      source "$USERDIRS"
      mkdir -p "$NOKIA_MMC_CAMERA_DIR"
      if [ "$FSys" = "ext3" ]; then
              #chown -R user:users  "$NOKIA_MMC_CAMERA_DIR"
              chown -R user:users "$MP"
              chmod -R ug+rwX "$MP"
              chmod -R 774 "$NOKIA_MMC_CAMERA_DIR"             
      fi
    fi
  elif [ "x$MP" = "x/media/mmc1" ]; then
    logger "$0: '$MP' is not writable"
  fi
fi

exit $(($RC != 0))

After this modification I have 2gb mounted /home (ext3) and 27gb on /home/user/MyDocs (ext3). Camera is working. When I connect device to computer (linux) /home/user/MyDocs unmounted (on n900) and exposed to notebook. For have possibility edit files on 27Gb partition on computer (linux, ubuntu) need execute (only once):
Code:

sudo addgroup --gid 29999 n900
sudo adduser YourUserName n900

After this you will be able to edit files on device. When you will disconnect device this partition will be remounted on" /home/user/MyDocs". Originally I had problem with files created on notebook. All this files had User and group from user and group on notebook. Now after mounting this partition back to n900 group and owner will be automatically changed to user:users (from n900).

EDIT: modified file "/usr/sbin/osso-mmc-mount.sh" (I didn't change now differences). In new file improved permissions changes for files. It is more comfortable for using with other linux computer. Before last modification some files was read only on computer because my script provide access to files by group (user on n900 and computer different). Now all files will have permissions: rwXrwXnnn (n-don't changed).

Additional information could be found in bug: https://bugs.maemo.org/show_bug.cgi?id=8179
If you would like to have this modification by default in new release you can vote for this bug

I used this to create ext4 partition for MyDocs. Everything went great until I tried to reboot and got in to reboot loop :(

I'm using kernel-power and CSSU. Any ideas?

EMMC works great with ext4 :)

ap_anilshah 2011-08-29 20:11

Re: Repartition the internal drive
 
Oh! my God !
its unbeleaveable.........!!!!!!!
wooooooooooooooooooooooooooooow

I did it in very first attempt. I am very very very relaxed now.

Thankyou so much. You really genius. You made my N900 on the top of all. I don't know how to thank you.......

it works.
T H A N K Y O U S I R !

ryu1 2011-10-05 19:38

Re: Repartition the internal drive
 
I trieed to increase applications memory from 2gb to 10 gb following the instructions from here http://talk.maemo.org/showpost.php?p...&postcount=188
Something went wrong and now i have 18.99 gb in nokia n900 and 77.9 mb memory for installable applications.
The problem is when i try to flash with vanilla i get this error:
C:\Program Files\maemo\flasher-3.5>
C:\Program Files\maemo\flasher-3.5>flasher-3.5.exe -F RX-51_2009SE_10.2010.13-2.
VANILLA_PR_EMMC_MR0_ARM.bin -f
flasher v2.5.2 (Sep 24 2009)

Image 'mmc', size 255947 kB
Version RX-51_2009SE_10.2010.13-2.VANILLA
USB device found found at bus bus-0, device address \\.\libusb0-0001--0x0421-0x0
105.
Found device RX-51, hardware revision 2101
NOLO version 1.4.14
Version of 'sw-release': RX-51_2009SE_20.2010.36-2_PR_MR0
Booting device into flash mode.
Suitable USB device not found, waiting.

When i flash fiasco image it goes ok, but with vanilla i get that error.
What do i have to do now?


All times are GMT. The time now is 19:13.

vBulletin® Version 3.8.8