Welcome! Log In Create A New Profile

Advanced

Best way for automounting external USB drive(s)

Posted by tcatone 
Best way for automounting external USB drive(s)
March 08, 2020 12:41PM
Hi again - I started a new thread since - really the initial issue is SOLVED!!
https://forum.doozan.com/read.php?3,95949,95949#msg-95949

Thanks for all your help.

To refresh - I have a PogoPlug Pro running Linux debian 4.4.54-oxnas

Now moving on to my current question and learning experience. I am trying to find a way to automatically mount some of my normal USB hard drives. I'd like to get it to be able to auto start and mount upon powerup - like able to run right through a power outage when the power comes back.

I have 1 everyday external hard drive. Then I have 3 other drives that I would like to be able to plug in when I need that data - power cycle and have them auto mounted. I have created directories for them all under /media/ and configured that inside smb.conf as well.

As Bodhi suggested (Thanks!) I installed autofs

Then added this to auto.misc
hammer          -fstype=vfat,rw,uid=1000    :UUID="14F6-3A66"


"hammer" is my everyday drive and I just started with that one.

Then added this line in auto.master
/media  /etc/auto.misc


I also updated fstab to boot the root filesystem by UUID
# <file system>        <dir>         <type>    <options>             <dump> <pass>
UUID=8783521b-738e-4ddf-81a7-c262e09af0e4              /             ext3      noatime,errors=remount-ro              0
      1


But now I get a boot loop/failure - not sure the real terminology - but the PogoPlug light goes Green, then blinking green followed by slow blink amber… then seems to repeat like it is in a boot loop…

Still reading up but any pointers are greatly appreciated!!
Re: Best way for automounting external USB drive(s)
March 08, 2020 06:17PM
tcatone,

1. Don't use auto.misc. Use the proper one: auto.usb

cat /etc/auto.usb
*	-fstype=auto,async,noatime	:/dev/sd&

2. Don't need to change fstab (don't use hardcoded UUID). Keep fstab as it was.

3. Put this in /etc/auto.master

# automount USB at /media
/media   /etc/auto.usb

========

NOTE:

When you use async, you will need to unmount the drive explicitly. If you use sync, access time is slower, but you can just remove the drive and it will automatically unmounted. Take you pick about which is more important (convenience or speed).

*	-fstype=auto,async,noatime	:/dev/sd&

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 08, 2020 07:13PM
Bodhi - thanks for answering. I am learning so much.

Okay - I need a little clarification... slow learner.
Sync is more important (power can be iffy here...)

Can I use uuid for the external drives? That is what was exciting. Since otherwise they are assigned in order they are plugged in?
So can I put this code in /etc/auto.usb
hammer          -fstype=vfat,sync,noatime    :UUID="14F6-3A66"

Will that code automount that drive to /media/hammer? then I can list my other common drives below with their fstype and uuid?

etc/auto.usb doesn't exist. Do I create one - since in master we told it to look for it. Does the file need to have anything else in it? I know it has to have an empty line at the eof.

I feel like I am close...
Thanks
TC



Edited 1 time(s). Last edit at 03/08/2020 07:44PM by tcatone.
Re: Best way for automounting external USB drive(s)
March 08, 2020 07:51PM
tcatone,

Sorry it has been quite a long time ago, I can't remember all the details about autofs. So you are on your own researching this.

=================

I've been using the udev rules approach that I've mentioned before.

Quote

This is a more advance method using udev:

https://forum.doozan.com/read.php?2,24139

I could help you get the udev rules working if autofs does not do everything you need or if it is too difficult to set up.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 08, 2020 08:46PM
Thanks Bodhi,

I will read up on udev tomorrow.

But I did try a little...

I created a file /etc/auto.usb
#test file added by TC - used by autofs to mount hard drives
hammer          -fstype=vfat,sync,noatime    :UUID="14F6-3A66"

and I added this line in auto.master
/media          /etc/auto.usb

BTW - I am expecting a mount of /media/hammer
A power cycle gets me into the boot loop, fail to start situation. I did a boot with the external drive turned off and then once l could ssh in - I powered on the drive. It failed to mount automagically.

I tried
root@debian:~# service restart autofs
restart: unrecognized service
Seemed like it was worth a shot.

Just thought I'd report what I learned. I will pick this up tomorrow.

Thanks as always!! I really appreciate your time.

TC
Re: Best way for automounting external USB drive(s)
March 08, 2020 08:53PM
TC,

Try

/etc/init.d/autofs restart

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 09, 2020 11:02AM
Good morning,

Dinking around with this in my free time. But I thought I'd update what I learned.

To restart autofs - this works great - thanks!
/etc/init.d/autofs restart

I have tried a bunch of different things just to see if any worked.

hammer          -fstype=vfat,sync,noatime    :UUID="14F6-3A66"


/hammer          -fstype=vfat,sync,noatime    :UUID="14F6-3A66"


hammer          -fstype=vfat,sync,noatime    :/dev/sdb3


/hammer          -fstype=vfat,sync,noatime    :/dev/sdb3


I feel really close but none of those worked. I tried building an etc/auto.usb file and that didn't do anything. Just to make sure did it all over again using the built in auto.misc file.

Autofs is doing something - because I can not make sub-directories in the directory it is working in. So when I want to manually mount I have to go elsewhere.

Anyway - going to start my udev study.
Thanks again,
TC
Re: Best way for automounting external USB drive(s)
March 09, 2020 11:09AM
Oh and....

The one thing I really need to learn to fix - I can not boot my pogoplug with any external drives powered up or it boot loops. The only thing I can figure is it gets confused on where the rootfs is located? Is there a primary or first USB slot it looks for it? Maybe I need to plug it in there? I have it in the top one on the back.

Or I was trying uuid labels in fstab... but not sure if I got that to work either. But back then I was probably changing too many variables. But any help on this trick would be appreciated too!

Thanks
TC
Re: Best way for automounting external USB drive(s)
March 09, 2020 01:11PM
Just some more info...

Here is my blkid info for a drive I'd like to mount
/dev/sdb5: LABEL="UserData" UUID="A8EE8F06EE8ECC4E" TYPE="ntfs" PARTUUID="16275324-247c-4670-889b-1e8beb02fa61"

using the following mount commands with UUID or PartUUID's does not work (tried with and without " since I saw it both ways in the various forums) Starting to think there is more to my current problem...

root@debian:~# mount uuid=16275324-247c-4670-889b-1e8beb02fa61 /media/blue
mount: special device uuid=16275324-247c-4670-889b-1e8beb02fa61 does not exist
root@debian:~# mount uuid="16275324-247c-4670-889b-1e8beb02fa61" /media/blue
mount: special device uuid=16275324-247c-4670-889b-1e8beb02fa61 does not exist
root@debian:~# mount uuid="A8EE8F06EE8ECC4E" /media/blue
mount: special device uuid=A8EE8F06EE8ECC4E does not exist

Now this works just fine
root@debian:~# mount /dev/sdb5 /media/blue

There is some proof that autofs is doing something
# mount - results include:
/etc/auto.misc on /misc type autofs (rw,relatime,fd=-1,pgrp=1965,timeout=300,minproto=5,maxproto=5,indirect)

But currently nothing I type into auto.misc results in a drive getting mounted.

Currently reading up on UDEV and Bodhi's post here: https://forum.doozan.com/read.php?2,24139
added the sample file /etc/udev/rules.d/70-automount.rules as shown.

But I am unclear what to do next.
root@debian:/etc/init.d# /etc/init.d/udev restart
[ ok ] Stopping the hotplug events dispatcher: systemd-udevd.
[....] Starting the hotplug events dispatcher: systemd-udevdstarting version 232
. ok
That doesn't result in anything...

Oh one more thing - saw something about usbmount but it must be deprecated and not available anymore.
root@debian:~# apt-get install usbmount
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package usbmount

Learning slowly. Point me to more to read if anyone has a moment.
Bodhi - thanks again for your time. I am sure you are busy.

Thanks
TC



Edited 1 time(s). Last edit at 03/09/2020 01:17PM by tcatone.
Re: Best way for automounting external USB drive(s)
March 09, 2020 02:27PM
Success!!!

I think I rounded the corner on the Autofs way to do this!

Here is the working contents of my /etc/auto.misc file

# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
blue1             -fstype=auto,sync,noatime       UUID=443F7B407388A63B
blue2             -fstype=auto,sync,noatime       UUID=A8EE8F06EE8ECC4E
hitch             -fstype=auto,sync,noatime       UUID=14F6-3A66

And the only uncommented line in my auto.master file is:
/media         /etc/auto.misc --timeout=2,sync,nodev,nosuid

I gleened what I learned from here: http://greenfly.org/tips/autofs.html

It all had to do with what things do and don't have '/' and ';' in front of them. I knew I was close...

Also this code works inside auto.misc if you need to just mount from the dev level

test           -fstype=auto            :/dev/sdb3

You do not need to restart autofs if you only edit auto.misc. But if you do edit auto.master you do have to issue the command:
/etc/init.d/autofs restart


BTW - that 'sync' mount option seems to drop my transfer rate from 3.4 MB/s down to 1.2 MB/s... I will have to look into that and see what I want to do...

Bodhi - thanks so much for sticking with me!

I do still need some way of rebooting sucessfully on power cycle. Any hints on what is happening there?

Thanks again,
TC
Re: Best way for automounting external USB drive(s)
March 09, 2020 04:03PM
Regarding booting, the u-boot needs to know where the root filesystem is located. This can be done a couple of ways, but in any case, AFAIK, it is specified in the firmware environment variables. You can list them with the fw_printenv command.

One of my Oxnas pogos has the value set to sda1 which I think is the first drive recognized. This works fine for this device since it will only have a single USB connected, i.e. the filesystem.

My Kirkwood boxes use the drive label, i.e., rootfs. This works fine also and should be a better fit for your use. In this case, I can boot from either a USB or a hard drive depending on the label. You can also label the drives differently and boot from a preferred drive by setting the environments to sequence as you wish.

Kirkwood (Dell Kace)
set_bootargs_sata=setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
set_bootargs_usb=setenv bootargs console=ttyS0,115200  root=LABEL=rootfs  rootdelay=10 $(mtdparts) earlyprintk=serial

fstab for booting from internal SSD:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
LABEL=sata_rootfs    /               ext3    noatime,errors=remount-ro 0 1
LABEL=data	/mnt/data		ext3	defaults,noatime  0	2
/mnt/data/swapfile1     swap            swap    defaults          0       0
tmpfs          /tmp            tmpfs   defaults          0       0

Oxnas Pogo:
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10

fstab for this pogo:
root@PogoP21:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
LABEL=rootfs      /               ext3    noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0

I don't know why the Oxnas plug is setup with root=/dev/sda1. I think using the label would be better, especially since it is already in fstab.

You should post your environment and we can help you before you try this, as you might not be able to boot without a serial connection if it goes wrong.



Edited 1 time(s). Last edit at 03/09/2020 06:13PM by mikeh49.
Re: Best way for automounting external USB drive(s)
March 09, 2020 05:42PM
tcatone,


> Bodhi - thanks so much for sticking with me!
>
> I do still need some way of rebooting sucessfully
> on power cycle. Any hints on what is happening
> there?
>
> Thanks again,
> TC

Excellent! glad you've figured out the details steps. I'll take a closer look later and will suggest improvement. Hopefully it can become a tutorial for others who look for this subject.

Regarding the boot configuration, I'll make a new post after this.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 09, 2020 05:48PM
TC,

Quote

I do still need some way of rebooting sucessfully on power cycle. Any hints on what is happening there?

At this point I belive it is already set up in your box to boot consistently, no matter how many USB drives you will plug in before power up.

To verify that is the case, post these info:

dmesg
cat /proc/mtd
cat /etc/fstab
cat /etc/fw_env.config
fw_printenv
mount

PS.

What Mike said above was correct. Except that Mike did not complete the whole set up on this OXNAS box.

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



Edited 1 time(s). Last edit at 03/09/2020 05:49PM by bodhi.
Re: Best way for automounting external USB drive(s)
March 09, 2020 09:07PM
Alright be nice - I am new here. Still learning...

Seems I should know what to do with this posting and all but... I am going to just post what I get

