Clean OS (Debian), OpenMediaVault and other "firmwares"

Michels wrote:

@mariogolf

 

You saved the install with windows line endings.

Change to unix with

   dos2unix install.sh

 

If dos2unix is not available google for “bash windows to unix line endings”

I never open or save install.sh on windows and I always work in a debian shell and in wd’s bash shell where I correctly read the file.

BTW, conversion goes ok and script is running.

WD is rebooting now!

Thank you, antoher time! :wink:

Mario

@Fox_exe

This is shell output:

WDMyCloud3t:/DataVolume/shares/Public/clean-debian_OMV# ./install.sh 
Ok, lets go...
Current device: /dev/md0
Upgrade device: /dev/md1
################################################
Stop all processes...
forked-daapd: no process found
[ok] Stopping periodic command scheduler: cron.
[ok] Stopping standby monitor: monitorio.
[ok] Stopping temperature monitor: monitorTemperature.
PID file /var/run/mediaserver.pid not found, stopping server anyway...

[ok] Stopping itunes server: forked-daapd.
[ok] Stopping wdphotodbmerger: wdphotodbmerger.
[ok] Stopping wdmcserver: wdmcserver.
[ok] Stopping Samba daemons: nmbd smbd.
Stopping Netatalk Daemons: afpd.
[ok] Stopping upnp nas device: upnpnasd.
[ok] Stopping wdnotifier: wdnotifier.
[ok] Stopping wdnotifier: wdnotifier.
[ok] Stopping NFS kernel daemon: mountd nfsd.
[ok] Unexporting directories for NFS kernel daemon....
[ok] Stopping NFS common utilities:.
Recreate mdraid partitions:
Restoring raid...
Current md's status:
Personalities : [raid1] 
md0 : active raid1 sda2[1] sda1[0]
      1999808 blocks [2/2] [UU]
      
unused devices: <none>
Creating new partition...
mdadm: set /dev/sda1 faulty in /dev/md0
mdadm: hot removed /dev/sda1 from /dev/md0
Installing new data...
mount: you must specify the filesystem type
umount: /tmp/hdd: not mounted
Done! Cleanup...
Reboot to take effect...

Is it all rights?

Now WD is unreachable, no ping, no webgui… Led seems white.

I wait, but I am afraid… I only understand that sda1 was not write…

What I have to do?

mariogolf wrote:

@Fox_exe

 

This is shell output:

 

WDMyCloud3t:/DataVolume/shares/Public/clean-debian_OMV# ./install.sh
Ok, lets go…
Current device: /dev/md0
Upgrade device: /dev/md1
################################################
Stop all processes…
forked-daapd: no process found
[ok] Stopping periodic command scheduler: cron.
[ok] Stopping standby monitor: monitorio.
[ok] Stopping temperature monitor: monitorTemperature.
PID file /var/run/mediaserver.pid not found, stopping server anyway…

[ok] Stopping itunes server: forked-daapd.
[ok] Stopping wdphotodbmerger: wdphotodbmerger.
[ok] Stopping wdmcserver: wdmcserver.
[ok] Stopping Samba daemons: nmbd smbd.
Stopping Netatalk Daemons: afpd.
[ok] Stopping upnp nas device: upnpnasd.
[ok] Stopping wdnotifier: wdnotifier.
[ok] Stopping wdnotifier: wdnotifier.
[ok] Stopping NFS kernel daemon: mountd nfsd.
[ok] Unexporting directories for NFS kernel daemon…
[ok] Stopping NFS common utilities:.
Recreate mdraid partitions:
Restoring raid…
Current md’s status:
Personalities : [raid1]
md0 : active raid1 sda2[1] sda1[0]
1999808 blocks [2/2] [UU]

unused devices:
Creating new partition…
mdadm: set /dev/sda1 faulty in /dev/md0
mdadm: hot removed /dev/sda1 from /dev/md0
Installing new data…
mount: you must specify the filesystem type
umount: /tmp/hdd: not mounted
Done! Cleanup…
Reboot to take effect…

Is it all rights?

Now WD is unreachable, no ping, no webgui… Led seems white.

 

I wait, but I am afraid… I only understand that sda1 was not write…

 

What I have to do?

It’s clear: I broke my MyCloud… :dizzy_face: I fell frustated…

I wolud like to know why the script failed… and why to me?? :angry: “The answer is blowing in the wind…”, sang someone.

I have to debrick my device. I don’t like disassembly it. So, I ask you.

Is there a way to format a usb/hdd drive putting into the root image so MyCloud will boot from usb external drive, instead from internal hd? In this way I can fix via ssh… Is it a bad/utopic idea? more or less as an iso live image for PC…

If no, I need help… have anyone some feedbacks/trips/tips how to disassembly my MyCloud keeping good the enclosure?

Thanks!

Seems all ok…

One thing - rootfs.img unpacked with errors (Sometime its happens if unpack by GUI archiver).

I think i fix it by using .tar.gz instead of .zip…

For now - you need disasemble wdmc and connect HDD to PC. No another ways now :frowning:

@Fox_exe:

I agree. gzip is best than zip archives.

I opened wdmc and connected the disk to my pc.

Now I’m copying my files from share to other disks (for about 1,3 Tb :neutral_face: )

Then I think to do (wdmc’s disk is /dev/sdd ):

  1. I see two md array so I have to stop them with

mdadm --stop /dev/md126

mdadm --stop /dev/md127

  1. recreate the correct raid

mdadm --create /dev/md0 --level=1 --metadata=0.9 --raid-devices=2 /dev/sdd1 /dev/sdd2

  1. write images with dd:

dd if=rootfs.img of=/dev/md0
dd if=kernel.img of=/dev/sdd5

dd if=config_md0.img of=/dev/sdd7

sync

  1. reassemble the wdmc and boot it.

I desume this steps from your install.sh: are they correct?

Have I to write also sdd8?

Please tell me everything to have success!

Thank you for your patience!

Mario

mariogolf,

Run this after  first step:

mdadm --zero-superblock --force --verbose /dev/sdd1
mdadm --zero-superblock --force --verbose /dev/sdd2

nice thread !

Actually this is the one that made me buy a such device…

I’d like to help community by docummenting the whole process to install debian from scratch on this hardware

first a couple of questions

1/ is there a way to login uboot ? uart / netconsole

2/ can I boot an other disk without touching the ROM

3/ is all the hw adaptation code opensourced ?

Regards see you

rzrfreefr wrote:

nice thread !

 

1/ is there a way to login uboot ? uart / netconsole

2/ can I boot an other disk without touching the ROM

3/ is all the hw adaptation code opensourced ?

 

  1. Yes, UART. (Barebox sourcecode also available)
  2. Yes. Boot options (Boot script) placet on HDD (Inside 7th partition)
  3. Kernel sources can be downloaded from WD’s official site (GPL)

All other useful thing you can see in my Google.drive folder.

Priviet !

I managed to displace my backuped files to spare disk (40GB) one (the backup is fits on one CDR)

Now I plan to debbootstap debian into the data part or even better on usb stick 

the challenge would be make it compatible without touching the uboot conf or stoke firmware

or at least minimal changes that can be reverted easily…

Next job would be to rebuild all sources provided by WD and upstream what need to be upstreamed, this is not a fast job so any support is welcome…

I can document all that online , if you want

Da vidagne

Fox_exe wrote:

mariogolf,

 

Run this after  first step:

mdadm --zero-superblock --force --verbose /dev/sdd1
mdadm --zero-superblock --force --verbose /dev/sdd2

 

Ok, thank you Fox!

I tried to run with your tips, but my wdmc won’t boot… :confounded:

White led is turn on. No ping…  :cry:

How can i fix?

Can you help me, again?

Mario

What arhive you use?

Try original_v3.04.01-230.tar.gz (For restore original v3 firmware)

For clean debian use Kernel and rootfs v3.7z (use p7zip for extract)

* Sometime .zip arhives extract with errors (Because i use 7zip for create hem)

* Compare md5 sums:

dd if=rootfs.img bs=64k count=31247 | md5sum
dd if=/dev/md0 bs=64k count=31247 | md5sum

Its must be same (See .md5 file in arhive to check)

Fox_exe wrote:

What arhive you use?

Try original_v3.04.01-230.tar.gz (For restore original v3 firmware)

For clean debian use Kernel and rootfs v3.7z (use p7zip for extract)

* Sometime .zip arhives extract with errors (Because i use 7zip for create hem)

* Compare md5 sums:

dd if=rootfs.img bs=64k count=31247 | md5sum
dd if=/dev/md0 bs=64k count=31247 | md5sum

Its must be same (See .md5 file in arhive to check)

Hi Fox, thank for your help!

md5sum of my rootfs.img is

d41d8cd98f00b204e9800998ecf8427e

First of all: Is it right?

(for md0, now I power off the system, plug the disk, turn on and calculate the md5sum of md0)

mariogolf wrote:


Fox_exe wrote:

What arhive you use?

 

Try original_v3.04.01-230.tar.gz (For restore original v3 firmware)

For clean debian use Kernel and rootfs v3.7z (use p7zip for extract)

* Sometime .zip arhives extract with errors (Because i use 7zip for create hem)

* Compare md5 sums:

dd if=rootfs.img bs=64k count=31247 | md5sum
dd if=/dev/md0 bs=64k count=31247 | md5sum

Its must be same (See .md5 file in arhive to check)


Hi Fox, thank for your help!

md5sum of my rootfs.img is

d41d8cd98f00b204e9800998ecf8427e

First of all: Is it right?

(for md0, now I power off the system, plug the disk, turn on and calculate the md5sum of md0)

 

Same md5sum of my rootfs.img for /dev/md0 .

Yesterday I downloaded

“debian_wheezy_omv_1.0.23.zip” (md5sum ac586235c7c9816703fc31acf983e516 ) with inside:

ceaf83959498c0bb34fffc8ab5db77bb  kernel.img
192125cb31cb93f241f60be9887aa514  rootfs.img

“Autoinstall.zip” (md5sum 9cdbc542c33698101a5f4902162ec218) with inside:

6fdf983068dbed31b91a71b7b531ff7b  config_md0.img
c706bcac3b4d16e4f6f1115d0feff5b3  config_md1.img
b242d9c71be821d53e63afe65bf6c95a  install.sh
de70f9a259a8874ea5e931ff89e99fa3  run_me_after_reboot.sh

Is they the same of your original files?

Or - the same thing - where I find original/your md5sum ?

Because I didn’t find it in your goggle drive folder.

I installed p7zip but it is only for compress file.  How can I decompress by cli ypur .zip files?

I suppose that google drive can “open” zip archives and text files, so it modify them. I think this is the cause of change of the install.sh line endings.

So, can you give me another link to files, not stored in google drive?

Thank you so much!

Mario

Sorry, for my long post: I want fix as soon as possible…

Hi everyone. Thanks Fox_exe for your great contribution. I’ve been running OMV for a month without issues.

I’ve made a small script to control the leds when accessing MyCloud in read or write.

I’ve created a Debian package that you can download from : https://sites.google.com/site/4rc4n3s/mycloud/hwdleds

This script is still in development and needs some feedback.

Thanks again for your work.

Regards.

Hi, I have followed the instructions to replace samba 3 for samba 4, now samba is not working for me.

root@MyCloud:~# ‘smbstatus’ --version
Version 3.6.6

I have installed OMV last version.

Any help??

HI again, thanks for your answers.

I have a couple more 

what is the advantage of installing OMV or owncloud? is wd mycloud OS limited in some way?

my concerns are only with filetype and partitions, and linux.

  1. if by any chance Ithe hardware part of my cloud stops working can I recover my files without any issues from my cloud O.S or owncloud/OMV?

  2. when you refeer to install clean debia, it is installing the core of linux, then you add the user interfacwe (OMV or owncloud)

  3. where is my cloud OS limited against owncloud or OMV.

  4. is it possible to configurte iOS to upload photos and video automatically? or setting up the iCloud folder inside the NAS?

I want this NAS to work as a backup machine for my iPhone, and Sync a folder trough NAS - PC Win8.1 - MacBook, mostly a replacement for dropbox. I have my PC with a Plex server, and torrents on a seedbox, also a hosting server so no need for this on my NAS. 

Sorry I know it must be a super newbie question, just trying to understand what option is better for me. Thanks Again.

News by my odyssey…

Today I replaced original firmware ( original_v4.01.02-417.tar.gz ) successfully.

But I’m not happy about it… I want to install a clean debian with/without OMV on my wdmc!

But I would not want to risk bricking it yet! So…

@Fox-exe:

can you post the md5sum of your files and image? So we can check our downloaded files and images!

Thank you!

Mario

juanmiglesias,

  • OMV provide better interface and more options and tools.
  • If something went wrong - you can connect internal HDD to any PC and download your files or restore firmware (Need Linux live CD or USB)
  • You can use Cleand debian and install inside what you want (OMV, WebMin or something else, what compiled for arm)
  • WDMC has limited kernel (No loop-dev, USB-sound/WiFi/Lan and some other useful things).
    No extra options for internal software (Twonky, samba etc) in webgui
    On v4 fw system used PageSize 64k (vs 4k in normal systems). So - need recompile all software for that.
    On v3 fw - cant install some software because its can crash device (You get a brick)
    And more…
  • I make clean debian for one thing - i want install what I want. Nothing excess.
  • About Apple devices - you can use OwnCloud or Libimobiledevice for sync data. (Or just upload files by NFS/Samba/FTP manually).
    Another way - BTSync and similar software.
    Also you can connect Google drive, Dropbox, OneDrive and other “Cloud” storages
  • So… With Clean debian - you can make of it anything! :smiley:

Update:

  • Added MD5 sums to all arhives.
  • Repacked all zip’s to tar.gz
  • MD5 for rootfs.img (OMV 1.0.23): c981178314917b26677eccbb6db68b2d

Fox_exe wrote:

Update:

  • Added MD5 sums to all arhives.
  • Repacked all zip’s to tar.gz
  • MD5 for rootfs.img (OMV 1.0.23): c981178314917b26677eccbb6db68b2d

Thank you so much, Fox! Great work!

Today I manually copied with dd the new files that you repacked, and now all is running in my new free wdmc!! :smileyvery-happy:

I’m really happy!

make +1 to the list of user that run your images on wdmc!

Thank you again!

I’ve a question: When wdmc goes poweroff, is the led corol always green after completed poweroff?

bye, Mario

mariogolf wrote:> I’ve a question: When wdmc goes poweroff, is the led corol always green after completed poweroff?

Hmm. No, he switch to yellow, then - to white.

Its controlled by /etc/init.d/wd-leds.sh

 Example wd-leds.sh:

#! /bin/sh

### BEGIN INIT INFO
# Provides: led_init
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 1 2 3 4 5 6
# Default-Stop: 0 6
# Short-Description: Start daemon at boot time
# Description: Set LED color at start/stop.
### END INIT INFO

case "$1" in
  start)
    echo "Set LED to Green"
    echo green > /sys/class/leds/system_led/color
    ;;
  stop)
    echo "Set LED to yellow"
    echo yellow > /sys/class/leds/system_led/color
    ;;
  *)
    echo "Usage: /etc/init.d/led_boot {start|stop}"
    exit 1
    ;;
esac

chmod a+x /etc/init.d/wd-leds.sh

update-rc.d wd-leds.sh defaults