Posted: Wed Apr 26, 2023 19:12 Post subject: Ext2 USB detected as Ext4
I formatted a 4GB USB flash drive, named it OPT, and plugged it into the USB port of the R7000. In the webgui I could see it was detected, automounted to /opt, though it is recognized as Ext4. I double checked on my computer that it is in fact Ext2. Is this a bug or is something else going on? I'm currently on r47925 (I know, I know..)
Joined: 18 Mar 2014 Posts: 12877 Location: Netherlands
Posted: Wed Apr 26, 2023 19:27 Post subject:
Outdated build indeed
I moved your thread to the appropriate forum, see the forum guidelines.
Ext 2 is compatible with ext4.
Because we are size constraint we only have the ext4 module.
Ergo an ext2 partion is labeled as ext4 but really is/can be ext2.
Joined: 26 Mar 2013 Posts: 1856 Location: Hung Hom, Hong Kong
Posted: Thu Apr 27, 2023 15:27 Post subject: Re: Ext2 USB detected as Ext4
fizikz wrote:
I formatted a 4GB USB flash drive, named it OPT, and plugged it into the USB port of the R7000. In the webgui I could see it was detected, automounted to /opt, though it is recognized as Ext4. I double checked on my computer that it is in fact Ext2. Is this a bug or is something else going on? I'm currently on r47925 (I know, I know..)
ext3 is ext2 with journalling support! ext4 is a better ext3... not so sure about its backward compatiboiity to ext2.
Now, to avoid the gparted bug where ext2 partitions are erroneously reported as ext4 by DD-WRT I'm using MiniTool Partition Wizard to partition the drive.
Now, to avoid the gparted bug where ext2 partitions are erroneously reported as ext4 by DD-WRT I'm using MiniTool Partition Wizard to partition the drive.
Wow interesting! Confusing though, since my computer recognizes the ext2 formatted drive as ext2.
MiniTool Partition Wizard seems to be a Windows-only tool, so that's inconvenient. I might try formatting to ext2 with another linux tool other than gparted. In any case, if there is no harm other than the reporting of the filesystem I'll probably just live with it.
Out of curiosity I reformatted the USB drive to ext2 with mkfs and it still shows up as ext4 in dd-wrt. Oh well, not sure I'm curious enough to try Windows
Joined: 26 Mar 2013 Posts: 1856 Location: Hung Hom, Hong Kong
Posted: Mon May 08, 2023 15:06 Post subject:
fizikz wrote:
Out of curiosity I reformatted the USB drive to ext2 with mkfs and it still shows up as ext4 in dd-wrt. Oh well, not sure I'm curious enough to try Windows
Exact command used:
Code:
sudo mkfs.ext2 -c -v -L OPT /dev/sdb1
Might save some time by using fdisk and other tools to examine the USB partition? I personally don't care about the precision of the detection as long as it works.
But then if the ext4/ext3 partition was detected and mounted as ext2, the journing function might not be effective.... Well...
OTOH, if ext2 was incorrectly detected and mounted as ext4/ext3, would the journalling work? Would it crash? Well....
I tried that now and it still shows ext4 in the webgui.
Interestingly, when issuing that command, mke2fs recognized the existing partition is ext2:
Code:
# mke2fs -t ext2 -L OPT /dev/sda1
mke2fs 1.45.4 (23-Sep-2019)
/dev/sda1 contains a ext2 file system labelled 'OPT'
last mounted on /opt on Wed Dec 31 19:00:29 1969
Proceed anyway? (y,N)
So, no worries, it's just the webgui that is not being specific. It clearly is ext2, and does not have a journal since the has_journal feature is not listed.