Having trouble doing extroot configuration with MicroSD card

I'm trying to follow the extroot guide but I'm using an SD card instead of a USB stick.

First, as it was a freshly bought SD card, I used fdisk to create a single partition on /dev/sda. I then followed instructions to create filesystem (ran mkfs.ext4 /dev/sda1). So far so good.

root@GL-AR750:~# fdisk -l
.....
....

Disk /dev/mtdblock6: 6.1 MiB, 6356992 bytes, 12416 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


Disk /dev/sda: 31.3 GiB, 33555480576 bytes, 65538048 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: 0xcf08c09e

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 65538047 65536000 31.3G 83 Linux
root@GL-AR750:~# fdisk -l /dev/sda
Disk /dev/sda: 31.3 GiB, 33555480576 bytes, 65538048 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: 0xcf08c09e

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 65538047 65536000 31.3G 83 Linux

However, I can't get the device to show up in block info, nor can I mount it.

root@GL-AR750:~# fdisk -l
....

Disk /dev/mtdblock6: 6.1 MiB, 6356992 bytes, 12416 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


Disk /dev/sda: 31.3 GiB, 33555480576 bytes, 65538048 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: 0xcf08c09e

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 65538047 65536000 31.3G 83 Linux


root@GL-AR750:~# block info
/dev/mtdblock5: UUID="79f0fec2-99eb91d6-619024b5-44b54a35" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"


root@GL-AR750:~# mount /dev/sda1 /mnt
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mount: mounting /dev/sda1 on /mnt failed: Invalid argument
root@GL-AR750:~# mount -t ext4 /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: Invalid argument

I tried rebooting, changing mount directory, etc. I also tried to format /dev/sda directly, without partition and when mounting it I was also getting "The device '/dev/sda' doesn't seem to have a valid NTFS.".

I must be doing something wrong but I'm not sure what.

opkg list-installed | grep -E '(sd|kmod-fs|usb|scsi|block|blk)'
root@GL-AR750:~# opkg list-installed | grep -E '(sd|kmod-fs|usb|scsi|block|blk)'
blkid - 2.29.2-1
block-mount - 2017-06-30-bdcb075f-1
kmod-fs-exfat - 4.4.92+2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3-1
kmod-fs-ext4 - 4.4.92-1
kmod-fs-ntfs - 4.4.92-1
kmod-fs-vfat - 4.4.92-1
kmod-scsi-core - 4.4.92-1
kmod-sdhci - 4.4.92-1
kmod-usb-acm - 4.4.92-1
kmod-usb-core - 4.4.92-1
kmod-usb-net - 4.4.92-1
kmod-usb-net-cdc-ether - 4.4.92-1
kmod-usb-net-cdc-ncm - 4.4.92-1
kmod-usb-net-huawei-cdc-ncm - 4.4.92-1
kmod-usb-net-ipheth - 4.4.92-1
kmod-usb-net-qmi-wwan - 4.4.92-1
kmod-usb-net-rndis - 4.4.92-1
kmod-usb-net-sierrawireless - 4.4.92-1
kmod-usb-ohci - 4.4.92-1
kmod-usb-serial - 4.4.92-1
kmod-usb-serial-cp210x - 4.4.92-1
kmod-usb-serial-option - 4.4.92-1
kmod-usb-serial-sierrawireless - 4.4.92-1
kmod-usb-serial-wwan - 4.4.92-1
kmod-usb-storage - 4.4.92-1
kmod-usb-uhci - 4.4.92-1
kmod-usb-wdm - 4.4.92-1
kmod-usb2 - 4.4.92-1
libblkid - 2.29.2-1
libusb-1.0 - 1.0.21-1
libusbmuxd - 1.1.0-2
ubusd - 2017-02-18-34c6e818-1
usb-modeswitch - 2017-05-24-453da8e5-1
usbmuxd - 1.1.1-4

On a related note, could the issue be that I partitioned the card with fdisk instead of gdisk?

dmesg | grep -EC1 '(sd|mmc)'
cat /etc/opkg/distfeeds.conf | cut -d' ' -f3 | cut -d'/' -f3 | uniq

Actually, partitioning is not mandatory, so you can skip it:

ls -l /sys/block
mkfs.ext4 -F /dev/sda
block info
1 Like
root@GL-AR750:~# dmesg | grep -EC1 '(sd|mmc)'
[    7.840765] scsi 0:0:0:0: Direct-Access     Generic  STORAGE DEVICE   0233 PQ: 0 ANSI: 0
[    7.977675] sd 0:0:0:0: [sda] 65538048 512-byte logical blocks: (33.6 GB/31.3 GiB)
[    7.986668] sd 0:0:0:0: [sda] Write Protect is off
[    7.991691] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[    7.992924] sd 0:0:0:0: [sda] No Caching mode page found
[    7.998426] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    8.064080] Alternate GPT is invalid, using primary GPT.
[    8.069961]  sda: sda1
[    8.076799] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    8.701068] eth0: link up (100Mbps/Full duplex)
--
[    8.915849] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    8.992975] sdhci: Secure Digital Host Controller Interface driver
[    8.999422] sdhci: Copyright(c) Pierre Ossman
[    9.005358] sdhci-pltfm: SDHCI platform and OF driver helper
[    9.026630] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
--
[   12.421420] random: jshn: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.446317] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.455974] random: ubus: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.517442] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.539462] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.548778] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.576497] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.599152] random: ubusd: uninitialized urandom read (4 bytes read, 68 bits of entropy available)
[   12.617131] procd: - init -
root@GL-AR750:~# cat /etc/opkg/distfeeds.conf | cut -d' ' -f3 | cut -d'/' -f3 | uniq
www.gl-inet.com
1 Like