my dmesg starts like this...
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.54-oxnas-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #2 SMP PREEMPT Sat Mar 18 23:09:58 PDT 2017
[    0.000000] CPU: ARMv6-compatible processor [410fb025] revision 5 (ARMv7), cr=00c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Pogoplug V3 Classic
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c08a69c0, node_mem_map c7ef9000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map
[    0.000000] PERCPU: Embedded 12 pages/cpu @c7eda000 s17696 r8192 d23264 u49152
[    0.000000] pcpu-alloc: s17696 r8192 d23264 u49152 alloc=12*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda1 rootdelay=10
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 116200K/131072K available (6410K kernel code, 288K rwdata, 1908K rodata, 224K init, 247K bss, 14872K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
                   lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
                   modules : 0xbf000000 - 0xc0000000   (  16 MB)
                     .text : 0xc0008000 - 0xc0827e14   (8320 kB)
                     .init : 0xc0828000 - 0xc0860000   ( 224 kB)
                     .data : 0xc0860000 - 0xc08a8378   ( 289 kB)
                      .bss : 0xc08a8378 - 0xc08e6350   ( 248 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:160
[    0.000000] clocksource: rps_clocksource_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 19112603332 ns
[    0.000010] sched_clock: 24 bits at 390kHz, resolution 2560ns, wraps every 21474835200ns
[    0.000163] Console: colour dummy device 80x30
[    0.000194] Calibrating delay loop... 339.14 BogoMIPS (lpj=1695744)
[    0.050019] pid_max: default: 32768 minimum: 301
[    0.050191] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.050211] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.051015] Initializing cgroup subsys net_cls
[    0.051095] CPU: Testing write buffer coherency: ok
[    0.051520] Setting up static identity map for 0x60008220 - 0x60008258
[    0.190136] Brought up 2 CPUs
[    0.190156] SMP: Total of 2 processors activated (678.29 BogoMIPS).
[    0.190937] devtmpfs: initialized
[    0.196247] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.196293] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.196608] prandom: seed boundary self test passed
[    0.201024] prandom: 100 self tests passed
[    0.201049] pinctrl core: initialized pinctrl subsystem
[    0.201884] NET: Registered protocol family 16
[    0.202424] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.230016] cpuidle: using governor ladder
[    0.260008] cpuidle: using governor menu
[    0.264890] gpio-oxnas 44000000.gpio: at address c8848000
[    0.265300] gpio-oxnas 44100000.gpio: at address c884a000
[    0.265861] pinctrl-oxnas pinctrl: initialized OX820 pinctrl driver
[    0.278714] vgaarb: loaded
[    0.279198] SCSI subsystem initialized
[    0.279539] libata version 3.00 loaded.
[    0.280130] usbcore: registered new interface driver usbfs
[    0.280240] usbcore: registered new interface driver hub
[    0.280391] usbcore: registered new device driver usb
[    0.280591] pps_core: LinuxPPS API ver. 1 registered
[    0.280604] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.280652] PTP clock support registered
[    0.282816] clocksource: Switched to clocksource rps_clocksource_timer
[    0.301585] NET: Registered protocol family 2
[    0.302471] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.302515] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.302551] TCP: Hash tables configured (established 1024 bind 1024)
[    0.302645] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.302686] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.302958] NET: Registered protocol family 1
[    0.303485] RPC: Registered named UNIX socket transport module.
[    0.303505] RPC: Registered udp transport module.
[    0.303518] RPC: Registered tcp transport module.
[    0.303531] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.303567] PCI: CLS 0 bytes, default 32
[    0.303918] Unpacking initramfs...
[    0.779205] Freeing initrd memory: 4492K (c79c6000 - c7e29000)
[    0.780953] Initialise system trusted keyring
[    0.812618] zbud: loaded
[    0.831352] NFS: Registering the id_resolver key type
[    0.831424] Key type id_resolver registered
[    0.831436] Key type id_legacy registered
[    0.831477] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.831503] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.832453] fuse init (API version 7.23)
[    0.834478] Key type big_key registered
[    0.932889] Key type asymmetric registered
[    0.932925] Asymmetric key parser 'x509' registered
[    0.933053] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.933079] io scheduler noop registered
[    0.933096] io scheduler deadline registered
[    0.933158] io scheduler cfq registered (default)
[    0.933790] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.935232] console [ttyS0] disabled
[    0.935329] 44200000.uart: ttyS0 at MMIO 0x44200000 (irq = 6, base_baud = 390625) is a 16550A
[    1.456796] console [ttyS0] enabled
[    1.471695] loop: module loaded
[    1.723614] scsi host0: sata_oxnas
[    1.776862] ata1: SATA max UDMA/133 irq 7
[    1.780968] sata_oxnas: resetting SATA core
[    1.781982] nand: Could not find valid ONFI parameter page; aborting
[    1.782023] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    1.782028] nand: Hynix NAND 128MiB 3,3V 8-bit
[    1.782036] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.782054] Scanning device for bad blocks
[    1.863756] 2 ofpart partitions found on MTD device 41000000.nand
[    1.869824] Creating 2 MTD partitions on "41000000.nand":
[    1.875235] 0x000000000000-0x000000e00000 : "boot"
[    1.881935] 0x000000e00000-0x000008000000 : "data"
[    1.889233] oxnas-gmac 40400000.ethernet: no reset control found
[    1.895255] stmmac - user ID: 0x12, Synopsys ID: 0x35
[    1.900298]  Ring mode enabled
[    1.903336]  DMA HW capability register supported
[    1.907837]  Enhanced/Alternate descriptors
[    1.912184]  Enabled extended descriptors
[    1.916170]  RX Checksum Offload Engine supported (type 2)
[    1.921640]  TX Checksum insertion supported
[    1.925885]  Wake-Up On Lan supported
[    1.929523]  Enable RX Mitigation via HW Watchdog Timer
[    1.950287] libphy: stmmac: probed
[    1.953684] eth%d: PHY ID 001cc914 at 0 IRQ POLL (stmmac-0:00) active
[    1.960115] eth%d: PHY ID 001cc914 at 3 IRQ POLL (stmmac-0:03)
[    1.966807] PPP generic driver version 2.4.2
[    1.971701] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.978214] ehci-pci: EHCI PCI platform driver
[    1.983175] oxnas-ehci 40200100.ehci: EHCI Host Controller
[    1.988677] oxnas-ehci 40200100.ehci: new USB bus registered, assigned bus number 1
[    1.996523] oxnas-ehci 40200100.ehci: irq 10, io mem 0x40200100
[    2.020144] oxnas-ehci 40200100.ehci: USB 2.0 started, EHCI 1.00
[    2.026452] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    2.033249] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.040455] usb usb1: Product: EHCI Host Controller
[    2.045312] usb usb1: Manufacturer: Linux 4.4.54-oxnas-tld-1 ehci_hcd
[    2.051740] usb usb1: SerialNumber: 40200100.ehci
[    2.057387] hub 1-0:1.0: USB hub found
[    2.061250] hub 1-0:1.0: 2 ports detected
[    2.066344] usbcore: registered new interface driver cdc_acm
[    2.072020] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    2.080158] usbcore: registered new interface driver cdc_wdm
[    2.085962] usbcore: registered new interface driver usb-storage
[    2.092157] usbcore: registered new interface driver usbserial
[    2.098019] usbcore: registered new interface driver usbserial_generic
[    2.104619] usbserial: USB Serial support registered for generic
[    2.111080] mousedev: PS/2 mouse device common for all mice
[    2.116805] i2c /dev entries driver
[    2.121615] hidraw: raw HID events driver (C) Jiri Kosina
[    2.127239] usbcore: registered new interface driver usbhid
[    2.132823] usbhid: USB HID core driver
[    2.138641] NET: Registered protocol family 10
[    2.160744] sit: IPv6 over IPv4 tunneling driver
[    2.166346] NET: Registered protocol family 17
[    2.170001] ata1: SATA link down (SStatus 0 SControl 300)
[    2.176675] Key type dns_resolver registered
[    2.182233] registered taskstats version 1
[    2.186355] Loading compiled-in X.509 certificates
[    2.191275] zswap: loaded using pool lzo/zbud
[    2.210585] Key type encrypted registered
[    2.217702] Freeing unused kernel memory: 224K (c0828000 - c0860000)
[    2.390218] usb 1-1: new high-speed USB device number 2 using oxnas-ehci
[    2.406446] random: systemd-udevd: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.417569] random: systemd-udevd: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.418818] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.421340] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.421514] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.422568] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.426542] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.427520] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.428477] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.429555] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.592642] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    2.599331] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.612761] usb 1-1: Product: USB2.0 Hub
[    2.640558] hub 1-1:1.0: USB hub found
[    2.647900] hub 1-1:1.0: 4 ports detected
[    2.940229] usb 1-1.3: new high-speed USB device number 3 using oxnas-ehci
[    3.051548] usb 1-1.3: New USB device found, idVendor=8644, idProduct=8003
[    3.058401] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.065728] usb 1-1.3: Product: USB Flash Disk                
[    3.071572] usb 1-1.3: Manufacturer: General                       
[    3.077811] usb 1-1.3: SerialNumber: 05103700000005AD
[    3.084072] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[    3.090859] scsi host1: usb-storage 1-1.3:1.0
[    3.111306] usbcore: registered new interface driver uas
[    4.091545] scsi 1:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 2
[    4.103600] sd 1:0:0:0: [sda] 7831552 512-byte logical blocks: (4.01 GB/3.73 GiB)
[    4.116295] sd 1:0:0:0: [sda] Write Protect is off
[    4.121574] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[    4.122414] sd 1:0:0:0: [sda] No Caching mode page found
[    4.127726] sd 1:0:0:0: [sda] Assuming drive cache: write through                                                                               
[    4.142384]  sda: sda1
[    4.150632] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   21.621765] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   21.642114] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   23.033912] random: nonblocking pool is initialized
[   25.822786] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[   34.520291] oxnas-gmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   40.520266] oxnas-gmac 40400000.ethernet eth0: Link is Down
[   42.520286] oxnas-gmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[  188.844300] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  188.873105] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  188.879703] Buffer I/O error on dev mtdblock1, logical block 29120, async page read
[  189.126103] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  189.155161] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  189.161756] Buffer I/O error on dev mtdblock1, logical block 29120, async page read
[  368.235445] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  368.538621] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  548.518392] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  548.547584] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  548.554181] Buffer I/O error on dev mtdblock1, logical block 29120, async page read
[  668.194396] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  668.497881] blk_update_request: I/O error, dev mtdblock1, sector 232960
[  668.526694] blk_update_request: I/O error, dev mtdblock1, sector 232960
.
.
Then I deleted a ton of nearly identical statements here...
.
.
 6308.177164] Buffer I/O error on dev mtdblock1, logical block 29120, async page read                                                          
