My cloud western digital linux

WD My Cloud Home to Linux Server – 2. Installation / Openmediavault

There is a new and easy way of installing Debian Linux with or without Openmediavault.
For those of you who speak russian, find latest instructions and download link at the 4PDA forum:
https://4pda.to/forum/index.php?showtopic=467828&view=findpost&p=110514773
Everybody else, stay here and download from this mirror, if the 4PDA link is down.

1. Create the USB installer.
You need a USB stick of about 500MB, formatted with FAT32(MBR!). Just unpack the zip you downloaded to the USB stick and wait until it is finished and safely eject it. 😉

2. Install
Put the USB drive in the USB port of your WD My Cloud Home, hold the reset switch down while you connect the power and hold it until the light stops flashing.

The installer does not automatically install anything. You need to connect via Telnet first. Windows should have a telnet client onboard. Otherwise you can use the Termux Android app (e.g. in the F-droid store). Connect to your MCH via Telnet:

telnet [the IP address of your MCH]

  1. Backup (optional)
    If you want to back up your current partitions, you can enter the following commands:
    mkdir -p /mnt/flash/WD
    dd if=/dev/sda1 of=/mnt/flash/WD/01-FW_TABLE.bin
    dd if=/dev/sda2 of=/mnt/flash/WD/02-KERNEL_A.bin
    dd if=/dev/sda3 of=/mnt/flash/WD/03-ROOTFS_A.bin
    dd if=/dev/sda4 of=/mnt/flash/WD/04-ROOTFS_B.bin
    dd if=/dev/sda5 of=/mnt/flash/WD/05-FDT_A.bin
    dd if=/dev/sda6 of=/mnt/flash/WD/06-FDT_B.bin
    dd if=/dev/sda7 of=/mnt/flash/WD/07-AFW_A.bin
    dd if=/dev/sda8 of=/mnt/flash/WD/08-KERNEL_B.bin
    dd if=/dev/sda9 of=/mnt/flash/WD/09-ROOTFS_GOLD.bin
    dd if=/dev/sda10 of=/mnt/flash/WD/10-FDT_GOLD.bin
    dd if=/dev/sda11 of=/mnt/flash/WD/11-AFW_B.bin
    dd if=/dev/sda12 of=/mnt/flash/WD/12-BOOTCODE32.bin
    dd if=/dev/sda13 of=/mnt/flash/WD/13-BOOTCODE64.bin
    dd if=/dev/sda14 of=/mnt/flash/WD/14-BL31.bin
    dd if=/dev/sda15 of=/mnt/flash/WD/15-BL32.bin
    dd if=/dev/sda16 of=/mnt/flash/WD/16-KERNEL_GOLD.bin
    dd if=/dev/sda17 of=/mnt/flash/WD/17-AFW_GOLD.bin
    dd if=/dev/sda18 of=/mnt/flash/WD/18-CONFIG.bin
    dd if=/dev/sda19 of=/mnt/flash/WD/19-SYSTEM_A.bin
    dd if=/dev/sda20 of=/mnt/flash/WD/20-SYSTEM_B.bin
    dd if=/dev/sda21 of=/mnt/flash/WD/21-CACHE.bin
    dd if=/dev/sda22 of=/mnt/flash/WD/22-DATA.bin
    dd if=/dev/sda23 of=/mnt/flash/WD/23-SWAP.bin

This will copy all your partitions, EXCEPT FOR YOUR DATA to the usb stick. And your USB stick must be larger if you want to create a backup.

  1. Create partition table and install the OS
    Execute the script that resizes your partitions (make a backup first).

After the script ran through you need to issue the following command before rebooting:

cd / ; umount /mnt/* ; sync ; busybox reboot

Do not let the device reboot by itself. Again, hold the reset switch when you connect power and only release it when the light stops flashing.

telnet [the IP address of your MCH]

Check your partition table

Run the script that installs the OS

If you come from the stock firmware you must wipe the data partition. If you come from a prior installation of Linux, you can keep your data by not executing the following command:

Читайте также:  Установка даты линукс date

make_ext4fs -L UsersFolders /dev/sda21

After all this is done, reboot the device:

cd / ; umount /mnt/* ; sync ; busybox reboot

You can log in to your new linux server with SSH

ssh root@[the IP address of your MCH , which might have changed]. You can try ssh root@wdmch

You are now logged in to your Linux server. Congratulations!

Now it depends on what you want to run upon Debian. I describe three variants.
A – Set up a file server manually by setting up Samba, NFS, Seafile etc.
B – Install Openmediavault
C – Install DietPi, a script that installs various servers.

If you want to install DietPi, do not execute any of the commands below, but continue straight with the blog post on DietPi!

Variant A – Set up a Linux server manually (for Openmediavault, read Variant B)

If you do not want to install openmediavault, you can start by mounting the data partition.
I create the mountpoint for the data partition in /mnt/data . You can also choose another mount point like e.g. /media/files etc.

First the path must exist
mkdir /mnt/data

Then the mountpoint must be created in the fstab file which holds all mount points:
nano /etc/fstab

Add a line to mount partition 21 which is your data partition.
/dev/sda21 /mnt/data ext4 defaults 0 0

Save changes with ctrl+o and exit with ctrl+x
Mount it first with the following command. After the next reboot it will mount automatically.

A5. Tuning if you did not install OMV

You can switch the kernel version, enter any of below commands (a reboot will occur)

/boot/bootA #ver.4.9.266 + GPU (RAM ~ 750MB)
/boot/bootB #ver.4.9.266 -GPU (RAM ~ 1GB)
/boot/bootG #ver.4.1.17 -GPU (RAM ~ 1GB)
I use BootB as I do not need GPU acceleration. If you successfully tested GPU transcoding e.g. for Plex, please comment.

To have less writes to the HD execute the following commands:
echo ‚kernel.printk = 3 4 1 3‘ >> /etc/sysctl.conf
echo ‚debug.exception-trace = 0‘ >> /etc/sysctl.conf
echo ‚vm.swappiness = 30‘ >> /etc/sysctl.conf

clear the logs :
echo > /var/log/messages ; echo > /var/log/syslog ; echo > /var/log/kern.log
etc..pp…

Also, the folder and its contents / var / log / journal / * / grow to indecent sizes measured by gigabytes – reduce it to 32MB (option 1) or completely turn off (option 2) :

Save the configuration in the file and restart the service:

systemctl restart systemd-journald

If you chose option two in the last tweak, delete the journal.

To have less disk acitivity it makes sense to keep log files, caches etc. in RAM and only have it periodically written to disk.
I use folder2ram.
https://github.com/bobafetthotmail/folder2ram

Install the necessary packages first:
apt update
apt install -y rsync hdparm smartmontools wget

Читайте также:  Установка блендера на линукс

Then download folder2ram to the path /sbin. Note: You need to have the path configured like it is described in the second post.
wget -O /sbin/folder2ram https://raw.githubusercontent.com/bobafetthotmail/folder2ram/master/debian_package/sbin/folder2ram
And make it executable
chmod +x /sbin/folder2ram
Then execute it (as superuser). See the folder2ram github for explanations.

folder2ram -configure
The script will ask you which editor you would like to run. I use nano.
nano
Append the paths to the log files below. Be careful to use two TAB keys in between the type and mount point. If you use spaces it will fail!

tmpfs /var/log
tmpfs /var/tmp
tmpfs /var/spool
tmpfs /var/lib/smartmontools
tmpfs /var/lib/systemd
tmpfs /var/lib/dhcp
tmpfs /var/lib/systemd/timesync/

The following only if you install samba

The following line if you want to install NFS

tmpfs /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs

Save and exit.
Afterwards start folder2ram with
folder2ram -mountall

Make it start at boot:
folder2ram -enablesystemd

I installed automatic timesync with my local internet router (Fritzbox). You can use any NTP server. e.g. 0.europe.pool.ntp.org

apt install ntpdate ntpdate fritz.box

Then you can install and configure your locale (otherwise you will see an error whenever you install something).

apt-get install locales
dpkg-reconfigure locales

Variant B – Install Openmediavault

If you want to continue with Openmediavault, run the following script;

bash /root/installomv6.sh
Wait until it is run through. It can take 10 Minutes.
After it is finished, reboot.

Now you can connect to the device via your webbrowser.
Type in the IP address of your device in the browser.
Username = admin
Password = openmediavault

B5 – Tuning

The following is a translation from the russian language website. I did not install OMV myself. Check it for links to plugins! https://4pda.to/forum/index.php?showtopic=467828&st=16980#Spoil-110514773-1

extraplugins will already be installed, HDD and its SMART are visible

to display the sda19 / SYSTEM system section (System label), you need to install the plugin openmediavault-sharerootfs 6.xx

to display the user section sda21 / DISKVOLUME1 (UsersFolders label), you need to mount it in Vault->File systems

for display in a network environment, drunk starting from version 6.0.19, enter sequentially 4 commands :

echo ‚OMV_SAMBA_NMBD_ENABLE=“YES“‚ >> /etc/default/openmediavault
monit restart omv-engined
omv-salt stage run prepare
omv-salt stage run deploy

You can switch the kernel version, enter any of below commands (a reboot will occur)

/boot/bootA #ver.4.9.266 + GPU (RAM ~ 750MB)
/boot/bootB #ver.4.9.266 -GPU (RAM ~ 1GB)
/boot/bootG #ver.4.1.17 -GPU (RAM ~ 1GB)

To have less writes to the HD execute the following commands:
echo ‚kernel.printk = 3 4 1 3‘ >> /etc/sysctl.conf
echo ‚debug.exception-trace = 0‘ >> /etc/sysctl.conf
echo ‚vm.swappiness = 30‘ >> /etc/sysctl.conf

clear the logs :
echo > /var/log/messages ; echo > /var/log/syslog ; echo > /var/log/kern.log
etc..pp…

Also, the folder and its contents / var / log / journal / * / grow to indecent sizes measured by gigabytes – reduce it to 32MB (option 1) or completely turn off (option 2) :

Читайте также:  Remove all symbolic link linux

Save the configuration in the file and restart the service:

systemctl restart systemd-journald

when choosing „option 2“, delete the folder with all the contents:

To have less disk acitivity it makes sense to keep log files, caches etc. in RAM and only have it periodically written to disk.

If you installed OMV, you can install the plugin openmediavault-flashmemory 6.xx and enable it:
folder2ram -configure

tmpfs [press 2 TAB] /var/cache
tmpfs [press 2 TAB] /var/lib/dhcp
tmpfs [press 2 TAB] /var/lib/monit
tmpfs [press 2 TAB] /var/lib/openmediavault
tmpfs [press 2 TAB] /var/lib/php
tmpfs [press 2 TAB] /var/lib/rrdcached
tmpfs [press 2 TAB] /var/lib/samba
tmpfs [press 2 TAB] /var/lib/smartmontools
tmpfs [press 2 TAB] /var/lib/systemd
tmpfs [press 2 TAB] /var/spool
tmpfs [press 2 TAB] /var/tmp

when choosing „option 2“ from the previous setting, we also transfer the logs

reboot the system and check

/var/cache is mounted
/var/lib/dhcp is mounted
/var/lib/unit is mounted
/var/lib/openmediavault is mounted
/var/lib/php is mounted
/var/lib/rrdcached is mounted
/var/lib/samba is mounted
/var/lib/smartmontools is mounted
/var/lib/systemd is mounted
/var/spool is mounted
/var/tmp is mounted
note: Logs are transferred to RAM only when disabled / var / log / journal / (option 2)
/var/log is mounted

Источник

My cloud western digital linux

Mounting the WD MyCloud on Ubuntu 20

For instructions on installing the WD MyCloud network attached storage (NAS) and using it from a Linux machine with the file browser, see WD My Cloud for Linux Users.

To mount a public share on Ubuntu 20 (Ulyana), do the following:

  1. Run: sudo apt install cifs-utils
  2. Create a mount directory: sudo mkdir /media/public
  3. Determine the IP address or hostname of your WD MyCloud using: arp
  4. Mount with: sudo mount -t cifs -o rw,vers=3.0 //WDMyCloud.hitronhub.home/public /media/wdmycloud

For a private share, this should work, but so far, I haven’t got it to:

  1. Put your credentials in this file: sudo vim /root/.smbcredentials
    username=share-username
    password=share-password
  2. Make the file inaccessible to non-root users with: sudo chmod go-rwx /root/.smbcredentials
  3. Mount with: sudo mount -t cifs -o rw,vers=3.0,credentials=/root/.smbcredentials //192.168.1.10/share/media/share

I used the following page as a resource:

Share this:

Like this:

About jimbelton

I’m a software developer, and a writer of both fiction and non-fiction, and I blog about movies, books, and philosophy. My interest in religious philosophy and the search for the truth inspires much of my writing.

Leave a Reply Cancel reply

Categories

Pages

Archives

Recent Posts

  • Compile Time Assertions in C June 10, 2023
  • mak, libtap, and libkit updates February 15, 2023
  • What’s New in libsxe? February 11, 2023
  • Per Thread Memory Garbage Collection in C February 5, 2023
  • Extending sxe-jitson With Variables and Constants September 30, 2022

Источник

Оцените статью
Adblock
detector