Welcome! Log In Create A New Profile

Advanced

[Pogoplug Mobile] Change/Repartition Internal NAND

Posted by varkey 
[Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 03:15AM
Is it possible to change the partition layout of the internal NAND? By default the rootfs is on a 112 MB mtd4 partition.

Quote

<4>[ 1.060000] Using static partition definition
<5>[ 1.070000] Creating 5 MTD partitions on "nand_mtd":
<5>[ 1.070000] 0x000000000000-0x000000200000 : "u-boot"
<5>[ 1.080000] 0x000000200000-0x000000500000 : "uImage"
<5>[ 1.080000] 0x000000500000-0x000000800000 : "uImage2"
<5>[ 1.090000] 0x000000800000-0x000001000000 : "failsafe"
<5>[ 1.090000] 0x000001000000-0x000008000000 : "root"

Now I want to reduce the size of mtd4 or the root partition to say 30-40 MB and create a new partition with the remaining space all the while preserving the stock Pogoplug OS.
It says "Using static partition definition", but where is this partition layout defined?

If it can be done, could someone please point me in the right direction?
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 03:33AM
Hi Varkey,

The mtd partitions layout is defined in the original uBoot envs. And can be reset as:

# fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)'
# fw_printenv mtdparts
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

If you know the actual size of the rootfs in mtd4 (for example, 72M) then you could define another partition mtd5 by

#fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),72M(root),40M(data)' - does this looks right? :)

Is that what you are thinking? I would think you will have to figure out the actual size of the Pogo rootfs before repartitioning.



Edited 2 time(s). Last edit at 03/15/2013 03:39AM by bodhi.
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 03:55AM
Thanks bodhi, that is exactly what I want.

The default Pogo rootfs uses less than 32 MB, so I was thinking of making the root partition 40 MB and the remaining 72 MB for the 5th data partition.

Now my next question, how do I go about changing the env vars of the stock uBoot. Do we have to install the fw_printenv/fw_setenv binaries and modify the settings file to point to the stock uBoot env location? If yes what is the location of the stock uBoot vars?

I suppose once the 5th partition is defined in the uboot vars, I can simply mount it from the stock Pogo OS. Correct? And modifying the partition layout won't harm the stock pogo OS right, as long as mtd4 has the rootfs files.
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 04:14AM
Varkey,

To change envs on the stock uBoot, you would need blparam instead of fw_printenv/fw_setenv. As described in here:
[Pogoplug Series 4] Booting Debian with Arch Linux ARM uBoot

I have not done this and reserve the existing rootfs, so I can't say. You could nanddump mtd4 in case you need to reflash it back to stock!

-bodhi
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 04:18AM
Ah ok, thanks! blparam, now I remember, its been a while since I used all that.

Will give it a try with a serial adapter handy along with a full nand dump! :P
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
March 15, 2013 04:35AM
varkey Wrote:
-------------------------------------------------------
> Ah ok, thanks! blparam, now I remember, its been a
> while since I used all that.

I knew you've done this before, just need to jog the memory a bit :)
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
July 16, 2014 09:47PM
Hi @varkey,

Did you get anywhere with this? Are you using the stock uboot on your Pogoplug Mobile? Did you end up successfully booting another linux distro from NAND after re-partitioning mtd? Please share. Thanks

gray
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
July 27, 2014 05:32PM
Hi @bohdi,

I was looking to change the partition layout of my PP devices (Dockstar, GoFlexHome, E02 etc...) and this information is great!
I am trying to enlarge the root partition of these devices (set as 32MB) and could not find any information until ... today!

I guess after we installed your new 2014.7 uBoot, we can use the fw_setenv command to change the mtd partition layout, am I correct?

Thanks for sharing your vast knowledge about making our PP devices more interesting and useful.

Slick



Edited 1 time(s). Last edit at 07/27/2014 05:34PM by nnSlick.
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
July 27, 2014 06:37PM
nnSlick,

> I guess after we installed your new 2014.7 uBoot,
> we can use the fw_setenv command to change the mtd
> partition layout, am I correct?

Yes. You can repartition anyway you'd like if you don't care to run stock FW. And after you've installed new U-Boot, always keep the first partition (mtd0) untouched. The rest of NAND can be anyway you'd like, and format them once before writing kernel/rootfs/data on it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 07/27/2014 06:38PM by bodhi.
Re: [Pogoplug Mobile] Change/Repartition Internal NAND
July 27, 2014 08:53PM
Hi @bohdi,

Thanks for your response and advice. I almost forget about formatting before writing.

Will experiment with one of my DockStar.

Slick
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: