I am using the Linaro build rootfs - linaro-vivid-alip-qcom-eragon410-arm64.img.gz.
But, when I do a df -h, I am just seeing the partition size as:
/dev/disk/by-partlabel/rootfs 2.0G 1.2G 741M 63% /
I tried to run the resize-helper script, but with that, I am just getting the partition to increase to:
/dev/disk/by-partlabel/rootfs 3.1G 2.0G 1.2G 63% /
instead of 7.1G which is the available eMMC.
I flashed the updated gpt_both0.bin, but still I am seeing the same issue.
Please let me know if I need to change any thing to make use of the remaining eMMC.
based on the information you provide , i am assuming you are not using an image ‘based’ on the linaro release, but not our release directly. You seem to be using the downstream images from eInfochips for Eragon 410c platform. And as the file name seem to indicate it is a very old version based on Ubuntu Vivid. We have added support for automatically resizing the rootfs in the Linaro release in Feb 2016, and we already had switched to Debian at that time.
If the above is correct, please check with eInfochips directly on how to get their image updated to our latest release.
I just wanted to know, that is there any changes that I can do to use the old rootfs i.e. the Ubuntu Vivid ?
I tried to update the gpt_both0.bin with the partition.xml having the rootfs size as 6000000 (in KB) and also tried to change the cmdline arguments to cmdline=“root=/dev/disk/by-partlabel/rootfs rw rootwait console=ttyMSM0,115200n8 blkdevparts=mmcblk0:6G(rootfs)” to the kernel, but neither of this works.
it is not a problem with the GPT which is probably correct. when flashing the GPT table it will fixup the size of the last partition to fit the entire space. So I suppose the partition size is correct if you check with gdisk tool on the board.
the main issue is with the file system itself and how it was generated. At the time this image was built we were using an android tool to create the rootfs image , not the standard linux mkfs tools. and we noticed that the android ‘mkfs’ tool had issues with ‘large’ sizes, and it would prevent the online resizing to work well. There are a bit more details in this commit message when we made the switch to the new tools:
so if you really want to keep your image, you can, but you need to regenerate the rootfs image. Something along these lines should work (on your PC):
1. create the raw image with the original image from einfochips
simg2img <linaro-vivid-xxx.img> linaro-vivid.img
2. loop mount the raw img
mkdir rootfs
mount -o loop linaro-vivid.img ./rootfs
3. create a new rootfs image with the linux mkfs tools and with the content of the original image:
# the size can be small here, we will resize automatically on the first boot.
mkfs.ext4 -L rootfs linaro-vivid-new.img.raw 2G
mkdir rootfs2
mount -o loop linaro-vivid-new.img.raw rootfs2
cp -a rootfs/* rootfs2
4. create the fastboot sparse image
ext2simg -v linaro-vivid-new.img.raw linaro-vivid-new.img
I just typed the command, so there could be a few typos/issues, but you get the idea. on debian/ubuntu you will need to install android-tools-fsutils package.
You can then flash into rootfs linaro-vivid-new.img and let it boot. then you can run the following script on the your board:
It will resize the rootfs to fill up the entire actual partition size. then df -h should report the maximum size…
If it works, please report it to einfochips, so that they properly document that somewhere…
note that the resize-helper script is there in our latest images, and it is executed automatically on first boot. You need to run it only once (per board) after flashing the rootfs image.
But the Step 3, mkfs.ext4 -L rootfs linaro-vivid-new.img.raw 2G
is not working.
I went through the man for mkfs.ext4, and re-arranged the arguments:
sudo mkfs.ext4 rootfs/ -L linaro-vivid-new.img.raw
but I am getting the below error:
mke2fs 1.42.9 (4-Feb-2014)
rootfs/ is not a block special device.
Proceed anyway? (y,n) y
mkfs.ext4: Device size reported to be zero. Invalid partition specified, or
partition table wasn’t reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
sunny@linux:test$ sudo mkfs.ext4 -L rootfs linaro-vivid-new.img.raw 2G
mke2fs 1.42.9 (4-Feb-2014)
Could not stat linaro-vivid-new.img.raw — No such file or directory
The device apparently does not exist; did you specify it correctly?
yes it is working fine for me. linaro-vivid-new.img.raw is a new file that the mkfs.ext4 tool will create. Are you sure that the file does not exist before you run the command?
the ‘-L rootfs’ in the command has nothing to do with the ‘rootfs’ folder actually. it is just a label. In fact you can remove ‘-L rootfs’, it’s optional anyway…
Sorry, but it is still not working. I made the directory as testfs instead of rootfs, since I am already in the directory named rootfs.
Please see the below log:
sunny@linux:rootfs$ simg2img linaro-vivid-alip-qcom-eragon410-arm64.img linaro-vivid.img
sunny@linux:rootfs$ mkdir testfs
sunny@linux:rootfs$ sudo mount -o loop linaro-vivid.img ./testfs
sunny@linux:rootfs$ mkfs.ext4 -v foobar.img 2G
mke2fs 1.42.9 (4-Feb-2014)
Could not stat foobar.img --- No such file or directory
The device apparently does not exist; did you specify it correctly?
sunny@linux:rootfs$ ls
linaro-vivid-alip-qcom-eragon410-arm64.img linaro-vivid.img testfs
sunny@linux:rootfs$ ll
total 2631704
drwxrwxr-x 3 sunny sunny 4096 Dec 2 15:54 ./
drwxrwxr-x 3 sunny sunny 4096 Dec 2 15:32 ../
-rwxrwxr-x 1 sunny sunny 1344689424 Dec 2 12:36 linaro-vivid-alip-qcom-eragon410-arm64.img*
-rw-rw-r-- 1 sunny sunny 2147483648 Dec 2 15:55 linaro-vivid.img
drwxr-xr-x 21 root root 4096 Jan 1 1970 testfs/
sunny@linux:rootfs$
ok… i figured it out… it’s because you are using an old version of mkfs tools. you can replace the mkfs command i put earlier with this set of commands:
I am able to boot with the new filesystem. NOTE: You need to run the resize-helper once the board boots the first time, and then reboot to see the effect.
Just to put all the steps together:
1. create the raw image with the original image from einfochips
simg2img <linaro-vivid-xxx.img> linaro-vivid.img
2. loop mount the raw img
mkdir temp_rootfs
sudo mount -o loop linaro-vivid.img ./temp_rootfs
3. create a new rootfs image with the linux mkfs tools and with the content of the original image:
# the size can be small here, we will resize automatically on the first boot.
sudo dd if=/dev/zero of=foobar.img bs=1M count=2048
sudo mkfs.ext4 -F -L temp_rootfs foobar.img
mkdir rootfs2
mount -o loop foobar.img rootfs2
cp -a temp_rootfs/* rootfs2
4. create the fastboot sparse image
ext2simg -v foobar.img linaro-vivid-new.img
where foobar.img is the raw input image, and linaro-vivid-new.img is the output (ext4) image.