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)

salazar 2010-12-11 10:08

Re: Repartition the internal drive
 
I meant titans post: http://talk.maemo.org/showpost.php?p...1&postcount=66
This is same: http://wiki.maemo.org/Repartitioning_the_flash
These are solution #1
Is this compatible with PR1.3?

salazar 2010-12-11 14:04

Re: Repartition the internal drive
 
Anyone? Look at upper post and answer pls.

salazar 2010-12-12 18:38

Re: Repartition the internal drive
 
Help! My phone rebooted itself when i was doing the solution #1.
It rebooted after this command: cp -a /home/* /mnt # copy contents of /home to large partition.
What should i do? My phone is in confusion.

brahim98 2010-12-27 22:13

Re: Repartition the internal drive
 
I recently managed to repartition nand, emmc and mmc to fit my needs, a simple step by step isn't available. So i decided to include the process i used to do it.
I made a well commented (i hope) step by step tutorial so everyone can follow. The only issue i encountered (and didn't solve) is that when connected to a Pc in mass storage mode, only MyDocs is visible, mmc is not mountable by Pc. Everything else works.
So let's begin
I am using a 8GB mmc, you must adapt numbers for partitions
# the goal is to reach this config :
# nand -> /
# emmc partition 1 (remaining) -> /home/user/MyDocs
# emmc partition 2 (4GB) -> /home
# emmc partition 3 (4GB) -> /usr
# emmc partition 4 (768MB) -> swap
# mmc partition 1 (remaining) -> /media/mmc1
# mmc partition 2 (2GB) -> /var
Edit : no need to customize kernel as stated before
install rootsh or openssh-server (to do it via ssh, if wifi at home)
Code:

sudo gainroot (or ssh as root)
# install nano
Code:

apt-get install nano-opt
# partition /dev/mmcblk1 (tmp)
# n900 seems to mount without asking so some umounts are needed
Code:

umount /dev/mmcblk1p1
# be carefull you must adapt the following numbers
# p1=512MB (backup MyDocs), p2=1GB (backup /home), p3=5.5GB (not used), p4=768MB (swap)
# I made small partitions to speed the formatting process (remember it's temporary partitionned)
Code:

sfdisk /dev/mmcblk1
0 32768 c
32768 16384 83
49152 169472 83
218624 24576 82
y

# sometimes partitions are not resynch'ed so better reboot
Code:

reboot
# format partitions on /dev/mmcblk1
Code:

umount /dev/mmcblk1p1
mkfs.vfat /dev/mmcblk1p1
mkfs.ext3 /dev/mmcblk1p2
mkswap /dev/mmcblk1p4

# parking tmp1 (because of n900 mounting automatically)
Code:

umount /dev/mmcblk1p1
mkdir /media/mmc1/tmp
mount /dev/mmcblk1p1 /media/mmc1/tmp

# move /home/user/MyDocs to tmp1
Code:

mkdir /media/mmc1/MyDocs
umount /dev/mmcblk1p1
mount /dev/mmcblk1p1 /media/mmc1/MyDocs -o rw,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir
cd /home/user
cp -a MyDocs /media/mmc1
umount /dev/mmcblk0p1
mount /dev/mmcblk0p1 /media/mmc1/tmp

# move /home in tmp2
Code:

mkdir /media/mmc1/home
mount /dev/mmcblk1p2 /media/mmc1/home
cd /
cp -a home /media/mmc1

# prepare reboot
Code:

nano -w /etc/event.d/rcS-late
change
Quote:

fstab=/etc/fstab
to
Quote:

fstab=/etc/_fstab
Code:

nano -w /etc/fstab
change
Quote:

/dev/mmcblk0p1 -> /dev/mmcblk1p1
/dev/mmcblk0p2 -> /dev/mmcblk1p2
/dev/mmcblk0p3 -> /dev/mmcblk1p4
Code:

swapoff /dev/mmcblk0p3
swapon /dev/mmcblk1p4
reboot

# repair automatically mounted partitions
Code:

umount /dev/mmcblk0p1
umount /dev/mmcblk1p1
mount /dev/mmcblk1p1
mount /dev/mmcblk0p1 /media/mmc1/tmp

at this point you should have /home, MyDocs and swap on mmc, so emmc can be easily partitionned.

# partition /dev/mmcblk0
Code:

umount /dev/mmcblk0p1
sfdisk /dev/mmcblk0
0 688256 c
688256 131072 83
819328 131072 83
950400 24576 82
y

# sometimes partitions are not resynch'ed so better reboot
Code:

reboot
# format partitions on emmc
Code:

umount /dev/mmcblk0p1
mkfs.vfat /dev/mmcblk0p1
mkfs.ext3 /dev/mmcblk0p2
mkfs.ext3 /dev/mmcblk0p3
mkswap /dev/mmcblk0p4
mount /dev/mmcblk0p1 /media/mmc1/tmp

# restore /home/user/MyDocs
Code:

umount /dev/mmcblk0p1
mount /dev/mmcblk0p1 /media/mmc1/MyDocs -o rw,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir
mount /dev/mmcblk1p1
cd /home/user
cp -a MyDocs /media/mmc1

# prepare reboot
Code:

nano -w /etc/fstab
change
Quote:

/dev/mmcblk1p1 -> /dev/mmcblk0p1
/dev/mmcblk1p2 -> /dev/mmcblk0p2
/dev/mmcblk1p4 -> /dev/mmcblk0p4
Code:

swapoff /dev/mmcblk1p4
swapon /dev/mmcblk0p4
reboot

now you have a system with custom /home (4GB) and MyDocs (20GB) with a 3rd partition unused (4GB).
moving /usr is hard but moving /var is harder and will brick (must reflash) if not done carefully.
Moving /usr and /var can be done in one step (without rebooting between), I prefer going slowly but surely

# partition /dev/mmcblk1 (final)
# ! those numbers must be changed for you
Code:

umount /dev/mmcblk1p1
sfdisk /dev/mmcblk1
0 177664 c
177664 65536 83


y

# sometimes partitions are not resynch'ed so better reboot
Code:

reboot
# format mmc
Code:

umount /dev/mmcblk1p1
mkfs.vfat /dev/mmcblk1p1
mkfs.ext3 /dev/mmcblk1p2
mount /dev/mmcblk1p1 /media/mmc1/tmp

# move /usr
Code:

umount /dev/mmcblk1p1
mount /dev/mmcblk1p1 /media/mmc1/tmp
mkdir /media/mmc1/usr
mount /dev/mmcblk0p3 /media/mmc1/usr
cd /
cp -a usr /media/mmc1

# change partitions' tables
Code:

nano -w /etc/fstab
add
Quote:

/dev/mmcblk0p3 /usr ext3 defaults 0 0
Code:

nano -w /etc/init.d/rcS
add before call of mount_devpts (second occurence of this string)
Quote:

mount /usr || echo "Error mounting /usr"
Code:

reboot
# move /var
Code:

umount /dev/mmcblk1p1
mount /dev/mmcblk1p1 /media/mmc1/tmp
mkdir /media/mmc1/var
mount /dev/mmcblk1p2 /media/mmc1/var
cd /
cp -a var /media/mmc1

# change partition's tables
Code:

nano -w /etc/fstab
add
Quote:

/dev/mmcblk1p2 /var ext3 defaults 0 0
Code:

nano -w /etc/init.d/rcS
add before call of mount_devpts (second occurence of this string)
and before mount /usr
Quote:

mount /var || echo "Erreur montage /var"
rm -rf /var/run/*
Code:

reboot
# remove automatic update
Code:

gconftool -s --type int /apps/hildon/update-notifier/check_interval 2147483647
Now you have changed a phone that can do computers things into a computer than can do phone calls

Good luke and happy hacking

Fabry 2010-12-27 23:15

Re: Repartition the internal drive
 
Have you read this: http://talk.maemo.org/showpost.php?p...&postcount=248

brahim98 2010-12-28 08:03

Re: Repartition the internal drive
 
I didn't know about this method, could have saved me much time, but the tricky part for me was to move /usr and /var loosely discussed by ruskie (I thank him a lot) and an example was given somewhere for n800 (not very usefull for n900). Now that I have moved these directories, I could install sdk (and every software i want) without worrying about rootfs or any partition. Finally, notice that my solution only requires a N900 and fingers.

Fabry 2010-12-29 00:56

Re: Repartition the internal drive
 
Quote:

Originally Posted by brahim98 (Post 905828)
Finally, notice that my solution only requires a N900 and fingers.

Now that gnu parted N900's version exists, even the method I have linked can be done with only a N900 and fingers:)

Of course with a Linux PC is more comfortable and probably faster to do

lalomartins 2011-01-14 14:18

Re: Repartition the internal drive
 
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.

lalomartins 2011-01-15 11:29

Re: Repartition the internal drive
 
Spoke too soon :-D it worked without flaw... until the next reboot. Now it won't boot no matter what. Playing around with rescue disks and whatnot to figure out my next step...

epitaph 2011-01-15 11:41

Re: Repartition the internal drive
 
can u dd mmcblop2 so that i or we can dd it again without danger? or maybe make a .dep file?


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

vBulletin® Version 3.8.8