USB drive failed to extend?

I am trying to extend the USB drive /overlay on Openwrt 22.03, not sure what is the problem here is that I cannot mount the USB drive, Openwrt has no issue formatting the USB drive to ext4 even though this is a USB version 1.0.

Anything I have missing here?

root@OpenWrt:/overlay#
root@OpenWrt:/overlay# mount /dev/sda /mnt
mount: mounting /dev/sda on /mnt failed: Invalid argument

root@OpenWrt:/overlay# block info
/dev/ubiblock0_0: UUID="d8154536-0714438b-92942e16-d277cf8e" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="f7b26ff4-041c-437f-9411-88f2cb730eb4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda: UUID="33ef4f85-6c3b-4d88-aa0b-e32db5dff0ef" VERSION="1.0" TYPE="ext4"

Kernel Log
[23709.503741] scsi 0:0:0:0: Direct-Access     USB2.0   Flash Disk       2.60 PQ: 0 ANSI: 2
[23709.528016] sd 0:0:0:0: [sda] 8273920 512-byte logical blocks: (4.24 GB/3.95 GiB)
[23709.544379] sd 0:0:0:0: [sda] Write Protect is off
[23709.554070] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[23709.565575] sd 0:0:0:0: [sda] No Caching mode page found
[23709.576319] sd 0:0:0:0: [sda] Assuming drive cache: write through
[23709.594124]  sda:
[23709.602480] sd 0:0:0:0: [sda] Attached SCSI removable disk
[23777.275429] usb 1-2: USB disconnect, device number 5
[23780.991806] usb 1-2: new high-speed USB device number 6 using xhci-mtk
[23781.184606] usb-storage 1-2:1.0: USB Mass Storage device detected
[23781.204764] scsi host0: usb-storage 1-2:1.0
[23782.222738] scsi 0:0:0:0: Direct-Access     USB2.0   Flash Disk       2.60 PQ: 0 ANSI: 2
[23782.243668] sd 0:0:0:0: [sda] 8273920 512-byte logical blocks: (4.24 GB/3.95 GiB)
[23782.259313] sd 0:0:0:0: [sda] Write Protect is off
[23782.268990] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[23782.279778] sd 0:0:0:0: [sda] No Caching mode page found
[23782.290504] sd 0:0:0:0: [sda] Assuming drive cache: write through
[23782.306337]  sda:
[23782.313266] sd 0:0:0:0: [sda] Attached SCSI removable disk
[24104.335879] JBD2: no valid journal superblock found
[24104.345655] EXT4-fs (sda): error loading journal
[24149.472678] JBD2: no valid journal superblock found
[24149.482524] EXT4-fs (sda): error loading journal
[24217.331153] kmodloader: loading kernel modules from /etc/modules.d/*
[24217.350838] uhci_hcd: USB Universal Host Controller Interface driver
[24217.370150] kmodloader: done loading kernel modules from /etc/modules.d/*
[24235.895326] JBD2: no valid journal superblock found
[24235.905154] EXT4-fs (sda): error loading journal
[24276.695360] JBD2: no valid journal superblock found
[24276.705167] EXT4-fs (sda): error loading journal


System log
Sat Oct  1 01:56:41 2022 kern.notice kernel: [23709.503741] scsi 0:0:0:0: Direct-Access     USB2.0   Flash Disk       2.60 PQ: 0 ANSI: 2
Sat Oct  1 01:56:41 2022 kern.notice kernel: [23709.528016] sd 0:0:0:0: [sda] 8273920 512-byte logical blocks: (4.24 GB/3.95 GiB)
Sat Oct  1 01:56:41 2022 kern.notice kernel: [23709.544379] sd 0:0:0:0: [sda] Write Protect is off
Sat Oct  1 01:56:41 2022 kern.debug kernel: [23709.554070] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
Sat Oct  1 01:56:41 2022 kern.err kernel: [23709.565575] sd 0:0:0:0: [sda] No Caching mode page found
Sat Oct  1 01:56:41 2022 kern.err kernel: [23709.576319] sd 0:0:0:0: [sda] Assuming drive cache: write through
Sat Oct  1 01:56:41 2022 kern.info kernel: [23709.594124]  sda:
Sat Oct  1 01:56:41 2022 kern.notice kernel: [23709.602480] sd 0:0:0:0: [sda] Attached SCSI removable disk
Sat Oct  1 01:57:48 2022 kern.info kernel: [23777.275429] usb 1-2: USB disconnect, device number 5
Sat Oct  1 01:57:52 2022 kern.info kernel: [23780.991806] usb 1-2: new high-speed USB device number 6 using xhci-mtk
Sat Oct  1 01:57:52 2022 kern.info kernel: [23781.184606] usb-storage 1-2:1.0: USB Mass Storage device detected
Sat Oct  1 01:57:52 2022 kern.info kernel: [23781.204764] scsi host0: usb-storage 1-2:1.0
Sat Oct  1 01:57:53 2022 kern.notice kernel: [23782.222738] scsi 0:0:0:0: Direct-Access     USB2.0   Flash Disk       2.60 PQ: 0 ANSI: 2
Sat Oct  1 01:57:53 2022 kern.notice kernel: [23782.243668] sd 0:0:0:0: [sda] 8273920 512-byte logical blocks: (4.24 GB/3.95 GiB)
Sat Oct  1 01:57:53 2022 kern.notice kernel: [23782.259313] sd 0:0:0:0: [sda] Write Protect is off
Sat Oct  1 01:57:53 2022 kern.debug kernel: [23782.268990] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
Sat Oct  1 01:57:53 2022 kern.err kernel: [23782.279778] sd 0:0:0:0: [sda] No Caching mode page found
Sat Oct  1 01:57:54 2022 kern.err kernel: [23782.290504] sd 0:0:0:0: [sda] Assuming drive cache: write through
Sat Oct  1 01:57:54 2022 kern.info kernel: [23782.306337]  sda:
Sat Oct  1 01:57:54 2022 kern.notice kernel: [23782.313266] sd 0:0:0:0: [sda] Attached SCSI removable disk
Sat Oct  1 02:03:16 2022 kern.warn kernel: [24104.335879] JBD2: no valid journal superblock found
Sat Oct  1 02:03:16 2022 kern.err kernel: [24104.345655] EXT4-fs (sda): error loading journal
Sat Oct  1 02:04:01 2022 kern.warn kernel: [24149.472678] JBD2: no valid journal superblock found
Sat Oct  1 02:04:01 2022 kern.err kernel: [24149.482524] EXT4-fs (sda): error loading journal
Sat Oct  1 02:05:09 2022 user.info kernel: [24217.331153] kmodloader: loading kernel modules from /etc/modules.d/*
Sat Oct  1 02:05:09 2022 kern.info kernel: [24217.350838] uhci_hcd: USB Universal Host Controller Interface driver
Sat Oct  1 02:05:09 2022 user.info kernel: [24217.370150] kmodloader: done loading kernel modules from /etc/modules.d/*
Sat Oct  1 02:05:27 2022 kern.warn kernel: [24235.895326] JBD2: no valid journal superblock found
Sat Oct  1 02:05:27 2022 kern.err kernel: [24235.905154] EXT4-fs (sda): error loading journal
Sat Oct  1 02:06:08 2022 kern.warn kernel: [24276.695360] JBD2: no valid journal superblock found
Sat Oct  1 02:06:08 2022 kern.err kernel: [24276.705167] EXT4-fs (sda): error loading journal

The drive is improperly formatted. It needs a partition table then format ext4 on sda1, not directly on sda.

1 Like

When i plugged in the USB drive, it is already detected as /dev/sda

root@OpenWrt:/# block info
/dev/ubiblock0_0: UUID="d8154536-0714438b-92942e16-d277cf8e" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="f7b26ff4-041c-437f-9411-88f2cb730eb4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda: UUID="33ef4f85-6c3b-4d88-aa0b-e32db5dff0ef" VERSION="1.0" TYPE="ext4"
root@OpenWrt:/#

root@OpenWrt:/# mkfs.ext4 /dev/sda
mke2fs 1.46.5 (30-Dec-2021)
/dev/sda contains a ext4 file system
        created on Sat Oct  1 01:59:37 2022
Proceed anyway? (y,N) y
Creating filesystem with 1034240 4k blocks and 258560 inodes
Filesystem UUID: 67f332a7-3898-4195-9e61-ec7ff0a04a4b
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
root@OpenWrt:/#

root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                    59.0M    136.0K     58.9M   0% /tmp
/dev/ubi0_1              17.1M      6.8M      9.4M  42% /overlay
overlayfs:/overlay       17.1M      6.8M      9.4M  42% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/ubi0_1              17.1M      6.8M      9.4M  42% /tmp/cproot
root@OpenWrt:/#

fstab

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'

config mount 'rwm'
        option device '/dev/ubi0_1'
        option target '/rwm'

config mount 'overlay'
        option uuid '33ef4f85-6c3b-4d88-aa0b-e32db5dff0ef'
        option target '/overlay'


~

What about:

mount /dev/sda1 /mnt

That's the thing is that the OP did not partition the drive. I've never seen an ext4 file system put directly onto a USB drive as a raw device. In theory it could work, maybe. But there seems to be a problem here.

1 Like

Any suggestion?

I used fdisk to partition from /dev/sda to /dev/sda1, i can see /dev/sha1 now, but i still have no luck to mount it.

root@OpenWrt:~# block info
/dev/ubiblock0_0: UUID="d8154536-0714438b-92942e16-d277cf8e" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="f7b26ff4-041c-437f-9411-88f2cb730eb4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="447ad18c-075d-443c-80d2-82e983efdd7f" VERSION="1.0" TYPE="ext4"

root@OpenWrt:~#
root@OpenWrt:~# mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: Invalid argument
root@OpenWrt:~#

System log
Sat Oct  1 11:37:56 2022 kern.warn kernel: [31992.954591] JBD2: no valid journal superblock found
Sat Oct  1 11:37:56 2022 kern.err kernel: [31992.964446] EXT4-fs (sda1): error loading journal

Kernel Log
[31992.954591] JBD2: no valid journal superblock found
[31992.964446] EXT4-fs (sda1): error loading journal

I still not able to figure it out where goes wrong.... how do i create the partition table before to format ex4 on sda1?

root@OpenWrt:/etc# block info
/dev/ubiblock0_0: UUID="d8154536-0714438b-92942e16-d277cf8e" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="f7b26ff4-041c-437f-9411-88f2cb730eb4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="326D-2282" LABEL="NEW" VERSION="FAT32" TYPE="vfat"
root@OpenWrt:/etc#
root@OpenWrt:/etc# mkfs.ext4 /dev/sda1
mke2fs 1.46.5 (30-Dec-2021)
/dev/sda1 contains a vfat file system labelled 'NEW VOLUME'
Proceed anyway? (y,N) y
Creating filesystem with 1033984 4k blocks and 258560 inodes
Filesystem UUID: 4c338537-98bc-4dfc-9f8d-b3c5691b4b98
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

root@OpenWrt:/etc# block info
/dev/ubiblock0_0: UUID="d8154536-0714438b-92942e16-d277cf8e" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="f7b26ff4-041c-437f-9411-88f2cb730eb4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="4c338537-98bc-4dfc-9f8d-b3c5691b4b98" VERSION="1.0" TYPE="ext4"
root@OpenWrt:/etc#

Run fdisk -l /dev/sda and look for the partition type.

If it is not `Linux'

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1          32 30277631 30277600 14.4G 83 Linux

but something else, eg

Device     Boot Start     End Sectors  Size Id Type
/dev/sda1  *     8192 3944445 3936254  1.9G  b W95 FAT32

run fdisk /dev/sda
Type t and press Enter, then 83 -> Enter and w -> Enter.

root@OpenWrt:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Selected partition 1
Hex code or alias (type L to list all): 83
Changed type of partition 'W95 FAT32' to 'Linux'.

Command (m for help): w
The partition table has been altered.
Syncing disks.
root@OpenWrt:~#

Format the partition one more time and try to mount the drive again.

Hello,
I have the same issue here. Mounting issues with 22.03 in /overlay. (Apologies about the titles).

the drive has been altered to Linux, but the same error still occurs "mount: mounting /dev/sda1 on /mnt failed: Invalid argument"

root@OpenWrt:~# fdisk -l /dev/sda
Disk /dev/sda: 3.95 GiB, 4236247040 bytes, 8273920 sectors
Disk model: Flash Disk
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: 0xa3f5ef4d

Device     Boot Start     End Sectors  Size Id Type
/dev/sda1  *     2048 8273919 8271872  3.9G  c W95 FAT32 (LBA)
root@OpenWrt:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.37.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Selected partition 1
Hex code or alias (type L to list all): 83
Changed type of partition 'W95 FAT32 (LBA)' to 'Linux'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@OpenWrt:~# fdisk -l /dev/sda
Disk /dev/sda: 3.95 GiB, 4236247040 bytes, 8273920 sectors
Disk model: Flash Disk
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: 0xa3f5ef4d

Device     Boot Start     End Sectors  Size Id Type
/dev/sda1  *     2048 8273919 8271872  3.9G 83 Linux
root@OpenWrt:~#

root@OpenWrt:~# mkfs.ext4 /dev/sda1
mke2fs 1.46.5 (30-Dec-2021)
/dev/sda1 contains a ext4 file system
        created on Sat Oct  1 15:16:52 2022
Proceed anyway? (y,N) y
Creating filesystem with 1033984 4k blocks and 258560 inodes
Filesystem UUID: 9a8b4465-952b-44fa-ae99-098e0a2c863f
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

Is the kmod-fs-ext4 kernel module installed?

What is the output of cat /proc/filesystems | grep ext ?

The kmod-fs-ext4 is already installed.

root@OpenWrt:~# cat /proc/filesystems | grep ext
        ext3
        ext2
        ext4
root@OpenWrt:~#

Clear the existing partitioning.

dd if=/dev/zero of=/dev/sda bs=512 count=1

Create a new partition running fdisk /dev/sda

Type n, press Enter and follow the menu.

The default partition type is Linux, so you don't need to change it.

Exit the tool using w (to write the changes).

If it still doesn't work, you should probably try using another USB drive.

1 Like

I think I have to go with "p" in this option, what is the suggested value "1-4" to use?

root@OpenWrt:~# dd if=/dev/zero of=/dev/sda bs=512 count=1
1+0 records in
1+0 records out
root@OpenWrt:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.37.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xb2a86381.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1): 

p, 1, and then use the default values for the rest.