[ 6308.423255] blk_update_request: I/O error, dev mtdblock1, sector 232960                                                                      
[ 6308.452029] blk_update_request: I/O error, dev mtdblock1, sector 232960                                                                      
[ 6308.458626] Buffer I/O error on dev mtdblock1, logical block 29120, async page read                                                          
[ 6323.131504] usb 1-1.4: new high-speed USB device number 4 using oxnas-ehci
[ 6323.323046] usb 1-1.4: New USB device found, idVendor=0bc2, idProduct=ab26
[ 6323.329902] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6323.337658] usb 1-1.4: Product: BUP Slim SL
[ 6323.341952] usb 1-1.4: Manufacturer: Seagate
[ 6323.346204] usb 1-1.4: SerialNumber: NA9Y5C5X
[ 6323.356605] scsi host2: uas
[ 6323.362519] scsi 2:0:0:0: Direct-Access     Seagate  BUP Slim SL      0109 PQ: 0 ANSI: 6
[ 6326.331599] sd 2:0:0:0: [sdb] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
[ 6326.339330] sd 2:0:0:0: [sdb] 4096-byte physical blocks
[ 6326.348986] sd 2:0:0:0: [sdb] Write Protect is off
[ 6326.354019] sd 2:0:0:0: [sdb] Mode Sense: 53 00 00 08
[ 6326.354954] sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 6326.401387]  sdb: sdb1 sdb2 sdb3 sdb4
[ 6326.412702] sd 2:0:0:0: [sdb] Attached SCSI disk
[ 6326.521533] usb 1-1.2: new high-speed USB device number 5 using oxnas-ehci
[ 6326.635965] usb 1-1.2: New USB device found, idVendor=1bcf, idProduct=0c31
[ 6326.649776] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 6326.681658] usb 1-1.2: Product: USB to Serial-ATA bridge
[ 6326.686958] usb 1-1.2: Manufacturer: Sunplus Innovation Technology.
[ 6326.703480] usb 1-1.2: SerialNumber: FFFACFF0FD000000FF2940FD301FEC
[ 6326.713310] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 6326.720145] scsi host3: usb-storage 1-1.2:1.0
[ 6327.726415] scsi 3:0:0:0: Direct-Access     Hitachi  HDS721010CLA332       PQ: 0 ANSI: 4
[ 6327.742556] sd 3:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[ 6327.757043] sd 3:0:0:0: [sdc] Write Protect is off
[ 6327.765854] sd 3:0:0:0: [sdc] Mode Sense: 38 00 00 00
[ 6327.772623] sd 3:0:0:0: [sdc] No Caching mode page found
[ 6327.778250] sd 3:0:0:0: [sdc] Assuming drive cache: write through    
[ 6327.816161]  sdc: sdc1
[ 6327.839206] sd 3:0:0:0: [sdc] Attached SCSI disk
[ 6336.701483] usb 1-1.1: new high-speed USB device number 6 using oxnas-ehci
[ 6336.854046] usb 1-1.1: New USB device found, idVendor=0bc2, idProduct=ab1e
[ 6336.860902] usb 1-1.1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 6336.868254] usb 1-1.1: Product: BUP BL
[ 6336.872220] usb 1-1.1: Manufacturer: Seagate
[ 6336.876474] usb 1-1.1: SerialNumber: NA7PP56L
[ 6336.886999] scsi host4: uas
[ 6336.893524] scsi 4:0:0:0: Direct-Access     Seagate  BUP BL           0304 PQ: 0 ANSI: 6
[ 6336.907796] sd 4:0:0:0: [sdd] Spinning up disk...
[ 6337.921477] ......ready
[ 6342.973099] sd 4:0:0:0: [sdd] 7814037167 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 6342.980815] sd 4:0:0:0: [sdd] 2048-byte physical blocks
[ 6343.246471] sd 4:0:0:0: [sdd] Write Protect is off
[ 6343.251261] sd 4:0:0:0: [sdd] Mode Sense: 4f 00 00 00
[ 6343.252462] sd 4:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 6343.437109]  sdd: sdd1 sdd2 sdd3 sdd5
[ 6343.448599] sd 4:0:0:0: [sdd] Attached SCSI disk
[ 6367.963571] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6428.292080] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6488.111313] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6548.076336] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6608.075031] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6668.056670] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6692.550364] ntfs: driver 2.1.32 [Flags: R/W MODULE].
[ 6692.683796] ntfs: volume version 3.1.
[ 6692.687457] ntfs: (device sdd3): load_system_files(): Volume is dirty.  Mounting read-only.  Run chkdsk and mount in Windows.                
[ 6701.253806] ntfs: volume version 3.1.
[ 6708.226334] ntfs: volume version 3.1.
[ 6708.229998] ntfs: (device sdd3): load_system_files(): Volume is dirty.  Mounting read-only.  Run chkdsk and mount in Windows.                
[ 7070.216619] blk_update_request: I/O error, dev mtdblock1, sector 232960                                                                      
[ 7070.245729] blk_update_request: I/O error, dev mtdblock1, sector 232960                                                                      
[ 7070.252326] Buffer I/O error on dev mtdblock1, logical block 29120, async page read                                                          
[ 7674.987008] EXT4-fs (sdb3): recovery complete
[ 7675.001994] EXT4-fs (sdb3): mounted filesystem with ordered data mode. Opts: (null)
[ 7703.409459] EXT4-fs (sdb3): mounted filesystem with ordered data mode. Opts: (null)
[ 7706.523392] EXT4-fs (sdb3): mounted filesystem with ordered data mode. Opts: (null)
[ 7713.826406] EXT4-fs (sdb3): mounted filesystem with ordered data mode. Opts: (null)
[ 7716.872335] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7720.701998] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7724.182023] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7730.723745] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7742.862220] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7745.981619] FAT-fs (sdb2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7766.630410] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7781.115102] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7794.888427] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7808.521538] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 7868.070973] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Umm... that last part doesn't look good. All volumes corrupt? But maybe too many power cycles rebooting this plug or??
So should I plug each drive into my laptop and run fsck or do it on the pogoplug?

Anyway - moving on

root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00e00000 00020000 "boot"
mtd1: 07200000 00020000 "data"

root@debian:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
LABEL=rootfs    /               ext3    noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0

root@debian:~# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
# pogoplug pro
  /dev/mtd0               0x00100000      0x20000         0x20000

root@debian:~# fw_printenv
autoload=no
baudrate=115200
bootargs=console=ttyS0,115200n8
bootdelay=10
console=console=ttyS0,115200n8
ethact=mii0
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
stderr=serial
stdin=serial
stdout=serial
usb_device=0:1
preboot_nc=run if_netconsole start_netconsole
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10
uinitrd_addr=0x60e00000
uimage_addr=0x60500000
dtb_addr=0x62c00000
dt_load_initrd=ext2load usb 0:1 $uinitrd_addr /boot/uInitrd
dt_load_uimage=ext2load usb 0:1 $uimage_addr /boot/uImage
dt_bootm=bootm $uimage_addr $uinitrd_addr $dtb_addr
dt_usb_boot=run dt_load_uimage; run dt_load_initrd; run dt_load_dtb; run dt_bootm
dt_usb_bootcmd=run usb_set_bootargs; run dt_usb_boot
dt_bootcmd_usb=usb start; run dt_usb_bootcmd; usb stop; reset
bootcmd=run dt_bootcmd_usb
ethaddr=00:25:31:01:cf:ec
fdt_file=/boot/dts/ox820-pogoplug-classic.dtb
dt_load_dtb=ext2load usb 0:1 $dtb_addr $fdt_file
serverip=192.168.1.9
ipaddr=192.168.1.13
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole

root@debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=58100k,nr_inodes=14525,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12092k,mode=755)
/dev/sda1 on / type ext3 (rw,noatime,errors=remount-ro,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=24180k)
tmpfs on /tmp type tmpfs (rw,relatime)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
/etc/auto.misc on /media type autofs (rw,relatime,fd=6,pgrp=1328,timeout=2,minproto=5,maxproto=5,indirect)

Oh and - I have tried a dozen different ways - but my pplug will not boot if I have any other drive powered on during boot up. It goes into that green light followed by fast green blink and then finally slow amber blink... then off and then repeat... I am calling that boot loop. I tried ssh into it during all different phases of that to see if I could run a command or something to see what is going on - but it won't recognize it - which is why I think it isn't booting.

To boot right now - I just unplug the power supply of the big drive and the usb of the little usb powered drives. Once it boots up I plug in accordingly and now with working autofs - I type in the directory I know that "should" be there - and it automounts the partition I programmed in. That part is really working well.

Curious - with Sync on - can I just unplug those drives if I have no activity? Or do I need to be issuing a umount command? Or does issuing shutdown work? Or other hints. Trying to make this more hands off and wife friendly still. Her workout videos are on there.

Okay - that is all I got for right now. Any help is appreciated.

Thanks
TC
Re: Best way for automounting external USB drive(s)
March 09, 2020 10:58PM
TC,

> Alright be nice - I am new here. Still
> learning...

:) don't worry. This forum does not accept impolite behaviors as long as I am the moderator.

>
> Seems I should know what to do with this posting
> and all but... I am going to just post what I
> get

Yes. I think you got the idea already. But it is always good to double check everything in one go and save a lot of time.

There are 2 problems. One major: mounting rootfs, and minor: the mtd block errors.


> [ 0.000000] Kernel command line:
> console=ttyS0,115200 root=/dev/sda1 rootdelay=10

So here the bootargs showed why you had trouble booting with multiple drives attached. The root device root=/dev/sda1. I explained it here:

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

It is worth reading to understand the boot process in this ARM box and many other ARM boxes.

> Oh and - I have tried a dozen different ways - but
> my pplug will not boot if I have any other drive
> powered on during boot up.

Your envs are quite old. That was because you installed u-boot using Qui's blog, and that was years ago. But we will fix this booting problem based on your current envs (no need to install new u-boot).

At Debian shell prompt:

fw_setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts

The above should fix the multiple partition booting problem, and also the mtd error. So reboot at this point with the USB rootfs attached and other drives plugged in.

If it does not boot, remove all attached drives, with only USB rootfs plugged in, recycle power and then we'll go from there.

> Curious - with Sync on - can I just unplug those
> drives if I have no activity?

With Sync on, yes. Access is slower because write to disk will be committed before you unplug it accidentally or intentionally. But the rule of thumb is to look at the LED on USB drive before removing it. If it is off then we can remove it without worrying.

OTOH, with async, we need to run sync command, and then unmount it, to ensure all data writes are committed.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 10, 2020 08:11AM
Mornin' Bodhi,

Thanks again for all of your help and I appreciate all the kindness.

I read up on bootargs and I understand in principal but certainly only vaguely.

I tried your command:
fw_setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts

But the command is looking for a ' to close. So I might have botched it while I didn't know what the terminal was doing. After waiting 3 minutes I crashed it.

So next I tried:
fw_setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts'

It liked that. I rebooted with an extra drive plugged in and I got the boot loop problem.

I looked at demsg and found:
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=41000000.nand:14m(boot),-(data)
I might be new - but that looks like your command worked. In some of the examples on the page you referenced it seems there were semicolons in line too... I learned the hard way with the autofs config files that punctuation is important. So should the command look more like:
fw_setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200; root=LABEL=rootfs; rootdelay=10; $mtdparts'
That is a total guess on my part. Actually re-reading MikeH49's post above (Thanks Mike!) I don't think the ; is the problem... Well okay - now I am even more confused and this is all way over my head. But still learning.


Here is the full report for you. One thing to note - I don't have any of the drives connected so there is less to report and much fewer errors.
root@debian:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.54-oxnas-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #2 SMP PREEMPT Sat Mar 18 23:09:58 PDT 2017
[    0.000000] CPU: ARMv6-compatible processor [410fb025] revision 5 (ARMv7), cr=00c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Pogoplug V3 Classic
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c08a69c0, node_mem_map c7ef9000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map
[    0.000000] PERCPU: Embedded 12 pages/cpu @c7eda000 s17696 r8192 d23264 u49152
[    0.000000] pcpu-alloc: s17696 r8192 d23264 u49152 alloc=12*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=41000000.nand:14m(boot),-(data)
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 116200K/131072K available (6410K kernel code, 288K rwdata, 1908K rodata, 224K init, 247K bss, 14872K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
                   lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
                   modules : 0xbf000000 - 0xc0000000   (  16 MB)
                     .text : 0xc0008000 - 0xc0827e14   (8320 kB)
                     .init : 0xc0828000 - 0xc0860000   ( 224 kB)
                     .data : 0xc0860000 - 0xc08a8378   ( 289 kB)
                      .bss : 0xc08a8378 - 0xc08e6350   ( 248 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:160
[    0.000000] clocksource: rps_clocksource_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 19112603332 ns
[    0.000010] sched_clock: 24 bits at 390kHz, resolution 2560ns, wraps every 21474835200ns
[    0.000163] Console: colour dummy device 80x30
[    0.000197] Calibrating delay loop... 339.14 BogoMIPS (lpj=1695744)
[    0.050019] pid_max: default: 32768 minimum: 301
[    0.050186] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.050204] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.051023] Initializing cgroup subsys net_cls
[    0.051105] CPU: Testing write buffer coherency: ok
[    0.051530] Setting up static identity map for 0x60008220 - 0x60008258
[    0.190133] Brought up 2 CPUs
[    0.190156] SMP: Total of 2 processors activated (678.29 BogoMIPS).
[    0.190935] devtmpfs: initialized
[    0.196472] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.196518] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.196830] prandom: seed boundary self test passed
[    0.201246] prandom: 100 self tests passed
[    0.201274] pinctrl core: initialized pinctrl subsystem
[    0.202147] NET: Registered protocol family 16
[    0.202708] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.230018] cpuidle: using governor ladder
[    0.260011] cpuidle: using governor menu
[    0.264878] gpio-oxnas 44000000.gpio: at address c8848000
[    0.265282] gpio-oxnas 44100000.gpio: at address c884a000
[    0.265853] pinctrl-oxnas pinctrl: initialized OX820 pinctrl driver
[    0.279761] vgaarb: loaded
[    0.280312] SCSI subsystem initialized
[    0.280655] libata version 3.00 loaded.
[    0.281167] usbcore: registered new interface driver usbfs
[    0.281272] usbcore: registered new interface driver hub
[    0.281428] usbcore: registered new device driver usb
[    0.281625] pps_core: LinuxPPS API ver. 1 registered
[    0.281638] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.281684] PTP clock support registered
[    0.283840] clocksource: Switched to clocksource rps_clocksource_timer
[    0.302702] NET: Registered protocol family 2
[    0.303569] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.303610] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.303646] TCP: Hash tables configured (established 1024 bind 1024)
[    0.303746] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.303787] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.304048] NET: Registered protocol family 1
[    0.304578] RPC: Registered named UNIX socket transport module.
[    0.304601] RPC: Registered udp transport module.
[    0.304611] RPC: Registered tcp transport module.
[    0.304622] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.304652] PCI: CLS 0 bytes, default 32
[    0.304995] Unpacking initramfs...
[    0.780963] Freeing initrd memory: 4492K (c79c6000 - c7e29000)
[    0.782446] Initialise system trusted keyring
[    0.795491] zbud: loaded
[    0.800834] NFS: Registering the id_resolver key type
[    0.800896] Key type id_resolver registered
[    0.800911] Key type id_legacy registered
[    0.800954] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.800977] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.801950] fuse init (API version 7.23)
[    0.804011] Key type big_key registered
[    0.881400] Key type asymmetric registered
[    0.881433] Asymmetric key parser 'x509' registered
[    0.881579] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.881607] io scheduler noop registered
[    0.881625] io scheduler deadline registered
[    0.881689] io scheduler cfq registered (default)
[    0.882355] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.883824] console [ttyS0] disabled
[    0.883919] 44200000.uart: ttyS0 at MMIO 0x44200000 (irq = 6, base_baud = 390625) is a 16550A
[    1.409446] console [ttyS0] enabled
[    1.424488] loop: module loaded
[    1.676436] scsi host0: sata_oxnas
[    1.729704] ata1: SATA max UDMA/133 irq 7
[    1.733816] sata_oxnas: resetting SATA core
[    1.734876] nand: Could not find valid ONFI parameter page; aborting
[    1.734919] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    1.734924] nand: Hynix NAND 128MiB 3,3V 8-bit
[    1.734932] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.734947] Scanning device for bad blocks
[    1.816934] 2 cmdlinepart partitions found on MTD device 41000000.nand
[    1.823464] Creating 2 MTD partitions on "41000000.nand":
[    1.828843] 0x000000000000-0x000000e00000 : "boot"
[    1.835586] 0x000000e00000-0x000008000000 : "data"
[    1.842954] oxnas-gmac 40400000.ethernet: no reset control found
[    1.848939] stmmac - user ID: 0x12, Synopsys ID: 0x35
[    1.854016]  Ring mode enabled
[    1.857052]  DMA HW capability register supported
[    1.861580]  Enhanced/Alternate descriptors
[    1.865912]  Enabled extended descriptors
[    1.869895]  RX Checksum Offload Engine supported (type 2)
[    1.875368]  TX Checksum insertion supported
[    1.879613]  Wake-Up On Lan supported
[    1.883271]  Enable RX Mitigation via HW Watchdog Timer
[    1.914721] libphy: stmmac: probed
[    1.918118] eth%d: PHY ID 001cc914 at 0 IRQ POLL (stmmac-0:00) active
[    1.924579] eth%d: PHY ID 001cc914 at 3 IRQ POLL (stmmac-0:03)
[    1.931271] PPP generic driver version 2.4.2
[    1.936099] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.942679] ehci-pci: EHCI PCI platform driver
[    1.947619] oxnas-ehci 40200100.ehci: EHCI Host Controller
[    1.953187] oxnas-ehci 40200100.ehci: new USB bus registered, assigned bus number 1
[    1.961049] oxnas-ehci 40200100.ehci: irq 10, io mem 0x40200100
[    1.980008] oxnas-ehci 40200100.ehci: USB 2.0 started, EHCI 1.00
[    1.986327] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.993146] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.000373] usb usb1: Product: EHCI Host Controller
[    2.005227] usb usb1: Manufacturer: Linux 4.4.54-oxnas-tld-1 ehci_hcd
[    2.011668] usb usb1: SerialNumber: 40200100.ehci
[    2.017331] hub 1-0:1.0: USB hub found
[    2.021204] hub 1-0:1.0: 2 ports detected
[    2.026324] usbcore: registered new interface driver cdc_acm
[    2.032020] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    2.040130] usbcore: registered new interface driver cdc_wdm
[    2.045923] usbcore: registered new interface driver usb-storage
[    2.052152] usbcore: registered new interface driver usbserial
[    2.058037] usbcore: registered new interface driver usbserial_generic
[    2.064640] usbserial: USB Serial support registered for generic
[    2.071096] mousedev: PS/2 mouse device common for all mice
[    2.076817] i2c /dev entries driver
[    2.081638] hidraw: raw HID events driver (C) Jiri Kosina
[    2.087272] usbcore: registered new interface driver usbhid
[    2.092881] usbhid: USB HID core driver
[    2.098749] NET: Registered protocol family 10
[    2.110156] ata1: SATA link down (SStatus 0 SControl 300)
[    2.120750] sit: IPv6 over IPv4 tunneling driver
[    2.126382] NET: Registered protocol family 17
[    2.131084] Key type dns_resolver registered
[    2.136783] registered taskstats version 1
[    2.140953] Loading compiled-in X.509 certificates
[    2.145850] zswap: loaded using pool lzo/zbud
[    2.164697] Key type encrypted registered
[    2.171799] Freeing unused kernel memory: 224K (c0828000 - c0860000)
[    2.340057] usb 1-1: new high-speed USB device number 2 using oxnas-ehci
[    2.357767] random: systemd-udevd: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.367956] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.368670] random: systemd-udevd: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.368880] random: systemd-udevd: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.398827] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.408171] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.418414] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.431664] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.441768] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.451888] random: udevadm: uninitialized urandom read (16 bytes read, 0 bits of entropy available)
[    2.491978] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    2.498667] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.505907] usb 1-1: Product: USB2.0 Hub
[    2.517424] hub 1-1:1.0: USB hub found
[    2.527505] hub 1-1:1.0: 4 ports detected
[    2.810183] usb 1-1.3: new high-speed USB device number 3 using oxnas-ehci
[    2.931875] usb 1-1.3: New USB device found, idVendor=8644, idProduct=8003
[    2.938734] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.954255] usb 1-1.3: Product: USB Flash Disk                
[    2.962785] usb 1-1.3: Manufacturer: General                       
[    2.969044] usb 1-1.3: SerialNumber: 05103700000005AD
[    2.980702] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[    3.000407] scsi host1: usb-storage 1-1.3:1.0
[    3.082762] usbcore: registered new interface driver uas
[    4.001303] scsi 1:0:0:0: Direct-Access     General  USB Flash Disk   1.00 PQ: 0 ANSI: 2
[    4.011886] sd 1:0:0:0: [sda] 7831552 512-byte logical blocks: (4.01 GB/3.73 GiB)
[    4.020746] sd 1:0:0:0: [sda] Write Protect is off
[    4.025548] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[    4.026488] sd 1:0:0:0: [sda] No Caching mode page found
[    4.036564] sd 1:0:0:0: [sda] Assuming drive cache: write through
[    4.054643]  sda: sda1
[    4.066926] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   18.172787] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   18.193326] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   20.942210] random: nonblocking pool is initialized
[   22.268684] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[   31.980311] oxnas-gmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

I saw just a few things changed in here.
root@debian:~# fw_printenv
autoload=no
baudrate=115200
bootargs=console=ttyS0,115200n8
bootdelay=10
console=console=ttyS0,115200n8
ethact=mii0
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
stderr=serial
stdin=serial
stdout=serial
usb_device=0:1
preboot_nc=run if_netconsole start_netconsole
uinitrd_addr=0x60e00000
uimage_addr=0x60500000
dtb_addr=0x62c00000
dt_load_initrd=ext2load usb 0:1 $uinitrd_addr /boot/uInitrd
dt_load_uimage=ext2load usb 0:1 $uimage_addr /boot/uImage
dt_bootm=bootm $uimage_addr $uinitrd_addr $dtb_addr
dt_usb_boot=run dt_load_uimage; run dt_load_initrd; run dt_load_dtb; run dt_bootm
dt_usb_bootcmd=run usb_set_bootargs; run dt_usb_boot
dt_bootcmd_usb=usb start; run dt_usb_bootcmd; usb stop; reset
bootcmd=run dt_bootcmd_usb
ethaddr=00:25:31:01:cf:ec
fdt_file=/boot/dts/ox820-pogoplug-classic.dtb
dt_load_dtb=ext2load usb 0:1 $dtb_addr $fdt_file
serverip=192.168.1.9
ipaddr=192.168.1.13
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts

All other files seemed to stay the same.

Thanks again for all of your help!
TC
Re: Best way for automounting external USB drive(s)
March 10, 2020 02:00PM
Extra Credit Help

You have helped me a lot along this journey. I know we will get the boot issue solved. But meanwhile - Anyone have some quick answers for these:

1. Can I use the pogoplug to do hard drive repair (fschk or ??) Is it wise or is the ‘plug underpowered for the job.

2. Can I use the ‘plug for copying or backing up one partition on one drive to another drive? Like using dd? I have 2 drives that I want to keep identical. 1 working day to day drive and then a second backup copy of that. I was reading up on rsync. I know it might take a while for the first copy but then differential backups could be easy? Stop me now if the ‘plug just isn’t capable of this.

3. New today - my second backup drive fails to mount in windows or linux. Here is what it gives me in my linux terminal:
$ sudo fsck.ext4 -p /dev/sdb
[sudo] password for rj:
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb
/dev/sdb:
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdb contains `DOS/MBR boot sector; partition 1 : ID=0xb, start-CHS (0x0,32,33), end-CHS (0x3ff,254,63), startsector 2048, 1953521664 sectors' data

Is it time for testdisk - which I have used before but if you know of a “dummies guide” for that I am eager to read it. Or - point me toward something you would recommend? I have a windows pc here too - so if there is? A windows answer I can switch that on.

Anyway - my journey continues.
Thanks for all the help!
TC
Re: Best way for automounting external USB drive(s)
March 10, 2020 03:34PM
NEW BONUS QUESTION

So 2 days ago - I swear - unless I am really losing my mind or my sanity or all three...

I plugged my favorite 128gb usb drive in and copied a movie (big buck bunny-of course) to my 1tb external hard drive.

I did this before autofs was working so I must have mounted it by hand?...

Today - I added it to the auto.misc file to give it a known mount point and no go... So I decided to mount it by hand and:

root@debian:~# blkid
/dev/sda1: LABEL="rootfs" UUID="962ccb6d-4595-489d-a74a-2000531debf2" TYPE="ext3" PARTUUID="0310c6a6-01"
/dev/sdb: UUID="D8BB-2AFF" TYPE="exfat"
/dev/sdc1: LABEL="HITCH" UUID="14F6-3A66" TYPE="vfat" PARTUUID="41359ccd-01"
root@debian:~# mount /dev/sdb /mnt/test
mount: unknown filesystem type 'exfat'

So how did I mount it a few days ago?
Re: Best way for automounting external USB drive(s)
March 10, 2020 05:13PM
TC,

> So next I tried:
>
> fw_setenv usb_set_bootargs 'setenv bootargs
> console=ttyS0,115200 root=LABEL=rootfs
> rootdelay=10 $mtdparts'
>

My bad, indeed was a typo.


> It liked that. I rebooted with an extra drive
> plugged in and I got the boot loop problem.
>
> I looked at demsg and found:
>
> [    0.000000] Kernel command line:
> console=ttyS0,115200 root=LABEL=rootfs
> rootdelay=10
> mtdparts=41000000.nand:14m(boot),-(data)
>
> I might be new - but that looks like your command
> worked. In some of the examples on the page you
> referenced it seems there were semicolons in line
> too...

No semicolon in bootargs. The semicolons you saw are u-boot commands separator (like in shell script). Each bootarg is separated by a space, together they form one env: bootargs.

> [ 0.000000] Kernel command line:
> console=ttyS0,115200 root=LABEL=rootfs
> rootdelay=10
> mtdparts=41000000.nand:14m(boot),-(data)

It looks good.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 10, 2020 05:28PM
TC,

Let's get it boot. Look at all your attached drives.

Boot with USB rootfs. After it booted, log in and plug in (or power up) your other drives. After they are mounted, execute these commands for each partition in each disk:

e2label /dev/sda1
e2label /dev/sdb1
.....

and so on. If a disk has more than 1 partition, then do e2label for all partitions.
and then

mount

Is there any rootfs in any partition from those attached disks? or are they just data partitions?

Please list the types of disks, i.e. how many USB HDD, USB flash, and SATA disks are you using (we already know the rootfs is USB flash).

=====

I think I know what the problem is, but still thinking about the best way to solve it. It mainly is because you are running an old version of my 2013 OXNAS u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 10, 2020 05:38PM
TC,

> 1. Can I use the pogoplug to do hard drive repair
> (fschk or ??) Is it wise or is the ‘plug
> underpowered for the job.

Yes. It is much slower than a laptop, but it is quite adequate to run fsck. If the disk is large capacity, it will take a long time for sure. But nothing like a whole day or something like that.


> 2. Can I use the ‘plug for copying or backing
> up one partition on one drive to another drive?
> Like using dd? I have 2 drives that I want to
> keep identical. 1 working day to day drive and
> then a second backup copy of that. I was reading
> up on rsync. I know it might take a while for the
> first copy but then differential backups could be
> easy? Stop me now if the ‘plug just isn’t
> capable of this.

rsync is best for this purpose. Never use dd to copy disk, it is not the right tool for this job.

You can also use cp -aR to copy the entire partition. But it is a one time copy. rsync is the best tool to use for backup.


> $ sudo fsck.ext4 -p /dev/sdb

fsck works on each partition, sdb is the whole disk.

fsck.ext4 -p /dev/sdb1

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



Edited 1 time(s). Last edit at 03/10/2020 06:09PM by bodhi.
Re: Best way for automounting external USB drive(s)
March 10, 2020 05:41PM
TC,

> /dev/sdb: UUID="D8BB-2AFF" TYPE="exfat"

> root@debian:~# mount /dev/sdb /mnt/test
> mount: unknown filesystem type 'exfat'
>
> So how did I mount it a few days ago?

Same answer as before, sdb is the whole disk. So except fdisk or parted, any other commands will expect to see /dev/sdb1, /dev/sdb2,...

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 10, 2020 08:30PM
@Mike,

Which u-boot do you have on your Pogo Pro Oxnas box? You can see it in serial console.

If it is later than 2013, then you can use uEnv.txt to test the rootfs label booting. No need to do the following.

========

If your u-boot is 2013, if you have serial console connected, can we get some info about the commands available:

help
help env

Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 11, 2020 08:21AM
Bodhi - thanks again for all your help and I know I feel like I am asking silly questions.

But yes - I do not have any other partitions with the label "bootfs".

root@debian:~# blkid
/dev/sda1: LABEL="rootfs" UUID="962ccb6d-4595-489d-a74a-2000531debf2" TYPE="ext3" PARTUUID="0310c6a6-01"
/dev/sdb: UUID="D8BB-2AFF" TYPE="exfat"
/dev/sdc1: LABEL="HITCH" UUID="14F6-3A66" TYPE="vfat" PARTUUID="41359ccd-01"
/dev/sdd1: PARTLABEL="Microsoft reserved partition" PARTUUID="38861c17-1a68-43f5-913d-694fb36e3c95"
/dev/sdd2: LABEL="Seagate Backup Plus Drive" UUID="66926EE3926EB6E9" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e3cee74-49d8-4e65-b7dc-784846e988f5"
/dev/sdd3: LABEL="User Data" UUID="443F7B407388A63B" TYPE="ntfs" PARTUUID="600aabb1-8e03-43d7-a1cc-4a7aade41e11"
/dev/sdd5: LABEL="UserData" UUID="A8EE8F06EE8ECC4E" TYPE="ntfs" PARTUUID="16275324-247c-4670-889b-1e8beb02fa61"
root@debian:~# e2label /dev/sda1
rootfs
root@debian:~# e2label /dev/sda2
e2label: No such file or directory while trying to open /dev/sda2
Couldn't find valid filesystem superblock.
root@debian:~# e2label /dev/sdb1
e2label: No such file or directory while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.
root@debian:~# e2label /dev/sdb2
e2label: No such file or directory while trying to open /dev/sdb2
Couldn't find valid filesystem superblock.root@debian:~# e2label /dev/sdc1
e2label: Bad magic number in super-block while trying to open /dev/sdc1
/dev/sdc1 contains a vfat file system labelled 'HITCH'
root@debian:~# e2label /dev/sdc2
e2label: No such file or directory while trying to open /dev/sdc2
Couldn't find valid filesystem superblock.
root@debian:~# e2label /dev/sdd1
e2label: Bad magic number in super-block while trying to open /dev/sdd1
root@debian:~# e2label /dev/sdd2
e2label: Bad magic number in super-block while trying to open /dev/sdd2
/dev/sdd2 contains a ntfs file system labelled 'Seagate Backup Plus Drive'
root@debian:~# e2label /dev/sdd3
e2label: Bad magic number in super-block while trying to open /dev/sdd3
/dev/sdd3 contains a ntfs file system labelled 'User Data'
root@debian:~# e2label /dev/sdd4
e2label: No such file or directory while trying to open /dev/sdd4
Couldn't find valid filesystem superblock.
root@debian:~# e2label /dev/sdd5
e2label: Bad magic number in super-block while trying to open /dev/sdd5
/dev/sdd5 contains a ntfs file system labelled 'UserData'
root@debian:~#


And yes (normally) I remember that you need to mount a partition not a disk - but above you can see I tried to view the e2label of sdb1 or sdb2... sdb is the large usb drive that if I remember correctly - I mounted by hand 3 days earlier...

I think I might be shutting down my pogoplug down improperly and screwing up drive tables. Point me to where I can learn to explicitly unmount drives or whatever I might be doing wrong? I am not going to worry about sdb right now - since it only has 3 files on it - I will just format it again and move on. But I think that is explaining some of my other problems.

Anyway - thanks as always for your help.

TC
Re: Best way for automounting external USB drive(s)
March 11, 2020 08:38AM
My Pogo P21 u-boot is 2013.10, dated in early 2014, perhaps when I installed it. I think this may have been in the Arch days when there was a long script that downloaded and installed the u-boot, essentially automating your steps. I think that script used the root=/dev/sda1 feature. Interesting to me, is that it loads the DTB separately, so it is apparently not embedded in the uImage. This box is running your 3.17.0 Debian kernel and filesystem.

I changed the line in the environment to root=LABEL=rootfs and it boots fine. Don't ask me what it took to get there, semi-colons, single quotes, typos, etc. Serial saved the day. Serial disconnected now, box closed up and back in service.

Update: I looked into this further and your instructions for the 13.10 u-boot used root=/dev/sda1 in the environments. This doesn't seem to be a problem if you only have one drive connected at boot. It's worked for me for 5 years. :)



Edited 2 time(s). Last edit at 03/11/2020 11:45AM by mikeh49.
Re: Best way for automounting external USB drive(s)
March 11, 2020 12:13PM
@tca...

I have not reviewed your posts above for this, but do you have ntfs-3g installed? My understanding is that you need this to use ntfs formatted drives. I have it on my boxes that use ntfs drives.

Your HITCH drive is using the old MS vfat file system that goes back to Win 95. You might need to research how that is handled in Linux; Bohdi provides a pretty basic filesystem and you might need to add some packages to handle the old filesystems. "Commercial" distros like Ubuntu probably include them out of the box. It looks like some kernel modules are needed for vfat; you'll need Bohdi for this.

Your sdb is an exfat file system for large USB flash drives. You'l probably need a "helper" for this in linux also. See below:

What is exfat

Use exfat on linux
Re: Best way for automounting external USB drive(s)
March 11, 2020 05:04PM
Thanks Mike!

Yes u-boot-2013.10-tld-4 does not have enough necessary envs set up to handle multiple drives at boot.

And you've found that is true when the single partition single disk always boot OK. But as soon as you plug in another drive and power up, it will not boot consistently with root device root=/dev/sda1.

It needs at least root device to be root=LABEL=rootfs. But the envs still remain inadequate for a robust booting process when there are many USB drives plugged in.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 11, 2020 05:21PM
TC,

/dev/sda1: LABEL="rootfs" UUID="962ccb6d-4595-489d-a74a-2000531debf2" TYPE="ext3" PARTUUID="0310c6a6-01"
/dev/sdb: UUID="D8BB-2AFF" TYPE="exfat"
/dev/sdc1: LABEL="HITCH" UUID="14F6-3A66" TYPE="vfat" PARTUUID="41359ccd-01"
/dev/sdd1: PARTLABEL="Microsoft reserved partition" PARTUUID="38861c17-1a68-43f5-913d-694fb36e3c95"
/dev/sdd2: LABEL="Seagate Backup Plus Drive" UUID="66926EE3926EB6E9" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e3cee74-49d8-4e65-b7dc-784846e988f5"
/dev/sdd3: LABEL="User Data" UUID="443F7B407388A63B" TYPE="ntfs" PARTUUID="600aabb1-8e03-43d7-a1cc-4a7aade41e11"
/dev/sdd5: LABEL="UserData" UUID="A8EE8F06EE8ECC4E" TYPE="ntfs" PARTUUID="16275324-247c-4670-889b-1e8beb02fa61"

Everything is good except /dev/sdb.

BTW, the complete supports for exfat file system is not in this kernel yet (4.4 is old LTS kernel)! So for now, you should either use vfat, or ntfs if the files are large in size.


The reason e2label gave you errors: the other partition are ntfs or vfat, which is not a Linux file system, the rootfs is fine:
root@debian:~# e2label /dev/sda1
rootfs

> I think I might be shutting down my pogoplug down
> improperly and screwing up drive tables. Point me
> to where I can learn to explicitly unmount drives
> or whatever I might be doing wrong?

If they are all mounted with sync, then there should be no problem unplugging when there is no activity. However, it is best to unmount explicitly using umount at command line:
umount <mountpoint>

So use the mount command to see where they are mounted and umount each one when needed.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 11, 2020 05:39PM
Hi Mike,

> Serial
> disconnected now, box closed up and back in
> service.

OK. So I wont ask to see serial console info :) I was thinking to test the newer envs uboot.2013.10-tld-5.ox820.environment with this older u-boot. I'm positive that it should work.

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

Download U-Boot image at Dropbox:

uboot.2015.10-tld-1.ox820.bodhi.tar
md5
90afc75a29601cdb60adc7afd8bbda26

This archive contains the following 4 files:

uboot.2015.10-tld-1.ox820.mtd0.img
uboot.spl.2013.10.ox820.850mhz.mtd0.img
uboot.2013.10-tld-5.ox820.environment
uboot.2013.10-tld-5.ox820.environment.img

The above envs image has the necessary logic make it robust enough to boot any configuration.

Since TC does not have serial console, he needs to run netconsole to try this envs image. And I think at this point, probably best if it is tested by me, Mike, JT, or Leggo. Let TC enjoy his box for a while :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Best way for automounting external USB drive(s)
March 11, 2020 06:58PM
I have a Pogo Pro that is out of service so if I have some time, I'll give it a try. So you want me to try the 2013.10-tld5 environments instead of whatever is on the box? I don't know the u-boot on the Pro, so I'll have to check that.
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: