Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_Y_Intel
Employee
5,787 Views

Can I increase the size of the Root '/' partition?

Jump to solution

I keep running out of space on the /dev/root aka '/' partition. I currently have a yocto build system setup so... Is there a way to change the size of the root partition (and shrink the size of /home)?

Or will increasing the size of the root partition break the flashing process some how (I am fine flashing with the dfu-utils)?

-Dan

1 Solution
AT9
Honored Contributor II
1,546 Views

As far as I can see (and I haven't tried this yet, just going to), the partitioning itself is done as an u-boot script after flashing. A list of partitions to be created is in edison-src/device-software/meta-edison-distro/recipes-bsp/u-boot/files/edison.env, "partitions" variable. Rootfs one is set to 512MB there, home is set to "all the rest", so you can just increase rootfs and home will shrink automatically.

And a second part of this is the rootfs image size itself, which is set in the edison-src/device-software/meta-edison-distro/recipes-core/images/edison-image.bb and is also 512MB.

I'm not sure if the flashing process would be able to write smaller image to bigger partition automatically, so I'd rather modify both in sync to make sure.

And then first-install shell script runs upon the first boot and creates filesystems on those partitions. It's not affected by this change unless you change the order of partitions.

UPDATE Oct 06: corrected the path to the image recipe, it was identical to the u-boot recipe (except for the file name), cut'n'paste error.

View solution in original post

39 Replies
Sergio_A_Intel
Employee
1,456 Views

Hi intel_dan,

 

This is a very interesting question, we are looking into it. As soon as we have a response we will get back to you.

 

Regards

Sergio

AT9
Honored Contributor II
1,547 Views

As far as I can see (and I haven't tried this yet, just going to), the partitioning itself is done as an u-boot script after flashing. A list of partitions to be created is in edison-src/device-software/meta-edison-distro/recipes-bsp/u-boot/files/edison.env, "partitions" variable. Rootfs one is set to 512MB there, home is set to "all the rest", so you can just increase rootfs and home will shrink automatically.

And a second part of this is the rootfs image size itself, which is set in the edison-src/device-software/meta-edison-distro/recipes-core/images/edison-image.bb and is also 512MB.

I'm not sure if the flashing process would be able to write smaller image to bigger partition automatically, so I'd rather modify both in sync to make sure.

And then first-install shell script runs upon the first boot and creates filesystems on those partitions. It's not affected by this change unless you change the order of partitions.

UPDATE Oct 06: corrected the path to the image recipe, it was identical to the u-boot recipe (except for the file name), cut'n'paste error.

View solution in original post

Dan_Y_Intel
Employee
1,456 Views

AlexT_Intel thanks for the info, I will give it a try and see what happens.

DHunt5
Valued Contributor I
1,456 Views

Very useful discussion. I have a need for more space on / and would prefer not to have to softlink directories to other partitions, so this is very useful.

I usually do a flashall.sh -b, which has the same effect as doing a recovery then flash, so it's all done in one step (re-partitioning and flashing).

One downside worth noting though, is that increasing the size of the / partition will increase the size of the ext4 file, which takes longer to flash. Not too bad, but takes quite a while with 2Gig plus root partitions

Rgds,

Dave.

Matthias_H_Intel
Employee
1,456 Views

what's the maximum size you can set the rootfs without breaking OTA, ...?

DHunt5
Valued Contributor I
1,456 Views

I think you'd have to increase the size of the vfat partition by the same amount as you've increased the root partition so it still has enough space to pulldown and unpack the update. That has a big downside in that the increase in the vfat partition takes away space from the home partition.

So it's a delicate balance between how big you really need rootfs, and how much space you can afford to loose to the vfat partition for updating...

I'm currently not using OTA updates, though, but I guess if I need to, I'll be looking at ways to shrink the rootfs back down

Matthias_H_Intel
Employee
1,456 Views

I do have my home partition mounted to an SD card. So no issues with that

DHunt5
Valued Contributor I
1,456 Views

I'm using mini-breakout, so no SD card...

Dan_Y_Intel
Employee
1,456 Views

@David_J_Hunt, regarding

 

"I think you'd have to increase the size of the vfat partition by the same amount as you've increased the root partition"

 

I was thinking the same thing, but since I am not doing using OTA updates, I just left it alone.

AT9
Honored Contributor II
1,456 Views

That's true and BTW you need to be careful with that, because OTA reads the images of each partition into memory before flashing using U-Boot's fatload and I guess it may blow up if you try to load rootfs bigger than Edison's ~1GB or RAM. Or at least error out in the middle of teh process leaving the board half-baked

Matthias_H_Intel
Employee
1,456 Views

AlexT_Intel: thanks for the hint.

Also I wasted hours trying to flash on Windows (although it worked some weeks ago).

Finally I decided to move to my Linux workstation in the other room - worked flawlessly there.

So from my experience I'd recommend to use Linux

Dan_Y_Intel
Employee
1,456 Views

I flash on window 7 running inside a VM on my mac!

Matthias_H_Intel
Employee
1,456 Views

tried it on Windows 8 natively.

According to "flashall" everything worked - however, in fact no flashing happened at all.

Besides, on Windows you would require "xfstk-dldr-solo.exe", or "cflasher.exe" to be set up and available to run "flashall --recovery" - the latter probably only internally available, the former - haven't tried to compile xfstk for Windows

MOgle
New Contributor I
632 Views

According to /docs/DOC-23449 this, 640MB.

I have no idea why exactly that number though.

Also, the rest of that post is no longer relevant (AFAIK) since the structure appears to have been changed.

MScar1
Novice
632 Views

Hi,

I did not quite understand where the files to be be edited are located. I am flashing the yocto version suggested in the "getting started" section and in the folder edison-image-rel1-maint-rel1-ww42-14 there is mostly .bin files.

Hardware: Edison and arduino board.

Regards,

Marcello

AAndr36
New Contributor III
632 Views

you need to setup a computer with the yocto build system and intels "sdk" installed to find the files within edison-src/device-software/... and you need a few hours wait time to build your own image

take a look into Edison Board Support Package User Guide

AT9
Honored Contributor II
632 Views

That's right - these files are inside something called Board Support Package (BSP), essentially sources for the OS image. Check out the BSP Build Guide in the Documentation section to get started on this.

EDIT: And by the way, there's documentation in the works right now, which will describe how to run the board with rootfs on the SD card, so if you have the Arduino expansion board or something like SparkFun's SD card Block, you'll be able to increase your rootfs without rebuilding the image. I think that's going to be really helpful for a lot of people. I'll post in this thread when I have more details to share.

AT9
Honored Contributor II
632 Views

Better late than never! It took us a while, but the instructions are now posted - thanks MPayne!

See here:

TWoeh
Novice
632 Views

Hello,

I would just like to confirm a couple of things for the solution to this post with a follow up question.

Step 1 is to edit the rootfs size in the recipes-bsp... directory

cd ~/[path-to-edison-src]/edison-src/device-software/meta-edison-distro/recipes-bsp/u-boot/files

vi edison.env

From here I edit the size of the rootfs from the default 512 MiB to a new desired size (highlighted)

Step 2 is to edit the rootfs image size in the recipes-core directory

cd ~/[path-to-edison-src]/edison-src/device-software/meta-edison-distro/recipes-core/images

vi edison-image.bb

From here I edit the size of the image root size from the default "524288" to what the new size is (in MiB) * 1000 + 1288 (highlighted)

So I did these steps for what I hoped to be a 2 gig root directory, but after I ran the "bitbake edison-src" command and the postBuild.sh script the new flash files were too large for the mini-breakout board's build in memory. It resulted in a 2 gig "edison-image-edison.ext4" file. I changed all the values back to their defaults and it seemed to change the size back down to 536.9MB. It seems like a 2 gig root partition size should be feasible for the mini breakout board, and I don't quite understand why the flash files are as large as they are. Any suggestions?

The last thing I want to confirm is that the "all-the-rest" size for the home is indicated by the "name=home,size=-" variable.

Matthias_H_Intel
Employee
632 Views

First of all: better to start a new thread than posting to an already answered one.

On your questions: How do you try to flash? You would need to run flashall (it used to be with --recovery - might have changed).

My setup which works fine:

$ grep IMAGE_ROOTFS_SIZE device-software/meta-edison-distro/recipes-core/images/edison-image.bb

IMAGE_ROOTFS_SIZE = "2048000"

 

$ cat device-software/meta-edison-distro/recipes-bsp/u-boot/files/edison.env

[...]

partitions=uuid_disk=${uuid_disk};name=u-boot0,start=1MiB,size=2MiB,uuid=${uuid_uboot0};name=u-boot-env0,size=1MiB,uuid=${uuid_uboot_env0};name=u-boot1,size=2MiB,uuid=${uuid_uboot1};name=u-boot-env1,size=1MiB,uuid=${uuid_uboot_env1};name=factory,size=1MiB,uuid=${uuid_factory};name=panic,size=24MiB,uuid=${uuid_panic};name=boot,size=32MiB,uuid=${uuid_boot};name=rootfs,size=2000MiB,uuid=${uuid_rootfs};name=update,size=768MiB,uuid=${uuid_update};name=home,size=-,uuid=${uuid_home};

[...]

 

 

Reply