Active Topics

 



Notices


Reply
Thread Tools
Posts: 5 | Thanked: 3 times | Joined on Dec 2013 @ cipher
#11
Thanks, Peter. That's an unexpected bummer, but good to know, sooner than later. Guess I'll just have to go ahead and merge p1 and p2 after merging p1 and p3 then (lol), and/or compile that fixed kernel, or use an ugly loopbacked image or whatever. It's always something.
 
Posts: 17 | Thanked: 0 times | Joined on Dec 2013
#12
Originally Posted by liar View Post
Hi,

i kind of hated that on the nokia N9 there are 3 partitions:
Code:
/dev/mmcblkp1 as MyDocs
/dev/mmcblkp2 as /
/dev/mmcblkp3 as /home
and MyDocs is a huge vfat partition which sucks in my opinion.

So i figured out you could use sfdisk to reformat the partitions while running in harmattan (openmode, don't know if that matters, but i think it doesn't) and even use ext3 or something else as partition type for the new partitions you might add. If you dont want to add a partition you can just set the partition type of partition 1 to Linux, will work just as good but i liked to have a small FAT partition for swapping files between operating systems at home, university and so on...

my partition table looks like this now:
Code:
# /sbin/sfdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 1957120 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         16  100015  100000    3200000    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     1760512  1891583  131072    4194304   83  Linux
/dev/mmcblk0p3     1891584  1957119   65536    2097152   83  Linux
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
NOTE that the partition table is out of order, but for me everything works perfectly and i didn't want to touch the rootfs and /home partitions so i'd be safe and don't mess my installation up.

But only the first partition gets registered to a host if connected via usb so i changed /etc/usb-moded/usb-moded.ini to this:
Code:
# cat /etc/usb-moded/usb-moded.ini 
[mountpoints]
mount = /dev/mmcblk0p1,/dev/mmcblk0p4

#you can add more filesystems to the mount option, by making it a comma-seperated list.

[sync]
nofua = 1

[altmount]
mount = /home/user/MyDocs,/mnt

[cdrom]
path = /usr/share/aceso/aceso.iso
timeout = 1
Now i can see both partitions on my desktop if connected via usb. I hope this helps.

to use sfdisk to change the first partition use this command (after devel-su):
Code:
/sbin/sfdisk --no-reread /dev/mmcblk0 -N1
(-N1 makes sure you only edit the first partition)
and to modify the 4 partition use (obviously):
Code:
/sbin/sfdisk --no-reread /dev/mmcblk0 -N4
you have to specify start, size and type after you've executed the command. When editing the first partition start should be 16, size should be something you like (i think the program warns you if you choose a too big size) and the type should be c for W95 FAT32 (LBA).
for the fourth partition for start use the end of the first partition +1 and size again something you like (probably everything that is left) and type can be anything you like, i choose L which automatically uses a Linux type for the partition.

step by step execution should look something like this:
(i created this log after i did the setup on my device so the settings where already there, the sfdisk output should be different for you, partition 4 most likely won't exist yet).
Code:
# /sbin/sfdisk --no-reread /dev/mmcblk0 -N1

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

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/mmcblk0p1         16  100015  100000    3200000    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     1760512  1891583  131072    4194304   83  Linux
/dev/mmcblk0p3     1891584  1957119   65536    2097152   83  Linux
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).

/dev/mmcblk0p1 :16 100000 c
/dev/mmcblk0p1         16  100015  100000    3200000    c  W95 FAT32 (LBA)
New situation:
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/mmcblk0p1         16  100015  100000    3200000    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     1760512  1891583  131072    4194304   83  Linux
/dev/mmcblk0p3     1891584  1957119   65536    2097152   83  Linux
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Do you want to write this to disk? [ynq] y
Successfully wrote the new partition table

Re-reading the partition table ...
BLKRRPART: Device or resource busy
The command to re-read the partition table failed
Reboot your system now, before using mkfs

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
~ # /sbin/sfdisk --no-reread /dev/mmcblk0 -N4

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

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/mmcblk0p1         16  100015  100000    3200000    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     1760512  1891583  131072    4194304   83  Linux
/dev/mmcblk0p3     1891584  1957119   65536    2097152   83  Linux
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).
/dev/mmcblk0p4 :100016 99999999 L
Warning: given size (32891135) exceeds max allowable size (1660496)
/dev/mmcblk0p4 :100016 1660496 L
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
New situation:
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/mmcblk0p1         16  100015  100000    3200000    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     1760512  1891583  131072    4194304   83  Linux
/dev/mmcblk0p3     1891584  1957119   65536    2097152   83  Linux
/dev/mmcblk0p4     100016  1760511  1660496   53135872   83  Linux
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Do you want to write this to disk? [ynq] y
Successfully wrote the new partition table

Re-reading the partition table ...
BLKRRPART: Device or resource busy
The command to re-read the partition table failed
Reboot your system now, before using mkfs

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
Then edit /etc/usb-moded/usb-moded.ini according to your needs. Then reboot the device and hope for the best.

After rebooting you can format the partitions using the mkfs commands, like (after devel-su):
Code:
/sbin/mkfs.vfat /dev/mmcblk0p1
/sbin/mkfs.ext3 /dev/mmcblk0p4
if you want to have it mount your fourth partition if you boot or disconnect the device from usb you need to change your /etc/fstab, i used this:
Code:
# cat /etc/fstab 
rootfs / rootfs defaults,errors=remount-ro,noatime 0 0
/dev/mmcblk0p3 /home ext4 rw,noatime,errors=remount-ro,barrier=1 0 0
/dev/mmcblk0p1 /home/user/MyDocs vfat noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir 0 0
/dev/mmcblk0p4 /mnt ext4 rw,noatime,errors=remount-ro,barrier=1 0 0
ubi0:var /var ubifs noauto,no_chk_data_crc,bulk_read
With that modified program partitions?
 
Ta76eem's Avatar
Posts: 157 | Thanked: 36 times | Joined on Mar 2013
#13
Code:
 ~# /sbin/sfdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 485120 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         16  160511  160496    5135872    c  W95 FAT32 (LBA)
/dev/mmcblk0p2     288512  419583  131072    4194304   83  Linux
/dev/mmcblk0p3     419584  485119   65536    2097152   83  Linux
/dev/mmcblk0p4     160512  288511  128000    4096000   83  Linux
so if I want to lower the size of p4 and increase the size of p1 ...
I should first edit

Code:
/sbin/sfdisk --no-reread /dev/mmcblk0 -N4
then edit this one ?
Code:
/sbin/sfdisk --no-reread /dev/mmcblk0 -N1
__________________
it is ok to go Sailing
but it is Forbidden to leave MeeGo on shore
 
coderus's Avatar
Posts: 6,131 | Thanked: 11,564 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#14
would it better for you to export partitions to pc and use gparted for re-partition? seems you can easily broke your partition table here
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 
Ta76eem's Avatar
Posts: 157 | Thanked: 36 times | Joined on Mar 2013
#15
gparted isn't available on windows , can't I just use terminal with this method ?
__________________
it is ok to go Sailing
but it is Forbidden to leave MeeGo on shore
 
Community Council | Posts: 4,377 | Thanked: 10,845 times | Joined on May 2012 @ Southerrn Finland
#16
Originally Posted by Ta76eem View Post
gparted isn't available on windows , can't I just use terminal with this method ?
Of course you can edit the partition table with fdisk, but for many people using graphical UI is easier.
Mind you, even as it in theory is is possible to do when running Harmattan I sure recommend you to boot to maintanance mode to do it.
 

The Following User Says Thank You to juiceme For This Useful Post:
Alecsandru's Avatar
Posts: 440 | Thanked: 281 times | Joined on Oct 2012
#17
Originally Posted by Ta76eem View Post
gparted isn't available on windows , can't I just use terminal with this method ?
you can use gparted on windows with virtualbox
safe and clean
__________________
N900 Beast featuring :
8GB OPTFS@ext4(*performance mount options)
overclock: cpu[125 - 1,150(*VDD1)+Dsp overclock
CSSU-T latest version
 

The Following User Says Thank You to Alecsandru For This Useful Post:
peterleinchen's Avatar
Posts: 3,327 | Thanked: 6,230 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#18
If you know what to do, this could be done on device during harmattan runtime (I did it a few times).
For sure juiceme's advice is right, but you may screw the same way.

So go ahead if you know terminal and sfdisk. But before make a Backup
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
coderus's Avatar
Posts: 6,131 | Thanked: 11,564 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#19
@Ta76eem use gparted in LiveCD/LiveUSB. It's better choice
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Ta76eem's Avatar
Posts: 157 | Thanked: 36 times | Joined on Mar 2013
#20
thanks all , but one last question ... Do I need to flash moslo kernel or any other kernel to use gparted or I just need to plug my N9 to my laptop and launch gparted ?
__________________
it is ok to go Sailing
but it is Forbidden to leave MeeGo on shore
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:44.