Installing FVDW on a Seagate Personal Cloud

Installing FVDW on a Seagate Personal Cloud

Postby TonyP » Tue May 22, 2018 9:59 am

Hi folks.

I see you have made a great looking firmware for Lacie NAS's and I'd like to see if you think it could be installed on a Seagate Personal Cloud (SRN21C).

It shares a lot in common with the Lacie NAS' (I think Seagate took over Lacie), and has a Unicorn using a lot of resources -

Code: Select all
 2703     1 root     S     251m  50%   1% /usr/bin/python /usr/lib/unicorn/run.py -c /etc/unicorn/unicorn_modules.conf


Here is some information that is useful.

Code: Select all
[root@PersonalCloud ~]# fdisk -l

Disk /dev/mtdblock0: 1 MB, 1048576 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock0 doesn't contain a valid partition table
fdisk: device has more than 2^32 sectors, can't use all of them
Found valid GPT with protective MBR; using GPT

Disk /dev/sda: 4294967295 sectors, 4095M
Logical sector size: 512
Disk identifier (GUID): 1a17725e-dae6-4fd5-a6ab-c742603dc911
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095       1024K   0700  grub_core
   2            4096          397311        192M   0700  boot_rescue
   3          397312          399359       1024K   0700  nv_data
   4          399360         3545087       1536M   0700  root_1
   5         3545088         6690815       1536M   0700  root_2
   6         6690816         8787967       1024M   0700  var
   7         8787968         9836543        512M   0700  swap
   8         9836544      5860532223       2789G   0700  slot1.8


Code: Select all
[root@PersonalCloud ~]# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.7.2

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 1A17725E-DAE6-4FD5-A6AB-C742603DC911
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  grub_core
   2            4096          397311   192.0 MiB   8300  boot_rescue
   3          397312          399359   1024.0 KiB  8300  nv_data
   4          399360         3545087   1.5 GiB     FD00  root_1
   5         3545088         6690815   1.5 GiB     FD00  root_2
   6         6690816         8787967   1024.0 MiB  FD00  var
   7         8787968         9836543   512.0 MiB   FD00  swap
   8         9836544      5860532223   2.7 TiB     FD00  slot1.8

Code: Select all
[root@PersonalCloud ~]# cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 996.14
Features        : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls idivt
CPU implementer : 0x56
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0x581
CPU revision    : 1

Hardware        : Marvell Armada 370 (Device Tree)
Revision        : 0000
Serial          : 0000000000000000

Code: Select all
[root@PersonalCloud ~]# cat /proc/meminfo
MemTotal:         511852 kB
MemFree:           10744 kB


What do you think? I'd love to be able to ditch the Seagate NAS OS......unicorn written in python doing hardly anything and using half of the 500Mb of RAM.

Does it look like a candidate for FVDW?

Thanks, Tony.
TonyP
 
Posts: 18
Joined: Wed May 16, 2018 9:27 am
Location: Australia

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Tue May 22, 2018 10:08 pm

My guess, yes it should be possible to run fvdw-sl on it, it is an arm 7 processor so the arm5 code in which the firmware is compiled should run on this cpu.
The only thing we will need is a kernel....as it is another cpu then on Lacie devices and raspberrry so we can't use those. Two ways to solve that, compile ourselves one for this cpu (not impossible as we know which cpu is on there) or as alternative you could try to use the kernel from Lacie which is normally stored in sda6 on older lacie devices but here on this one it seems to be stored on a different location, probably on sda2 a kernel will be stored (rescue) . So before formatting your harddrive you will need to take some file from it to see if we can find the kernel or at least the config file of the kernel.

To see if the boot loader can be accessed via fvdw-sl-console you could try if you can get access to the nas using u-boot console of the fvdw-sl console. You will not be able to use the other options of the fvdw-sl console as you don't have a standalone kernel for this device.
If the u-boot can be accessed via the consoles we now we can start to pull some information from the setup of the bootloader to see if is the same as Lacie cloudbox.

If you want to use the lacie kernel then the only way to setup the firmware is connecting the disk to a device running linux. If thats no option you will need to wait until we compiled a working standalone kernel for this box (assuming u-boot can be accessed via fvdw-sl console)
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Tue May 22, 2018 10:11 pm

ps, what does the command
Code: Select all
uname -a
gives as output?
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby TonyP » Tue May 22, 2018 11:42 pm

fvdw wrote:If the u-boot can be accessed via the consoles we now we can start to pull some information from the setup of the bootloader to see if is the same as Lacie cloudbox.

Yes, I have run UBoot successfully before when I was looking at installing Debian on it - https://wiki.debian.org/InstallingDebia ... sonalCloud
but I was scared off when I read - "Loss of U-Boot access
Several users have reported that they can't connect to U-Boot with clunc anymore after installing Debian (meaning they can't restore the original software or re-install Debian). Even though we investigated this issue, we couldn't figure out why this would happen to some users. Therefore, we suggest you only install Debian if you can make a serial console in case something goes wrong."

Would I be correct in saying that if I install on a spare hard drive, I can just plug the old, untouched drive back in and all will be ok?

In any case,
Code: Select all
[root@PersonalCloud ~]# uname -a
Linux PersonalCloud 3.10.72-svn18863 #1 Wed Mar 21 13:48:30 UTC 2018 armv7l GNU/Linux


I used your console to access UBoot, issuing 'version' gave the following

Code: Select all
U-Boot 2011.12-svn2115 (Nov 18 2014 - 22:57:57) Marvell version: v2011.12 2013_Q2.1 - Seagate version: 5.0.0
arm-marvell-linux-gnueabi-gcc (Linaro GCC branch-4.6.4. Marvell GCC release 201308-2123.0cc69bb4 64K MAXPAGESIZE ALIGN) 4.6.4
GNU ld (Linaro GCC branch-4.6.4. Marvell GCC release 201308-2123.0cc69bb4 64K MAXPAGESIZE ALIGN) 2.22.0.20120801
Marvell>>
TonyP
 
Posts: 18
Joined: Wed May 16, 2018 9:27 am
Location: Australia

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Wed May 23, 2018 7:10 am

Installing Debian cannot destroy uboot to my opinion if you install it on the harddisk
Uboot can only be affected if you overwrite uboot in flash. If these that lost uboot installed the debian kernel in the flash memory location were uboot is present , yes then this could happen.
But our firmware is fully installed on the harddisk and leaves the flash only. Sometimes we add some commands to uboot to make booting possible if uboot allows to chnage the environment.

To see which environment your uboot has give on the uboot prompt the command
Code: Select all
printenv

and post output. From this we can hopefully see what commands it uses to boot the disk

Would I be correct in saying that if I install on a spare hard drive, I can just plug the old, untouched drive back in and all will be ok?

Yes, assuming you don't fiddle with u-boot settings
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Wed May 23, 2018 7:12 am

One more

Seems you have ssh access on the lacie firmare.
Log in make a directy sda2
mkdir /sda2

Mounnt sda2
Code: Select all
mount /dev/sda2 /sda2

and look what is inside
Code: Select all
ls -l /sda2

If there are subfolders also look to the content of those

When you are done umount sda2
Code: Select all
umount /sda2
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby TonyP » Wed May 23, 2018 9:46 am

There are 2 folders, 'lost + found' (it is empty), and 'rescue'.

Code: Select all
[root@PersonalCloud sda2]# cd rescue
[root@PersonalCloud rescue]# la
total 101292
drwxr-xr-x    2 root     root        1.0K Aug 31  2016 .
drwxr-xr-x    4 root     root        1.0K Dec 24  2014 ..
-rw-r--r--    1 root     root       10.8K Oct 11  2014 armada-370-n090102.dtb
-rw-r--r--    1 root     root       10.8K Oct 11  2014 armada-370-n090103.dtb
-rw-r--r--    1 root     root       11.8K Oct 11  2014 armada-370-n090201.dtb
-rw-r--r--    1 root     root       11.0K Oct 11  2014 armada-370-n090203.dtb
-rw-r--r--    1 root     root       13.0K Oct 11  2014 armada-370-n090401.dtb
-rw-r--r--    1 root     root         669 Oct 11  2014 description.xml
-rw-r--r--    1 root     root         379 Aug 31  2016 nexus.map
-rw-r--r--    1 root     root       83.1M Aug 31  2016 product_image.tar.lzma
-rw-r--r--    1 root     root       10.8K Oct 11  2014 target.dtb
lrwxrwxrwx    1 root     root          17 Dec 24  2014 uImage -> uImage_1.5.16-arm
-rw-r--r--    1 root     root       15.4M Oct 11  2014 uImage_1.5.16-arm
-rw-r--r--    1 root     root          48 Aug 31  2016 versions

