Welcome! Log In Create A New Profile

Advanced

mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument

Posted by wsdickerson 
mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 02:53PM
I have a pink POGO-E02. I haven't used it except I tried to install Linux years ago. Now I want to try running "homeassistant" (HomeAssistant.io).

Only port 22 is open and I finally guessed the root password I entered. I am trying to mount a USB drive.

mount /dev/sdb1 /tmp/usb_stick: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument

I just formatted it on my Linux PC.

fdisk -l

/dev/sdb1 1 584 3926016 c Win95 FAT32 (LBA)

ls -l /

drwxr-xr-x 2 root root 0 Nov 4 2009 bin
drwxr-xr-x 5 root root 0 Feb 26 2008 dev
drwxr-xr-x 5 root root 0 Dec 23 2013 etc
drwxr-xr-x 2 root root 0 Nov 4 2009 lib
lrwxrwxrwx 1 root root 11 Nov 4 2009 linuxrc -> bin/busybox
drwxr-xr-x 2 root root 0 Dec 18 2008 mnt
dr-xr-xr-x 41 root root 0 Jan 1 1970 proc
drwxr-xr-x 2 root root 0 Dec 23 2013 root
drwxr-xr-x 2 root root 0 Nov 4 2009 sbin
drwxr-xr-x 10 root root 0 Jan 1 1970 sys
drwxrwxrwt 5 root root 120 Jan 15 06:39 tmp
-rw-r--r-- 1 root root 524288 Dec 23 2013 uboot-original-mtd0.kwb
drwxr-xr-x 7 root root 0 Apr 9 2012 usr
lrwxrwxrwx 1 root root 8 Nov 4 2009 var -> /tmp/var

ls -l /tmp

-rw-r--r-- 1 root root 30 Jan 15 03:01 resolv.conf
drwxr-xr-x 2 root root 40 Jan 15 06:39 touro
drwxrwxrwx 2 root root 40 Jan 15 06:24 usb_stick
drwxr-xr-x 2 root root 40 Jan 1 00:00 var

cat /proc/partitions
major minor #blocks name

31 0 1024 mtdblock0
31 1 4096 mtdblock1
31 2 32768 mtdblock2
31 3 93184 mtdblock3
8 0 1953514492 sda
8 1 1953512448 sda1
8 16 3928063 sdb
8 17 3926016 sdb1

Why can't I mount the USB drive? Thanks

P.S. I can install a serial connection if necessary.



Edited 1 time(s). Last edit at 06/07/2023 02:55PM by wsdickerson.
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 03:14PM
wsdickerson,

> mount /dev/sdb1 /tmp/usb_stick: mounting
> /dev/sdb1 on /tmp/usb_stick failed: Invalid
> argument

Sounds like you are still running stock OS. See here for how to install latest Debian kernel and U-Boot.

Stock OS is quite old and limited, so it is quite possible that it does not support FAT32

Quote

/dev/sdb1 1 584 3926016 c Win95 FAT32 (LBA)

While in stock OS command line, run
uname -a
lsblk
lsmod
to see if any file system driver is running.

=====

But you'll be happier with a modern Linux kernel and u-boot. Connect serial console (optional) and install. While installing u-boot, don't reboot if you see anything different from what described in the installation steps. And post the error here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 03:45PM
Linux Pogoplug 2.6.22.18 #81 Tue Oct 19 16:05:00 PDT 2010 armv5tejl unknown
lsblk: command not found
lsmod: Module Size Used by Not tainted

What filesystem would be supported?
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 03:55PM
> What filesystem would be supported?

Try using Ext3.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 05:35PM
I had trouble with mke2fs but finally formatted it with gparted and the Pogoplug mounted it.

Thanks!
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 07:34PM
Latest action: I downloaded Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

Earlier:

I replaced wget in the script with /tmp/wget that supports https but I am getting SSL failures.

Should I follow the following procedure instead?

You would save a lot of time and bandwidth by using Bodhi's procures for upgrading the rootfs/kernel and u-boot by following the instructions.

http://forum.doozan.com/read.php?3,12381 and http://forum.doozan.com/read.php?2,12096";;;.




Edited 1 time(s). Last edit at 06/07/2023 08:19PM by wsdickerson.
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 09:54PM
I posted above:

Quote

See here for how to install latest Debian kernel and U-Boot.

https://forum.doozan.com/read.php?3,135359,135361#msg-135361

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 07, 2023 10:02PM
Your box is Pogo E02 so make sure you use the Pogo E02 u-boot:

uboot.2017.07-tld-1.pogo_e02.bodhi.tar

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 06:43PM
I have performed the following:

https://forum.doozan.com/read.php?3,134562,134565#msg-134565
* Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (Bitly short link, use this if you can)
* 1. gparted - Format a new USB drive with a single Ext3 partition, and label it rootfs. If you are running the latest U-Boot for Kirkwood then you can use Ext4. But be aware that Ext4 file system format needs to be "finalized" before it can be used for booting.
* 2. Mount the drive on a Linux box. cd to top level directory and extract it. It is assuming the USB drive is mounted at /media/sdb1
** cd /media/sdb1
** tar -xjf Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2
* 3. Adjust fstab (optional).
** Edit /media/sdb1/etc/fstab entry for root device to match the rootfstype of your rootfstype if you use Ext4 or Ext2. However, you can keep it as is without problem in booting since the kernel will figure out which file system the rootfs was formatted.
** (already has): LABEL=rootfs / ext3 noatime,errors=remount-ro 0 1


I downloaded uboot.2017.07-tld-1.pogo_e02.bodhi.tar.

What is the next step? (Step 4? or https://forum.doozan.com/read.php?3,12381 "Flashing Instructions"?)

I have not done a cold boot.
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 07:08PM
> ** cd /media/sdb1
> ** tar -xjf
> Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2

Were you the root user while doing the above?

> uboot.2017.07-tld-1.pogo_e02.bodhi.tar.
>
> What is the next step? (Step 4? or
> https://forum.doozan.com/read.php?3,12381
> "Flashing Instructions"?)
>
> I have not done a cold boot.

Do all the steps in the u-boot installation:

https://forum.doozan.com/read.php?3,12381

And with this box, be extra careful. Because the UART booting (recovery mechanism) is not available. If the flashing went bad, you can only use JTAG to recover.

So do the u-boot installation, and post the log of what you did here. Don't reboot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 08:28PM
Continued...

ssh root@pogoplug

NO: fw_setenv, NO: fw_printenv, NO: flash_erase, YES: nandwrite

    tar zxf linux-tools-installation-bodhi.tar.gz
    moved tools directory to USB stick
    on Pogoplug: mounted and moved tools to /tmp
    cd /tmp/tools;ln -s fw_printenv fw_setenv

cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size      Number of sectors
/dev/mtd0               0xc0000         0x20000         0x20000

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "root"
mtd3: 05b00000 00020000 "data"

/tmp/tools$ ./fw_printenv ethaddr
* ethaddr=00:25:31:02:22:44

nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
* -rw-r--r--    1 root     root       524288 Jan 16 12:41 mtd0

./fw_printenv > current_envs.txt

dmesg | grep -i 'bad' (nothing found)

=====
moderator edit: please use code tags (formatted code button) to post log.



Edited 1 time(s). Last edit at 06/08/2023 09:39PM by bodhi.
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 09:38PM
wsdickerson,

It's hard to read the way you post log. Can you just copy/paste what's on your SSH terminal here?

Everything seems OK. Please proceed to the next step.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 10:07PM
Pogoplug:/tmp$ tar -xf /tmp/usb_stick/uboot.2017.07-tld-1.pogo_e02.bodhi.tar
Pogoplug:/tmp$ ls -l
drwxr-xr-x    2 root     root           40 Jan 15 10:24 debian
-rwxr-xr-x    1 root     root        18406 Jan 15 10:24 install_uboot_mtd0.sh
-rwxr-xr-x    1 root     root        11194 Jan 15 11:44 kirkwood.debian-wheezy.sh
-rw-r--r--    1 root     root           30 Jan 16 03:01 resolv.conf
drwxr-xr-x    2 1000     900           240 Jan 16 12:44 tools
drwxr-xr-x    2 root     root           40 Jan 15 06:39 touro
-rw-r--r--    1 root     root       524288 Jan 15 11:45 uboot-mtd0-dump
-rw-r--r--    1 root     root       524288 Sep  5  2017 uboot.2017.07-tld-1.pogo_e02.mtd0.kwb
drwxr-xr-x   21 root     root         4096 Jun  9  2023 usb_stick
drwxr-xr-x    2 root     root           40 Jan  1 00:00 var
-rwxr-xr-x    1 root     root      2186766 Jan 15 10:29 wget
Pogoplug:/tmp$ tools/flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete

Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 10:34PM
Pogoplug:/tmp$ tar -xf /tmp/usb_stick/uboot.2017.07-tld-1.pogo_e02.bodhi.tar
Pogoplug:/tmp$ ls -l
drwxr-xr-x    2 root     root           40 Jan 15 10:24 debian
-rwxr-xr-x    1 root     root        18406 Jan 15 10:24 install_uboot_mtd0.sh
-rwxr-xr-x    1 root     root        11194 Jan 15 11:44 kirkwood.debian-wheezy.sh
-rw-r--r--    1 root     root           30 Jan 16 03:01 resolv.conf
drwxr-xr-x    2 1000     900           240 Jan 16 12:44 tools
drwxr-xr-x    2 root     root           40 Jan 15 06:39 touro
-rw-r--r--    1 root     root       524288 Jan 15 11:45 uboot-mtd0-dump
-rw-r--r--    1 root     root       524288 Sep  5  2017 uboot.2017.07-tld-1.pogo_e02.mtd0.kwb
drwxr-xr-x   21 root     root         4096 Jun  9  2023 usb_stick
drwxr-xr-x    2 root     root           40 Jan  1 00:00 var
-rwxr-xr-x    1 root     root      2186766 Jan 15 10:29 wget
Pogoplug:/tmp$ tools/flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete
Pogoplug:/tmp$ nandwrite /dev/mtd
mtd0       mtd12      mtd2       mtd6       mtdblock0  mtdblock4
mtd1       mtd13      mtd3       mtd7       mtdblock1  mtdblock5
mtd10      mtd14      mtd4       mtd8       mtdblock2  mtdblock6
mtd11      mtd15      mtd5       mtd9       mtdblock3  mtdblock7
Pogoplug:/tmp$ nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_e02.mtd0.kwb
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Pogoplug:/tmp$ ls -l /tmp/usb_stick/boot
-rw-r--r--    1 root     root      4403336 Aug  1  2021 System.map-5.13.6-kirkwood-tld-1
-rw-r--r--    1 root     root       183927 Aug  1  2021 config-5.13.6-kirkwood-tld-1
drwxr-xr-x    2 root     root         4096 Aug  1  2021 dts
-rw-r--r--    1 root     root      9671027 Sep 24  2021 initrd.img-5.13.6-kirkwood-tld-1
-rw-r--r--    1 root     root      7762080 Aug  1  2021 linux-headers-5.13.6-kirkwood-tld-1_1.0_armel.deb
-rw-r--r--    1 root     root      5435888 Sep 24  2021 uImage
-rw-r--r--    1 root     root      9671091 Sep 24  2021 uInitrd
-rwxr-xr-x    1 root     root      5435824 Aug  1  2021 vmlinuz-5.13.6-kirkwood-tld-1
-rwxr-xr-x    1 root     root      5435824 Aug  1  2021 zImage-5.13.6-kirkwood-tld-1

Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 10:57PM
Looks good!

Now onward to step 8 to 11.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 11:09PM
Pogoplug:/tmp$ tar -xf /tmp/usb_stick/uboot.2016.05-tld-1.environment.bodhi.tar
Pogoplug:/tmp$ tools/fw_printenv > current_envs.txt
Pogoplug:/tmp$ /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done
Pogoplug:/tmp$

Pogoplug:/tmp$ mount /dev/sda1 /tmp/usb_stick/
Pogoplug:/tmp$ tar -xf /tmp/usb_stick/uboot.2016.05-tld-1.environment.bodhi.tar
Pogoplug:/tmp$ tools/fw_printenv > current_envs.txt
Pogoplug:/tmp$ /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done
Pogoplug:/tmp$ /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Writing data to block 6 at offset 0xc0000
Pogoplug:/tmp$ tools/fw_setenv mtdparts 'orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)'
Pogoplug:/tmp$ tools/fw_setenv ethaddr '00:25:31:02:22:44'
Pogoplug:/tmp$ fw_setenv uenv_init_devices 'echo Initializing devices...; setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $dev>
-bash: fw_setenv: command not found
Pogoplug:/tmp$ tools/fw_setenv uenv_init_devices 'echo Initializing devices...; setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype i>
Pogoplug:/tmp$ tools/fw_setenv uenv_read 'echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo .>
< $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;'
Pogoplug:/tmp$ tools/fw_setenv uenv_read_disk
Pogoplug:/tmp$ tools/fw_setenv dtb_file '/boot/dts/kirkwood-pogo_e02.dtb'

Pogoplug:/tmp$ tools/fw_printenv
arcNumber=2097
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
machid=0x831
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
usb_ready_retry=15
mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ethaddr=00:25:31:02:22:44
uenv_init_devices=echo Initializing devices...; setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 11:15PM
Cool! you can reboot now.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 08, 2023 11:44PM
I didn't see anything in netconsole but it booted! Thank you!

I see a lot of information in the forum.

I'll probably try HomeAssistant tomorrow.

Thank you!


Linux debian 5.13.6-kirkwood-tld-1 #1.0 PREEMPT Sat Jul 31 22:10:39 PDT 2021 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Sep 25 19:53:59 2021 from 192.168.0.100
debian
192.168.56.12
CloudEngines Pogoplug E02
Linux version 5.13.6-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 8.3.0-6) 8.3.0, GNU ld (GNU Binutils for Debian) 2.31.1) #1.0 PREEMPT Sat Jul 31 22:10:39 PDT 2021
Debian 11.0
Thu Jun 8 21:32:37 PDT 2023 up 4 minutes



Edited 1 time(s). Last edit at 06/08/2023 11:52PM by wsdickerson.
Re: mounting /dev/sdb1 on /tmp/usb_stick failed: Invalid argument
June 09, 2023 12:47AM
> I didn't see anything in netconsole but it booted!

Cool!

netconsole is a bit cumbersome. But it's good if you don't want to connect serial all the time.

There are various versions of netconsole. If you run Ubuntu or the like, install netcat.traditional. It's easier to follow existing examples in this forum with the traditional version.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: