Not always finding rootfs with multiple usb devices [SOLVED]

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Not always finding rootfs with multiple usb devices [SOLVED]

Postby Sinatics » Sat Dec 01, 2012 10:17 am

Hey guys I've got a V2 Pink Pogoplug and am having issues with it booting from the proper flash drive if multiple flash drives are plugged into my pogoplug. It seems like about 50% of the time my rootfs is assigned to /dev/sda1 and 50% of the time its assigned to /dev/sdb1, with my current environment settings i'm assuming its at /dev/sda1, I'm thinking that usb_scan is hit or miss -- meaning some times it scans my rootfs first, while other times it scans one of my other drives first, making it /dev/sda1 and making my rootfs /dev/sdb1 which causes my system to not boot.

I attempted to follow this guide to select the boot drive by disk label but I had issues with it making my root directory read only (which they go over in the guide but even after adding the info to my fstab I still was getting a read only rootfs).

I also have the boot flag enabled on my rootfs flash drive and that hasn't seemed to do much. Any help with this issue is greatly appreciated.

Here is my fw_printenv
$this->bbcode_second_pass_code('', '
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_rootdelay=10
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:25:31:04:AC:38
arcNumber=2097
usb_rootfstype=ext3
ipaddr=192.168.0.17
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
serverip=192.168.0.222
usb_root=/dev/sda1
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
')
Last edited by Sinatics on Sat Dec 01, 2012 6:38 pm, edited 1 time in total.
Sinatics
 
Posts: 8
Joined: Tue Nov 27, 2012 5:15 am

Re: Not always finding rootfs with multiple usb devices

Postby moonman » Sat Dec 01, 2012 10:31 am

1. Try using the very bottom usb port for rootfs flash drive. That one should be initialized first.

2.if it doesn't work, use the uInitrd method, but before adding anything to fstab boot up your plug with just the rootfs usb drive inserted, run mount and look at the filesystem type and options that /dev/sda1 is mounted with.

$this->bbcode_second_pass_quote('', 'm')ount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=125168k,nr_inodes=31292,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sda1 on / type ext3 (rw,noatime,errors=continue,barrier=1,data=writeback)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/bfqio type cgroup (rw,nosuid,nodev,noexec,relatime,bfqio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /tmp type tmpfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)


now, go into fstab and add this:

$this->bbcode_second_pass_quote('', 'L')ABEL=urootfs / ext3 rw,noatime,errors=continue,barrier=1,data=writeback 0 1


make sure:
your rootfs is ext3 or ext2. I have a feeling yours is ext2
the options for ext2 would be different
rw HAS to be in the options as rw=read/write, ro=read only

You can use LABEL or UUID, either one works.

Also, if it mounts ro, you should be able to ssh in and remount it as rw to change the fstab if something goes wrong:
$this->bbcode_second_pass_code('', 'mount -o remount,rw /')
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Not always finding rootfs with multiple usb devices [SOL

Postby Sinatics » Sat Dec 01, 2012 6:39 pm

Plugging in my rootfs to the bottom usb port seems to have fixed the issue, my rootfs flash drive is always detected as /dev/sda1 now. Thanks! :)
Sinatics
 
Posts: 8
Joined: Tue Nov 27, 2012 5:15 am


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 16 guests