I have copied the contents to a shared folder in anticipation of needing them.

EDITED Uboot printenv output:
Code: Select all
Marvell>> printenv
printenv
CASset=min
MALLOC_len=5
Ubootver=5.0.0
autoload=no
baudrate=115200
board_dtb=armada-370-n090103.dtb
boot_fail=lump
bootargs=console=ttyS0,115200
bootargs_end=:10.4.50.254:255.255.255.0:KW40:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=run nexus_boot
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
disL2Cache=yes
disaMvPnp=no
disk_expand=if test "$disk" = ide,0; then disk_iface=ide; disk_num=0; elif test "$disk" = ide,1; then disk_iface=ide; disk_num=1; else echo Invalid disk st
ring: ${disk}; fi
disk_list=ide,0 ide,1
dtb_addr=0x6000000
eeeEnable=no
enaAutoRecovery=yes
enaClockGating=no
enaFPU=no
enaWrAllo=no
eth1addr=00:10:75:57:90:D2
eth1mtu=1500
ethact=egiga1
ethaddr=00:10:75:57:90:D2
ethmtu=1500
ethprime=egiga0
fdt_high=0xffffffff
fdtaddr=0x1000000
fdtfile=armada_xp_db.dtb
gatewayip=192.168.0.1
image_name=uImage
initrd_name=uInitrd
ipaddr=192.168.1.8
kern_addr=0x2000000
loadaddr=0x02000000
loads_echo=0
mvNetConfig=mv_net_config=1,(00:50:43:11:11:11,0:1:2:3:4),mtu=1500
mv_pon_addr=00:50:43:0c:58:26
ncip=192.168.1.4
netbsd_en=no
netmask=255.255.255.0
netretry=no
nexus_boot=test -n ${resetFlag_env} && forced=${resetFlag_env}; for disk in ${disk_list}; do run disk_expand; echo Booting Nexus OS from disk ${disk}...; c
ountfail=0; bootfail=0; user=0; if run nexus_load_flags; then run nexus_rescue_countfail && countfail=1; run nexus_set_root; kern_img=/boot/uImage; dtb_img
=/boot/target.dtb; test -n $board_dtb && dtb_img=/boot/$board_dtb; run nexus_load_image || bootfail=1; run nexus_rescue_user && user=1; if run nexus_can_bo
ot; then run nexus_inc_count; run nexus_save_flags; run nexus_bootargs; bootm ${kern_addr} - ${dtb_addr}; bootfail=1; fi; run nexus_boot_rescue; fi; done;
bootfail=1; countfail=; user=;run nexus_panic
nexus_boot_part=2
nexus_boot_rescue=echo Booting Nexus rescue system from disk ${disk}...; root_part=2; kern_img=/rescue/uImage; dtb_img=/rescue/target.dtb; test -n $board_d
tb && dtb_img=/rescue/$board_dtb; if run nexus_load_image; then if test -n ${panic}; then run nexus_uuid; setenv bootargs ${bootargs} root=UUID=${root_uuid
}; else run nexus_bootargs; fi; run nexus_rescue_bootargs; bootm ${kern_addr} - ${dtb_addr}; fi
nexus_bootargs=run nexus_uuid; setenv bootargs ${console} boot=UUID=${boot_uuid} root=UUID=${root_uuid}
nexus_can_boot=test ${bootfail} -eq 0 -a ${countfail} -eq 0 -a ${forced} -eq 0 -a ${user} -eq 0
nexus_inc_count=if test ${boot_count} -eq 0; then setenv boot_count 1; elif test ${boot_count} -eq 1; then setenv boot_count 2; else setenv boot_count ${ne
xus_max_count}; fi
nexus_load_flags=ext2get ${disk_iface} ${disk_num}:${nexus_nv_part} /ubootenv boot_count saved_entry
nexus_load_image=ext2load ${disk_iface} ${disk_num}:${root_part} ${dtb_addr} ${dtb_img}; ext2load ${disk_iface} ${disk_num}:${root_part} ${kern_addr} ${ker
n_img} && iminfo ${kern_addr}
nexus_max_count=3
nexus_nv_part=3
nexus_panic=panic=1; for disk in ${disk_list}; do run disk_expand; run nexus_boot_rescue; done
nexus_rescue_bootargs=test -n ${bootfail} && setenv bootargs bootfail=${bootfail} ${bootargs}; test -n ${countfail} && setenv bootargs countfail=${countfai
l} ${bootargs}; test -n ${user} && setenv bootargs user=${user} ${bootargs}; test -n ${forced} && setenv bootargs forced=${forced} ${bootargs}
nexus_rescue_countfail=test ${boot_count} -ge ${nexus_max_count}
nexus_rescue_user=ext2get ${disk_iface} ${disk_num}:3 /ubootenv rescue && test ${rescue} -eq 1
nexus_save_flags=ext2set ${disk_iface} ${disk_num}:${nexus_nv_part} /ubootenv boot_count ${boot_count}
nexus_set_root=if test $saved_entry -eq 1; then root_part=5; else root_part=4; fi
nexus_uuid=ext2uuid ${disk_iface} ${disk_num}:${nexus_boot_part}; boot_uuid=${uuid}; ext2uuid ${disk_iface} ${disk_num}:${root_part}; root_uuid=${uuid}
pcieTune=no
pexMode=rc
pre_lump=lump 1
product_serial=NZ321Y4E
pxe_files_load=:default.arm-armada370-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
rcvrip=169.254.100.100
resetFlag_env=0
resetdisk=hdd start; ide reset; run usbstart
rootpath=/srv/oneiric
sata_delay_reset=0
sata_dma_mode=yes
serverip=192.168.1.4
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
start_lump=lump 3
stderr=serial
stdin=nc
stdout=nc
uboot_capabilities=gpt,lba64
usb0Mode=host
usb1Mode=host
usb2Mode=device
usbActive=1
usbstart=gpio clear 59
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 4619/65532 bytes
Marvell>>


printenv bootm

Code: Select all
Marvell>> printenv bootm
printenv bootm
## Error: "bootm" not defined


printenv usbstart

Code: Select all
Marvell>> printenv usbstart
printenv usbstart
usbstart=gpio clear 59
Last edited by TonyP on Wed May 23, 2018 9:36 pm, edited 1 time in total.
TonyP
 
Posts: 18
Joined: Wed May 16, 2018 9:27 am
Location: Australia

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Wed May 23, 2018 4:04 pm

It is different boot setup than Lacie. So to see no fall back to old lacie setup with kernel on sda6. Need to have closer look to printenv output but today no time as my son has its birthday.
The kernel on sda2 is huge and based on device tree.
Seems alo possible to boot this device from usb

Ps I think you did not capture all printenv output (first line with output you posted start with =, thats not normal. Also I do not see the bootm command.
You could list t that with command
Code: Select all
printenv bootm
also "usbstart" command is of interest
Code: Select all
printenv usbstart
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby fvdw » Wed May 23, 2018 4:20 pm

Also it would be intersting to know if we can set environment variable which are not reset by uboot at next boot.
To test this you could set an environment variabele like this
On the marvell prompt
Code: Select all
test =test-command
saveenv

Reboot and go in uboot terminal and check if parameter test is still there. If that works we could modify for instance bootm command or the command that uses bootm
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Installing FVDW on a Seagate Personal Cloud

Postby TonyP » Wed May 23, 2018 9:54 pm

I have edited the output of printenv above, and added the outputs of printenv bootm and printenv usbstart.

fvdw wrote:Also it would be intersting to know if we can set environment variable which are not reset by uboot at next boot.
To test this you could set an environment variabele like this
On the marvell prompt
Code: Select all
test =test-command
saveenv

Reboot and go in uboot terminal and check if parameter test is still there. If that works we could modify for instance bootm command or the command that uses bootm


It did not save. I took a look at some Uboot docs here https://www.denx.de/wiki/DULG/UBootCmdGroupEnvironment and used
Code: Select all
setenv test test-command
savenv

and successfully see 'test=test-command' after rebooting.

fvdw wrote:Need to have closer look to printenv output but today no time as my son has its birthday.


:woohoo Happy Birthday to little Fvdw! :woohoo
TonyP
 
Posts: 18
Joined: Wed May 16, 2018 9:27 am
Location: Australia

Next

Return to Seagate personal cloud

Who is online

Users browsing this forum: No registered users and 2 guests

cron