fvdw-sl on WD My Cloud

Re: fvdw-sl on WD My Cloud

Postby Mijzelf » Mon Aug 08, 2022 6:08 pm

That Comcerto 2000 chip is unfortunately not in the mainline kernel. It's the same chip which is in the ZyXEL NAS500 series, and in the Synology DS414j. They all run the same old 3.2 kernel. I know some people have tried to get a new kernel running, but this SoC it deviates quite a bit. Especially the NIC seems to be a problem.
Anyway, in case you are interested, here you can find the GPL sources for the NAS542, containing the kernel sources.
Mijzelf
 
Posts: 254
Joined: Wed Nov 21, 2012 9:12 am

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Aug 08, 2022 8:08 pm

Thanks mijzelf for this tip, that will be helpfull if the wd kernel doesn't fullfill our needs.Compiling our own kernel will a possible next step

ps I found this kernel setup file probably to be used with kernel source code in gpl of WD
You do not have the required permissions to view the files attached to this post.
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 » Mon Aug 08, 2022 8:25 pm

Thx matt_max for the info. In principle we could make an adapted fvdw-sl image to put in /dev/md0 but it will require a lot of adaptations in the firmware setup. I rather prefer to change the partition structure and root file system loading. For that the way to go seems to be adapting the script in partition 7 (part 8 is same as 7 only used as backup when part 7 is corrupt.


Now about partition 7 and 8, indeed they contain data used by barebox to boot the device. However there is more inside then the script yu posted.
It contains an additional 44 bytes in which info is stored to check crc. Editing the file will result in crc check error when barebox reads the content of this partition
hex-output-part7-content.JPG

Even changing a single byte in this script will require update of crc check values.
I am not sure if barebox write at each boot to partition 7 and 8 before starting the device. If that is the case adapting partition 7 or 8 is useless as it will be overwritten at each boot. In that case we will have to modify the file /usr/share/k1m0.env in the rootfs of barebox in flash.
For the moment I suggest to leave that alone. Lets first try to adapt part 7 assuming part 7 is not overwritten at each boot.
In that case we can modify the script in partition 7 but we will need to update the crc check values as well.
I found a guide here link how to do that. I will need to read that in detail and try to adapt the image of partition 7. After that you can put the new image in partition 7 and we will see if barebox complains or not.

I suggest that using your linux pc you make partition images of all partitions on the wd cloud disk (except partition 4) using dd command that will enable us to roll back if we make an error.
You do not have the required permissions to view the files attached to this post.
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 » Mon Aug 08, 2022 9:50 pm

for testing I modified partition 7 image to load kernel from partition 6 iso partition 5

To test it you should writ the new image using dd to partition 7 and 8
assuming wd disk is /dev/sdb on your linux pc
Code: Select all
dd if=config-new.img of=/dev/sdb7
dd if=config-new.img of=/dev/sdb8


Put the disk in your wd cloud with serial console active and see if you get crc erro or not.

PS before writing the new image don't forget to make backup of content partition 7 and 8 using dd as mentioned earlier
You do not have the required permissions to view the files attached to this post.
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 » Tue Aug 09, 2022 8:27 am

You are right. According to what I find here crc is calculated for both kernel config partitions.

First I will try to make backup of all partitions I recreate them on smaller spare disc (I've got 500Gb 2,5" blank disc) and then try to use it with wd cloud. When I check if everything is working fine we can use this new disc for testing purposes.
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 Jocko » Tue Aug 09, 2022 3:08 pm

@fvdw
fvdw wrote: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.
I am agree with your suggestions but I believe it would be better to keep partition 4 as data partition.
Indeed if we use partition 8 instead it may be not safe if on some events barebox wants to backup partition 7 on it. I assume we can only change this behaviour only by writing a patched barebox in flash memory :?
fvdw wrote:Thx matt_max for the info. In principle we could make an adapted fvdw-sl image to put in /dev/md0 but it will require a lot of adaptations in the firmware setup. I rather prefer to change the partition structure and root file system loading. For that the way to go seems to be adapting the script in partition 7 (part 8 is same as 7 only used as backup when part 7 is corrupt.
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 matt_max » Tue Aug 09, 2022 10:21 pm

I'm still trying to use my spare disc with wd. When I recreate partitions and put there images that I made with dd I was able to log in at the dashboard but I there was 0 bytes of free space available.
When I logged in with ssh I found that data partition wasn't initialise (due to using different version of fsck):
Code: Select all
EXT4-fs (sda4): couldn't mount RDWR because of unsupported optional features (400)

After reformat /dev/sda4 (data) partition information about error disappeared from logs but now dashboard do not show any information and I'm not able to create shares and set privileges.

So now I still do not have working copy of original disc - I need more time to figure out what is going on and what I need to do.
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 » Wed Aug 10, 2022 8:35 am

After reformat /dev/sda4 (data) partition information about error disappeared from logs but now dashboard do not show any information and I'm not able to create shares and set privileges.


What command did you use to format partition 4?
It should have been something like this
Code: Select all
mke2fs -t ext4 -m 1 /dev/sda4
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 » Wed Aug 10, 2022 9:13 am

Hi

it would be nice to see there are not some custom option set on the ext4 partition with the original disk.

So if I assume you have plugged it on your isp1 and it uses sdb as kernel node, please to post
Code: Select all
tune2fs -l /dev/sdb4
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 matt_max » Wed Aug 10, 2022 9:35 am

After I connected new disc to my linux machine I used standard mkfs.ext4 /dev/sda4 command. I think there was a problem with different version of this tool. When I reformat sda4 partition using the same command but in wd system - error disappeared.
In an act of desperation I've done Full Restore from Utilities->System Factory Restore-> Full Restore and went to sleep.

factory_reset2.jpg


Today I see that every standard shares where recreated and wd show me all informations (free disc space etc.).

dashboard.jpg


I'm at the office right now - when I came back home first I will check if everything is ok with shares and privileges and then I will try to write that new image on partition 7 and 8.
You do not have the required permissions to view the files attached to this post.
Last edited by matt_max on Wed Aug 10, 2022 5:49 pm, edited 1 time in total.
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