Ah, that appeared to work!! Strange because I did the same thing before but without the -F parameter. I guess it was important!

root@GL-AR750:~# ls -l /sys/block
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock0 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd0/mtdblock0
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock1 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd1/mtdblock1
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock2 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd2/mtdblock2
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock3 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd3/mtdblock3
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock4 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd4/mtdblock4
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock5 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd5/mtdblock5
lrwxrwxrwx    1 root     root             0 Aug 22 20:11 mtdblock6 -> ../devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd6/mtdblock6
lrwxrwxrwx    1 root     root             0 Jan  1  1970 sda -> ../devices/platform/ehci-platform/usb1/1-1/1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sda
root@GL-AR750:~# block info
/dev/mtdblock5: UUID="79f0fec2-99eb91d6-619024b5-44b54a35" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"
root@GL-AR750:~# mkfs.ext4 -F /dev/sda
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 8192000 4k blocks and 2052000 inodes
Filesystem UUID: 1fbb9ad4-d38d-4e6f-a3f2-1ea79226f892
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

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

root@GL-AR750:~# block info
/dev/mtdblock5: UUID="79f0fec2-99eb91d6-619024b5-44b54a35" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"
/dev/sda: UUID="1fbb9ad4-d38d-4e6f-a3f2-1ea79226f892" VERSION="1.0" TYPE="ext4"
1 Like

Oops, I celebrated to soon. While the device does show up when I do block info, I still can't get it to mount :frowning: :

root@GL-AR750:/# block info
/dev/mtdblock5: UUID="79f0fec2-99eb91d6-619024b5-44b54a35" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"
/dev/sda: UUID="1fbb9ad4-d38d-4e6f-a3f2-1ea79226f892" VERSION="1.0" TYPE="ext4"
root@GL-AR750:/# mount /dev/sda /mnt
NTFS signature is missing.
Failed to mount '/dev/sda': Invalid argument
The device '/dev/sda' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
NTFS signature is missing.
Failed to mount '/dev/sda': Invalid argument
The device '/dev/sda' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mount: mounting /dev/sda on /mnt failed: Invalid argument

I tried rebooting and still same issue. Also tried following:

root@GL-AR750:/# mount -t ext4 /dev/sda /mnt
mount: mounting /dev/sda on /mnt failed: Invalid argument
root@GL-AR750:/# mount -t ext /dev/sda /mnt
mount: mounting /dev/sda on /mnt failed: No such device
umount /dev/sda* /mnt
dd if=/dev/zero of=/dev/sda bs=1M
sync
reboot
ls -l /sys/block
mkfs.ext4 -F /dev/sda
sync
mount -t ext4 /dev/sda /mnt

sda1! the 1 is uber-magical :wink: ( edit: normally... seems my friend @vgaetera 's commands do indeed use sda )

there are known issues with gl-arnet sdcard usage...

https://www.google.com.au/search?&q=openwrt+usbmodeswitch+partition+problem

In particular, usbmodeswitch + 10-mount or similar

and/or

fs libraries

@anon50098793, let's test a simple case with no partition table and no partitions, just a formatted block device.
It works for me this way.

1 Like

Thanks, I will leave it running overnight and see the result tomorrow.

1 Like

So I made a script and let it run for over 12 hours and it's still stuck at dd if=/dev/zero of=/dev/sda bs=1M. Is this normal (it's a 32 GB card)? The command shows up in top: 12190 12188 root D 2224 2% 0% dd if /dev/zero of /dev/sda bs 1M

~# ./vgae.sh
+ umount /dev/sda /mnt
umount: can't unmount /dev/sda: Invalid argument
umount: can't unmount /mnt: Invalid argument
+ dd if=/dev/zero of=/dev/sda bs=1M

I ended up cancelling the dd process which was taking forever and followed the rest of the commands:

+ sync
+ mkfs.ext4 -F /dev/sda
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 8192000 4k blocks and 2052000 inodes
Filesystem UUID: 9fb4ed07-2b26-4fbc-b98a-a4f1cec32532
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

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

+ sync
+ mount -t ext4 /dev/sda /mnt
mount: mounting /dev/sda on /mnt failed: Invalid argument
root@GL-AR750:~#

It is still failing at mount: mounting /dev/sda on /mnt failed: Invalid argument.

Try to upgrade to the latest stable release.
This error may occur when mount version doesn't match mkfs version.