fvdw-sl on WD My Cloud

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Jul 03, 2022 9:03 pm

This is the dump file from Windbond 25X40CLVIG chip. You can download it from mediafire.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 01, 2022 12:14 pm

@fvdw Any news?
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Tue Aug 02, 2022 3:24 pm

Sorry to keep you waiting but I will try to have look later this week. There are currently some private issues that need my time.
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby fvdw » Sat Aug 06, 2022 3:54 pm

reading the link on how to install archlinux I think this could be a trial

According that link the disk has 8 partitions
Partition 1 & 2 = /dev/md0 raid 1 partition
Partition 3 = Swap
Partition 4 = all the data
Partition 5 & 6 = Kernel, and backup
Partition 7 & 8 = barebox configuration

Barebox boots the configuration located on partition 7 if it's corrupt, it will load partition 8, both environment configuration loads kernel from partition 5 and uses /dev/md0 as root file system.

If you don't want to touch barebox configuration, the easiest way to install fvdw-sl could be deleting content of /dev/md0, make raid /dev/md0 only using only one partition and putting a (modified) fvdw-sl root file system on it. We will need a modified root file system as the current partition table is not compatible to run standard fvdw-sl

This will use the wd kernel already existing on the system. It is of course possible that this kernel may not support all features of fvdw-sl. But lets see what it does.

The issue is now how to adapt /dev/md0 and getting modified fvdw-sl on /dev/md0.
I have no knowledge on how to do that in barebox.
A possible way that could work is take the disk out of the wdcloud, connect it to sata usb interface and connect that to you lacie nas isp1 (I assume you have al acie isp1). Then assemble the raid array and mount it on your lacie and look to the content,.
Then next steps coukld be erase the content and adapt the array to use only partition 1 and extract the modified fvdw-sl archive to it and use partition 2 for fvdw-sl database or even modify the partition table. For that we need more info.

I assume you are willing to try the route of using your isp1.
After connecting the wdcloud disk to usb you should see as disk sdb and it should have 8 partitons.
You could check that using.
Code: Select all
gdisk -l /dev/sdb

Post the output

I am a little confused about that two partitions of the same disk are used for the raid 1 array /dev/md0, normally you use for raid two different disks.
Anyhow to assembe the raid array I think you should give this command

Code: Select all
mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdb2


when that goes ok try to mount it

Code: Select all
mkdir /md0
mount /dev/md0 /md0


If that goes ok check content of directory /md0
Code: Select all
ls /md0

post the output if possible


PS I am not a raid expert so maybe Jocko can give some additional help here if assembling fails,
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby Jocko » Sat Aug 06, 2022 6:36 pm

Hi

@fvdw
fvdw wrote:I am a little confused about that two partitions of the same disk are used for the raid 1 array /dev/md0, normally you use for raid two different disks.
Anyhow to assembe the raid array I think you should give this command
There is no issue to use two partitions of a same disk in a raid1. I assume wd set it to have two synchronized partitions. of course it is less secure than if you have two disks
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: fvdw-sl on WD My Cloud

Postby fvdw » Sat Aug 06, 2022 6:54 pm

Thx Jocko, it is also possible that they use just one partition as there are wd clouds with multiple disks. Then probably partition. 1 and 2 are used to be able to install update of firmware and swap partition at next boot.In that case the raid is on a single disk probably only covering 1 partition. I found some info on internet on size of /dev/md0. It was the size of 1 partition. This would confirm my hypothesis.
In case of multiple disks myclouds the raid is assembled using partitions1 or 2 of all disks. In that setup using raid has some benefits in case one disk fails
This means the barebox environment on partition 7 (or 8) determines which partition 1 or 2 to use to assemble the raid.

Matt_max.
It would be good if you have connected the disk to your isp1 to mount partion 7 and 8 and post content. Maybe we can adapt the environment to our needs to run fvdw-sl
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Aug 07, 2022 6:28 pm

Ok guys,
So tomorrow I wil try to connect disc from wd thru usb adapter to my linux test pc and assemble md0 fake raid (software) partition and check what's inside. Then I will try to connect that disc to the isp1 and start it from there (correct me if I'm wrong).
In the meantime I will try to cross-compile new version of BareBox. According to this link it is possible to boot linux kernel (especially fvdw-sl kernel) to check if it gonna run.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Sun Aug 07, 2022 6:46 pm

Remark putting wdcloud disk into isp1 is useless.
It wiil not boot because bootloader of isp1 is different and isp1 needs another kernel.
Also recompiling barebox is not required. We should be able to adapt environment in partition 7 or 8 to make it load fvdw-sl and using an adapted partition table.
Be aware that barebox is in flash memory. If you replace it with another version the device will be bricked in case this new version is not suitable for this device. I would for the moment leave barebox as it is.
We will need to see what is inside partiton 7 and 8 if it is possible to adapt barebox environment to our needs.

In the meantime I also found a kernel config file that could be used to compile our own kernel and required modules

this is probably the current partition table
Code: Select all
Model: ATA WDC WD20EFRX-68E (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system     Name     Flags
 3      15.7MB  528MB   513MB   linux-swap(v1)  primary
 1      528MB   2576MB  2048MB  ext3            primary  raid
 2      2576MB  4624MB  2048MB  ext3            primary  raid
 5      4624MB  4724MB  99.6MB                  primary
 6      4724MB  4824MB  101MB                   primary
 7      4824MB  4826MB  1049kB                  primary
 8      4826MB  4828MB  2097kB                  primary
 4      4828MB  2000GB  1996GB  ext4            primary

we could use existing partition 1 and 2 for fvdw-sl root file system
we can use existing partition 3 for swap
we can use partition 4 for shared folders
I would like to use partition 5 for our fvdw-sl database (will need to enlarge te partition)
we can use partition 6 for the kernel
As barebox tries to load kernel from partition 5 we will need to adapt barebox environment if it can be changed to partition 6.
Otherwise we could use partition 6 for fvdw-sl database
And in case barebox doesn't really need partition 8 I would prefer to use partition 8 for shared folders instead of partition 4

As said we will need to see what is inside partiton 7 and 8 if it is possible to adapt barebox environment to our needs.
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Aug 07, 2022 7:18 pm

Even if I replace barebox (and brick the device) I can always put back the original one that I dump from Windbond 25X40CLVIG chip. Of course it will be easer to adopt fvdw-sl and leave barerbox as is.
It should be easy to just change the boot config files (used by barebox) and permanently write it to the eprom but I think I've got your point to make changes as simple as possible for all that future users who
will maybe want to install fvdw-sl on their wd disks.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby matt_max » Mon Aug 08, 2022 8:43 am

That is my gdisk -l output:
Code: Select all
GPT fdisk (gdisk) version 1.0.9

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 11721045168 sectors, 5.5 TiB
Model: EFRX-68MYMN1   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 2F3EF18F-B093-438B-8853-954EE38345CA
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 11721045134
Partitions will be aligned on 2048-sector boundaries
Total free space is 31853 sectors (15.6 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1         1032192         5031935   1.9 GiB     FD00  primary
   2         5031936         9031679   1.9 GiB     FD00  primary
   3           30720         1032191   489.0 MiB   0700  primary
   4         9428992     11721043967   5.5 TiB     0700  primary
   5         9031680         9226239   95.0 MiB    0700  primary
   6         9226240         9422847   96.0 MiB    0700  primary
   7         9422848         9424895   1024.0 KiB  0700  primary
   8         9424896         9428991   2.0 MiB     0700  primary


After assembling md I was able to mount it and that is the content of this partition:
Code: Select all
total 104
drwxr-xr-x  3 root root      4096 Jun  7 12:00 CacheVolume
drwxr-xr-x  2 root root      4096 Jan 10  2022 DataVolume
drwxr-xr-x  2 root root      4096 Jun  7 12:04 bin
drwxr-xr-x  2 root root      4096 Jun  7 11:59 boot
drwxr-xr-x  3 root root      4096 Jun  3  2013 dev
drwxr-xr-x 78 root root      4096 Jun 10 14:02 etc
drwxr-xr-x  2 root root      4096 Sep  9  2013 home
drwxr-xr-x 14 root root      4096 Jun  8 14:20 lib
drwx------  2 root root     16384 Jan 10  2022 lost+found
drwxr-xr-x  2 root root      4096 Sep 27  2013 media
drwxr-xr-x  2 root root      4096 Sep  9  2013 mnt
drwxr-xr-x  6 root root      4096 Jan 10  2022 nfs
drwxr-xr-x  2 root root      4096 Sep 27  2013 opt
drwxr-xr-x  2 root root      4096 Sep  9  2013 proc
drwx------  2 root root      4096 Jan 10  2022 root
drwxr-xr-x  8 root root      4096 Jul 12  2012 run
drwxr-xr-x  2 root root      4096 Jun  8 14:20 sbin
lrwxrwxrwx  1 root root        18 Jan 10  2022 shares -> /DataVolume/shares
drwxr-xr-x  3 root root      4096 Jan 10  2022 srv
drwxr-xr-x  2 root root      4096 Sep  9  2013 sys
drwxrwxr-x  3 root liveuser  4096 Jun  7 12:04 system
drwxrwxrwt  2 root root      4096 Jun 10 14:02 tmp
drwxr-xr-x 10 root root      4096 Sep 27  2013 usr
drwxr-xr-x 13 root root      4096 Jun  7 12:04 var


I wasn't able to mount partition 7 and 8:
Code: Select all
mount: /mnt/part8: wrong fs type, bad option, bad superblock on /dev/sdb8, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
                                                                         

But I dd all of data and after additional examination (binwalk is your friend) I found that there is only one script file on both partitions.
Here are the content:
Code: Select all
#!/bin/sh
## Button initial state
btn_status=0
get_button_status
sata
satapart 0x3008000 5 0x5000
sata stop
# This is customized for each environment variable script
bootargs="console=ttyS0,115200n8, init=/sbin/init"
bootargs="$bootargs root=/dev/md0 raid=autodetect"
bootargs="$bootargs rootfstype=ext3 rw noinitrd debug initcall_debug swapaccount=1 panic=3"
bootargs="$bootargs mac_addr=$eth0.ethaddr"
bootargs="$bootargs model=$model serial=$serial board_test=$board_test btn_status=$btn_status"
bootm /dev/mem.uImage
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron