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