Ext2 USB detected as Ext4

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Wed Apr 26, 2023 19:12    Post subject: Ext2 USB detected as Ext4 Reply with quote
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..)
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Apr 26, 2023 19:27    Post subject: Reply with quote
Outdated build indeed Wink

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.

So no sweat Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Wed Apr 26, 2023 20:09    Post subject: Reply with quote
Great, thanks!

So this is the best type of issue: a non-issue.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Thu Apr 27, 2023 15:27    Post subject: Re: Ext2 USB detected as Ext4 Reply with quote
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.

What Is Ext2/Ext3/Ext4 File System (Linux) Format and What's The Difference - EaseUS
https://www.easeus.com/partition-master/ext2-ext3-ext4-file-system-format-and-difference.html

ext2 ext3 ext4 - Google Search
https://www.google.com/search?q=ext2+ext3+ext4

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Fri Apr 28, 2023 3:21    Post subject: Re: Ext2 USB detected as Ext4 Reply with quote
mwchang wrote:
ext4 is a better ext3... not so sure about its backward compatiboiity to ext2.

What Is Ext2/Ext3/Ext4 File System (Linux) Format and What's The Difference - EaseUS
https://www.easeus.com/partition-master/ext2-ext3-ext4-file-system-format-and-difference.html


From your link Smile :

Quote:
Ext4 is a series of backward-compatible extensions to Ext2.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sat Apr 29, 2023 4:39    Post subject: Re: Ext2 USB detected as Ext4 Reply with quote
fizikz wrote:
From your link Smile :

Quote:
Ext4 is a series of backward-compatible extensions to Ext2.

Thanks! And ext4 supports encryption....

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
egosumumbravir
DD-WRT User


Joined: 19 Jun 2020
Posts: 58

PostPosted: Tue May 02, 2023 7:46    Post subject: Reply with quote
Quote:
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.


https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1273457&highlight=#1273457
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Wed May 03, 2023 0:11    Post subject: Reply with quote
egosumumbravir wrote:
Quote:
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.


https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1273457&highlight=#1273457


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.
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Thu May 04, 2023 20:16    Post subject: Reply with quote
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 Laughing

Exact command used:

Code:
sudo mkfs.ext2 -c -v -L OPT /dev/sdb1
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Mon May 08, 2023 15:06    Post subject: Reply with quote
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 Laughing

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....

filesystems - Reliable way to detect ext2 or ext3 or ext4? - Unix & Linux Stack Exchange
https://unix.stackexchange.com/questions/123009/reliable-way-to-detect-ext2-or-ext3-or-ext4

linux ext4 detected as ext2 - Google Search
https://www.google.com/search?q=linux+ext4+detected+as+ext2

Back to your first post the original question, did you check the output of the "mount" command in addition to what the WEBUI said?

Maybe mkfs.ext2 and mkfs.ext3 in DD-WRT are just aliases of mkfs.ext4? I dunno... Smile
Code:
~# mkfs.ext2 -V
mke2fs 1.47.0 (5-Feb-2023)
        Using EXT2FS Library version 1.47.0
~# mkfs.ext3 -V
mke2fs 1.47.0 (5-Feb-2023)
        Using EXT2FS Library version 1.47.0
~# mkfs.ext4 -V
mke2fs 1.47.0 (5-Feb-2023)
        Using EXT2FS Library version 1.47.0
~# ls /sbin/mkfs* -l
lrwxrwxrwx    1 root     root             6 Apr 20 04:06 /sbin/mkfs.ext2 -> mke2fs
lrwxrwxrwx    1 root     root             6 Apr 20 04:06 /sbin/mkfs.ext3 -> mke2fs
lrwxrwxrwx    1 root     root             6 Apr 20 04:06 /sbin/mkfs.ext4 -> mke2fs
lrwxrwxrwx    1 root     root            14 Apr 20 04:05 /sbin/mkfs.vfat -> ../bin/busybox
~#

Maybe you should check the options of mke2fs .... ext2 is ext3/ext4 without journalling.

linux - Disable journaling on ext4 filesystem partition - Super User
https://superuser.com/questions/516784/disable-journaling-on-ext4-filesystem-partition

Linux: How to disable/enable journaling on an ext4 filesystem - FoxuTech
https://foxutech.com/how-to-disable-enable-journaling/

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Mon May 08, 2023 17:20    Post subject: Reply with quote
Great info!

I checked with
Code:
tune2fs -l /dev/sda1
and the Filesystem features does not include has_journal.

I um.. accidentally enabled journaling with
Code:
tune2fs -O has_journal /dev/sda1
and verified that has_journal was then listed in Filesystem features by tune2fs, then unmounted and removed journaling with
Code:
tune2fs -O ^has_journal /dev/sda1
and again verified that journaling is once again not listed as a feature.

Interestingly, blkid (on dd-wrt) does not give filesystem TYPE info, only LABEL and UUID.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue May 09, 2023 9:58    Post subject: Reply with quote
fizikz wrote:
I checked with
Code:
tune2fs -l /dev/sda1
and the Filesystem features does not include has_journal.

Then I am out of tricks! I am not sure whether the tune2fs and e2fsprogs of Entware have all the options.
Quote:
Interestingly, blkid (on dd-wrt) does not give filesystem TYPE info, only LABEL and UUID.

The blkid of Entware has all the options. The command-line is:
Code:
/opt/bin/blkid -o list


blkid Command Examples in Linux – The Geek Diary
https://www.thegeekdiary.com/blkid-command-examples-in-linux/

Lastly, did you try "mke2fs -t ext2 /dev/sda1" as described at the bottom of the following wiki entry?

How to - Format and Partition External Storage Device - DD-WRT Wiki
https://wiki.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Thu May 11, 2023 1:30    Post subject: Reply with quote
mwchang wrote:
Lastly, did you try "mke2fs -t ext2 /dev/sda1" as described at the bottom of the following wiki entry?

How to - Format and Partition External Storage Device - DD-WRT Wiki
https://wiki.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device


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.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum