Fortigate 50e - problem with using all disk space

Hello.

I have a problem with my openwrt on Fortigate 50e.

–edited: sorry for aruba image here–

When I upload openwrt-24.10.0-mvebu-cortexa9-fortinet_fg-50e-initramfs-kernel.bin as image.out and run it from RAM I see whole disk.

But when I upgrade to sysupgrade image, it showed me only 21.50MB.

I wanted to install some software but now I don’t have free space. Is there any solution to this problem?

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                  1008.6M    236.0K   1008.3M   0% /tmp
/dev/mtdblock7           21.5M      1.9M     19.6M   9% /overlay
overlayfs:/overlay       21.5M      1.9M     19.6M   9% /
tmpfs                   512.0K         0    512.0K   0% /dev

Currently, the only way I'm able to install and test software is by connecting my device to UPS and using initram image.

I tried this: https://openwrt.org/docs/guide-user/advanced/expand_root but it restarted 2 times and failed to partition my disk.

durring resize:

root@FortiWrt:~# . ./expand-root.sh
root@FortiWrt:~# sh /etc/uci-defaults/70-rootpt-resize
Error: The device /dev/mtd6 is so small that it cannot possibly store a file system or partition table.  Perhaps you selected the wrong device?
Warning: Error fsyncing/closing /dev/mtd6: Invalid argument
[  140.259483] mv88e6085 f14.mdio-mii:n1: left alicast moded state
[  140.318349] mv88e6085 f14.mdio-mii:n1: left pruous mode
[  140.513006] mv88e6085 f104.mdio-mii:n1: Link is
[  140.699614] mv88e6085 f14.mdio-mii:n2: left pruous modede
[  141.025108] mv88e6085 f14.mdio-mii:n3: left pruous modede
[  141.377313] mv88e6085 f14.mdio-mii:n4: left pruous modede
[  141.712626] mvneta f1070thernet ethft allmultimodest mode
[  141.774894] mv88e6085 f104.mdio-mii:n5: left pruous mode
[  142.517292] br-wan: port h2) enteredbled state
[  142.567082] mvneta f1030thernet ethft allmulticmode
[  142.628792] mvneta f10300thernet ethft promiscuode
[  142.817544] mvneta f10340thernet ethft allmulticmode
[  142.876724] mvneta f1034thernet eth2ft promiscuode
[  146.529194] reboot: Restag syset ethnk is Down

and more about disk:

root@FortiWrt:~# lsblk
-ash: lsblk: not found
root@FortiWrt:~# lsblk
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mtdblock0   31:0    0  1.8M  1 disk
mtdblock1   31:1    0   64K  0 disk
mtdblock2   31:2    0   64K  1 disk
mtdblock3   31:3    0   64K  1 disk
mtdblock4   31:4    0   64K  1 disk
mtdblock5   31:5    0    6M  0 disk
mtdblock6   31:6    0   24M  0 disk /rom
mtdblock7   31:7    0 21.5M  0 disk /overlay
mtdblock8   31:8    0    6M  1 disk
mtdblock9   31:9    0   24M  1 disk
mtdblock10  31:10   0   18M  1 disk
mtdblock11  31:11   0   18M  1 disk
mtdblock12  31:12   0   30M  1 disk

This device should have 1GB of flash memory so why is there so little space?

because that's how the vendor partitioned it.

you could try to create a mtd13 containing the remaining flash space, and use as extroot.

1 Like

Where do you get that information? All of the FG/FWF-5X and FG/FWF-3X devices have only 128MB of SPI Flash. Details for your device can be seen from my teardown details at FortiGate FG-50E at WikiDevi.

2 Likes

then OP's mtd post doesn't add up, that's at least 150MB ... ?

1 Like
+---------------------------------------+
|                                       |
|         rootfs (mtdblock6, /rom)      |
|   +-----------------------------------+
|   |                                   |
|   | rootfs_data (mtdblock7, /overlay) |
|   |                                   |
+---+-----------------------------------+
2 Likes

Then is he talking about the device named in his upload?

When I upload openwrt-24.10.3-ath79-generic-aruba_ap-105-initramfs-kernel.bin as image.out and run it from RAM I see whole disk.

I was confused about what the aruba_ap-105 image had to do with a Fortigate 50E.

1 Like

yes, I noticed this too, but ignored it.

Ups…. I worked with aruba a few days ago.

Sorry.

The flash memory chip inside Fortigate is 1Gbit (not 1GB…).

Also, sorry.

Probably memory is divided into 2 parts. Because the bootloader allows to store the main image and backup one.

But I should have more then 20MB.

FYI:

(not merged)

2 Likes

And that is the question:

x
1.80 1048576 1887436.8
64.00 1024 65536
64.00 1024 65536
64.00 1024 65536
64.00 1024 65536
6.00 1048576 6291456
24.00 1048576 25165824
21.50 1048576 22544384
6.00 1048576 6291456
24.00 1048576 25165824
18.00 1048576 18874368
18.00 1048576 18874368
30.00 1048576 31457280
156814541 B
153139.2 kB
149.55 MB

if there is 1Gbit of memory then how is it possible that I have ~150MB of storage.

I will need to open the case and investigate what components are there.

check the chip next to the bar code sticker.

1 Like

If you want to resubmit that patch, I can review and test it. Perhaps a better possibility of it getting merged if I provide a tested by.

2 Likes

MX66L1G45G
3V, 1G-BIT [x 1/x 2/x 4]
CMOS MXSMIO® (SERIAL MULTI I/O)
FLASH MEMORY

same as in the tear down linked to earlier by @RaylynnKnight.

Some partitions must be overlapping, I can't see another explanation.

1 Like

Do you know what other blocks are used for?

Maybe there is a way to repartition it?

root@OpenWrt:~# lsblk
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mtdblock0   31:0    0  1.8M  1 disk
mtdblock1   31:1    0   64K  0 disk
mtdblock2   31:2    0   64K  1 disk
mtdblock3   31:3    0   64K  1 disk
mtdblock4   31:4    0   64K  1 disk
mtdblock5   31:5    0    6M  0 disk
mtdblock6   31:6    0   24M  0 disk
mtdblock7   31:7    0 21.5M  0 disk
mtdblock8   31:8    0    6M  1 disk
mtdblock9   31:9    0   24M  1 disk
mtdblock10  31:10   0   18M  1 disk
mtdblock11  31:11   0   18M  1 disk
mtdblock12  31:12   0   30M  1 disk

hmm…

root@OpenWrt:~# block info
/dev/mtdblock10: TYPE="jffs2"
/dev/mtdblock12: TYPE="jffs2"
/dev/mtdblock6: UUID="985f8bd6-f139e46b-2a1eebac-80d1cce2" VERSION="4.0" TYPE="squashfs"
/dev/mtdblock7: TYPE="jffs2"

root@OpenWrt:~# block detect
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'
root@OpenWrt:~# blkid
/dev/mtdblock1: PTTYPE="dos"
/dev/mtdblock6: BLOCK_SIZE="262144" TYPE="squashfs"

It is still a bit too hard for me.

Maybe it would be a good idea to make a firmware dump from a flash chip. But I will need to get the original Fortigate image first and try to install the firmware once more just to check if this block differs in any way from its current state.

I’m not sure will my ch341a be able to read flash chip on this board. It failed in aruba. Maybe some other device will be required.

Perhaps it is like this:

NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS What is it
mtdblock0   31:0    0  1.8M  1 disk             bootloader
mtdblock1   31:1    0   64K  0 disk             ?
mtdblock2   31:2    0   64K  1 disk             ??
mtdblock3   31:3    0   64K  1 disk             ???
mtdblock4   31:4    0   64K  1 disk             ????
mtdblock5   31:5    0    6M  0 disk             - something for openwrt?
mtdblock6   31:6    0   24M  0 disk /rom        - main rom
mtdblock7   31:7    0 21.5M  0 disk /overlay    - main overlay
mtdblock8   31:8    0    6M  1 disk             - something for backup openwrt?
mtdblock9   31:9    0   24M  1 disk             - initram for openwrt backup
mtdblock10  31:10   0   18M  1 disk             - some jffs2
mtdblock11  31:11   0   18M  1 disk             - who know what
mtdblock12  31:12   0   30M  1 disk             - free space?

It got an USB 3 port, why bother ?
Plug some small flash drive in and use the extroot link you received earlier to extend the flash space.

1 Like

I might need more time than a few hours in the morning before work and a few hours before bed to do this. But that might be the solution.

Anyway, I'd really like to take a dump of this Flash and play around with it using binwalk.

I don’t understand why it have so many blocks. Such waste of storage.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.