Why does /tmp show only 2GB instead 4GB on my RPi4?

not on partition level.

It's the same flash drive I'm booting from. Just wanted try and test unused space

Edit:

Number  Start (sector)    End (sector)  Size       Code  Name

Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-15523806, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-15523806, default = 15523806) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):

This doesn't add up though ... if there was something on the drive, it wouldn't start at 34.
But I never used gdisk in the past...

You're right even I'm confused lol. It could be becaus I'm using squshfs?

Edit:

Command (? for help): p
Disk /dev/mmcblk0: 15523840 sectors, 7.4 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 91D516BF-494A-4CE1-A99B-46ED0AB8FDC5
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 15523806
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        15523806   7.4 GiB     8300  Linux filesystem

It says Linux Filesystem. Not f2fs. So how can I format it to f2fs using mkfs.f2fs?

Well, seems the whole disk is occupied by a partition, this isn't usually the case for openwrt.

What if you would switch over to MBR ?

okay lemme try all over again

root@OpenWrt:~# gdisk /dev/mmcblk0
GPT fdisk (gdisk) version 1.0.8

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: OK
Backup partition table: OK

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 1

Command (? for help): p
Disk /dev/mmcblk0: 15523840 sectors, 7.4 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): B05BBD4B-FA2D-41FE-B696-C12E648628FD
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 15523806
Partitions will be aligned on 2048-sector boundaries
Total free space is 15179709 sectors (7.2 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            8192          139263   64.0 MiB    0700  Microsoft basic data
   2          147456          360447   104.0 MiB   8300  Linux filesystem

so pick MBR.

Disk /dev/mmcblk0: 15523840 sectors, 7.4 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): B05BBD4B-FA2D-41FE-B696-C12E648628FD
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 15523806
Partitions will be aligned on 2048-sector boundaries
Total free space is 15179709 sectors (7.2 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            8192          139263   64.0 MiB    0700  Microsoft basic data
   2          147456          360447   104.0 MiB   8300  Linux filesystem

Command (? for help):

Command (? for help): n
Partition number (3-128, default 3): 3
First sector (34-15523806, default = 360448) or {+-}size{KMGTP}:
Last sector (360448-15523806, default = 15523806) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

I guess GPT was also correct cuz it says first sector starts from 34

MBR looks a lot better.

GPT showed the whole (8GB ?) disk as already allocated, MBR doesn't.

Didn't reboot so I'm testing out why

best of luck, ZzZz time for me ...

Aight mate talk tomorrow I gotta go to church early so I'll try to fix it asap. Night night :slight_smile:

Gdisk procedure didn't work even with the MBR option. So I went with fdisk

fdisk /dev/mmcblk0

'p' to print the partition table

Command (m for help): p

Disk /dev/mmcblk0: 14.84 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      147456   360447   212992  104M 83 Linux

And, 'n' for a new partition. Then 'w' to save the partition table (or 'q' to quit).
Reboot to take effect.
After, I did mkfs.f2fs /dev/mmcblk0p3 (New partition name will be now mmcblk0p3)
Once formatted to f2fs it should display in the list,

root@OpenWrt:~# block info
/dev/loop0: UUID="1837cd29-dd92-4cbd-a804-9df76076e538" LABEL="rootfs_data" VERSION="1.0" MOUNT="/overlay" TYPE="ext4"
/dev/mmcblk0p1: UUID="24C6-E9AA" LABEL="boot" VERSION="FAT16" MOUNT="/boot" TYPE="vfat"
/dev/mmcblk0p2: UUID="a2272a75-2c287fe4-2a52dc49-247e8828" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mmcblk0p3: UUID="1ed6925e-83b7-42cb-ac22-233f5319dbf0" VERSION="1.14" MOUNT="/sda0" TYPE="f2fs"        <==============

If your new formatted partition doesn't show then restart the fstab service.
With the help of "mount points" in Luci you can name the partition anything. I've named it sda0


Finally, change the partition permission and the owner name like,
chmod 0777 /sda0 && chown -R alan:root /sda0. You're all set. If anyone know how to make a partition on the system disk using gdisk then lemme know.

Start from scratch, create the partitions manually, write the root file system, and kernel file manually, instead of i using the combined image.

I use rufus to install the whole image. How can I do that?

The files you need are in the directory of the combined image..

Dunno how the bootloader is handled though, if there's one.

Can't see how the GPT <> MBR would make any real difference..

I've done similar thing while rooting my Android. In this case idk how to. I'll google it up

You're right there's no practical difference apart from GPT allows more than 4 MBR partitions, and there's a secondary GPT header in case the primary one gets corrupted. I'm just curious if we can use GPT instead MBR..

I guess it's not possible as of now Installing OpenWrt on GPT disk

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