Welcome! Log In Create A New Profile

Advanced

Pogoplug V4 - Boot Debian from Sata HDD

Posted by Nirmal_Kumar 
Pogoplug V4 - Boot Debian from Sata HDD
July 06, 2018 11:07AM
Dear Friends,

I have been using Pogo v4 with UBoot for more than 2 years with Sata HDD boot. Recently the debian got corrupted and i am unable to boot using HDD. I have created a fresh MMC card and booted debian in PogoV4 using the MMC Slot.

i cound't able to find a simple steps to on what is the configuration i need to make in order to boot from HDD.?

Here my configurations

Linux debian 4.12.1-kirkwood-tld-1 #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017 armv5tel GNU/Linux

arcNumber=3960
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_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
custom_params=init=/bin/systemd
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
ethact=egiga0
ethaddr=00:25:31:05:ec:22
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
nc_ready=1
partition=nand0,2
preboot=run preboot_nc
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
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
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=nc
stdin=nc
stdout=nc
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_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_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15
usb_rootfstype=ext3
ncip=192.168.1.9
bootcmd=bootcmd=run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset
serverip=192.168.1.4
ipaddr=192.168.1.5


Re: Pogoplug V4 - Boot Debian from Sata HDD
July 06, 2018 07:48PM
Nirmal_Kumar,


> i cound't able to find a simple steps to on what
> is the configuration i need to make in order to
> boot from HDD.?

Your u-boot is already set up to boot from HDD.

All you need to do is the create the rootfs on HDD, either brannd new, or clone it from the MMC drive.

See the Wiki thread for tutorial about cloning rootfs:

Quote

Backup and Cloning rootfs

CrashPlan 4.3.0
Backup/Restore rootfs using tar command
Adjust udev rules after cloning rootfs
Stock Pogoplug rootfs
How to clone a rootfs from one Kirkwood box to another: Step 1 and Step 2
How to clone SATA rootfs to USB rootfs

Unplug the MMC card so that it will boot correctly. Keep this MMC card around as a backup rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - Boot Debian from Sata HDD
July 29, 2018 10:24AM
Hi Bodhi,

Thanks for the update.

Context : Installing Debian from Scratch on my HDD on Partition 5 . Currently its running on my MMC Card.

This is what i did and it doesn't boots the debian. What i am missing?

1.Formatted HDD Partition 5 /dev/sda5 to ext 4

mkfs.ext4 -O ^64bit -L roofs /dev/sda5

2.Extracted Debian
cd /media/sda5 
tar -xjf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2

3.Changed Label
tune2fs -L rootfs_sata /dev/sda5


4.Updated the Env Variable
fw_setenv sata_root 'LABEL=rootfs_sata'

I did all these through the current Debian on MMC under root account.

5.Removed MMC card and Rebooted.

- Able to Ping the Pogo Device with the IP 192.168.1.5. and it boots pogo os ([root@Pogoplug /tmp]#)

Please let me know what i am missing.

Here the fw_printenv

[root@Pogoplug /tmp]# fw_printenv
arcNumber=3960
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_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
custom_params=init=/bin/systemd
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
ethact=egiga0
ethaddr=00:25:31:05:ec:22
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
nc_ready=1
partition=nand0,2
preboot=run preboot_nc
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
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
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=nc
stdin=nc
stdout=nc
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_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_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15
usb_rootfstype=ext3
ncip=192.168.1.9
bootcmd=bootcmd=run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset
serverip=192.168.1.4
ipaddr=192.168.1.5
sata_root=LABEL=rootfs_sata



Regards
Nirmal



Edited 1 time(s). Last edit at 07/29/2018 10:26AM by Nirmal_Kumar.
Re: Pogoplug V4 - Boot Debian from Sata HDD
July 30, 2018 03:41AM
Nirmal,

If you have serial console or netconsole, please post the entire boot log.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Pogoplug V4 - Boot Debian from Sata HDD
July 30, 2018 09:11PM
Hi Bodhi,

Here the output from netconsole.

λ nc -l -u -p 6666

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:41:47 -0700)
Pogoplug V4
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot:  0
Unknown command 'bootcmd=run' - try 'help'
running scan_disk ...
Scan device usb
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000LM024 HN-M101MBB Firm: 2AR20002 Ser#: S2ZPJ9AD343686
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
device ide 0:1
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc
device mmc 0:1
Card did not respond to voltage select!
** Bad device mmc 0 **
device mmc 1:1
MMC Device 1 not found
MMC Device 1 not found
** Bad device mmc 1 **
device mmc 2:1
MMC Device 2 not found
MMC Device 2 not found
** Bad device mmc 2 **
device mmc 3:1
MMC Device 3 not found
MMC Device 3 not found
** Bad device mmc 3 **
loading uImage ...
** Bad device usb 0 **
loading uInitrd ...
** Bad device usb 0 **
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=4", size 112 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 896, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 18/8, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 896, PEBs reserved for bad PEB handling: 8
Loading file 'uboot.mtd0.dockstar.original.kwb' to addr 0x00800000...
Done
## Starting application at 0x00800200 ...

Regards
Nirmal
Re: Pogoplug V4 - Boot Debian from Sata HDD
July 30, 2018 10:49PM
Nirmal,

1. Your HDD partitions were not recognized by u-boot. You will need to repartition the HDD. And create the rootfs again.

Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000LM024 HN-M101MBB Firm: 2AR20002 Ser#: S2ZPJ9AD343686
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
device ide 0:1
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **


2. Also, you don't need to set extra variable such as

fw_setenv sata_root 'LABEL=rootfs_sata'

The default envs for this u-boot already set to recognize the rootfs labeled partition:

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params


3. Boot error
Unknown command 'bootcmd=run' - try 'help'

When you tried to change envs, you also had a typo for the bootcmd. So restore that original bootcmd and don't need to change it.

The typo:
bootcmd=bootcmd=run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset

Correction:
setenv bootcmd 'run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_pogo; reset'

-bodhi
===========================
Forum Wiki
bodhi's corner
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: