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

Could you explain step by step how to install debian-jessie on Gen2?
I also think of changing my gen2 system from WD firmware ver.2 to Clean Debain system.
I know how to install debian-jessie with clean partitions.
But, I don’t know how to install clean debian-jessie with preserving the data partition.
It would be nice if I can install clean debian-jessie from ssh on WD firmware ver 2, if possible.
But, if it is not possible, it doesn’t matter.
Thank you in advance.

This is basically same as guide provided by Fox_exe, I am posting same here with changes. When using parted you can run “print” or “p” before making any changes to check your partition table.

I have “NOTE” before every line that I have modified.

[code]======= INFO ===========
/dev/sda1 - Swap
/dev/sda2 - User data
/dev/sda3 - Rootfs/Boot (Important for bootloader)

======= FW SETUP =======

Copy uImage, uRamdisk and rootfs-jessie.tar.xz to /boot/boot (Overwrite all)

Reboot

Connect via telnet

Repart HDD (Skip 3rd partition):

parted /dev/sda

####NOTE###

DON’T do “rm 2” as /dev/sda2 is our data partition, use print to check current partition table##

rm 1
#[dont run] rm 2
rm 4
rm 5
rm 6
rm 7
mkpart primary 0% 1G
q
mkfs.ext4 /dev/sda1

Move firmware to data partition (temp)

mkdir -p /mnt/root /mnt/data
mount /dev/sda1 /mnt/data
mount /dev/sda3 /mnt/root
cp /mnt/root/boot/uImage /mnt/data/
cp /mnt/root/boot/uRamdisk /mnt/data/
cp /mnt/root/boot/rootfs-jessie.tar.xz /mnt/data/
umount /mnt/root

End format HDD…

parted /dev/sda
rm 3

###NOTE###

don’t run this line, as it is meant to create new data partition /dev/sda2

[don’t run]mkpart primary 4G 100%

###NOTE###

we need to modify below line as there is space in the disk before start of /dev/sda2, we can have larger /dev/sda3

##[DONT RUN}mkpart primary 1G 4G

Instead run “print” to check the start point of /dev/sda2 which shall be 8591, so we can create /dev/sda3 as below

mkpart primary 1G 8.5G
q

###NOTE###

Don’t create filesystem on /dev/sda2

##[DONT RUN}mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3

Prepare new firmware:

mount /dev/sda3 /mnt/root
tar xvf /mnt/data/rootfs-jessie.tar.xz -C /mnt/root
mkdir -p /mnt/root/boot
cp /mnt/data/uImage /mnt/root/boot/uImage
cp /mnt/data/uRamdisk /mnt/root/boot/uRamdisk
umount /mnt/root

Convert 1st partition to Swap:

umount /mnt/data
mkswap /dev/sda1

Reboot. Done!

sync
reboot -f

======= OMV SETUP =======

Connect to device via SSH

Default SSH login/password: root/mycloud

Install latest OMV (v.3.x.x, “erasmus”)

echo “deb Index of /public erasmus main” > /etc/apt/sources.list.d/omv.list
echo “127.0.1.1 wdmc.lan wdmc” >> /etc/hosts
apt-get update
apt-get install --force-yes openmediavault-keyring
apt-get update
apt-get install openmediavault

choose “none”, “yes”, “standalone”

Default OMV login/pass is: admin / openmediavault

Warning: create network interface in webgui or you loose network connection after restart!

“Mount” data partition (/dev/sda2) as “User data”.

Configure all other things.

Profit!

to allow USB to work update to this kernel

just unpack to rootfs and reboot

http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/Debian-kernel-bin_3.10.70_002.tar.gz[/code]

2 Likes

Thank you very much. It’s more than I expected.

1 Like

I am on a Gen2 6TB but it looks like partition 4 is the data partition with the size of 6GB.
4 4828MB 6001GB 5996GB ext4 primary

Did i miss something?

Data partition should be close to 6TB in size not 6GB. Can you post output df -h, through ssh. or fdisk /dev/sda followed by print

EDIT: on second look it is 5996GB not 6GB, in that case it is data partition. Still you can confirm by running above commands. You can also try mount | grep /dev/sda

Are you sure it is GEN2 mycloud and not GEN1 or mycloud EX* or something else?

of course 6TB, confused it :frowning:
already messed it up, could not delete some partitions because they was mounted. Guess the my cloud will not work after a reboot. At the moment i can log in over the web interface and see my data

Here the output:

WDMyCloud:/mnt# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.9G 756M 1.1G 42% /
/dev/root 1.9G 756M 1.1G 42% /
tmpfs 40M 3.6M 37M 9% /run
tmpfs 40M 64K 40M 1% /run/lock
tmpfs 10M 0 10M 0% /dev
tmpfs 5.0M 0 5.0M 0% /run/shm
tmpfs 100M 9.2M 91M 10% /tmp
/dev/root 1.9G 756M 1.1G 42% /var/log.hdd
ramlog-tmpfs 40M 9.5M 31M 24% /var/log
/dev/sda4 5.5T 3.0T 2.4T 56% /DataVolume
/dev/sda4 5.5T 3.0T 2.4T 56% /CacheVolume

WDMyCloud:/mnt# fdisk /dev/sda
WARNING: GPT (GUID Partition Table) detected on ‘/dev/sda’! The util fdisk doesn’t support GPT. Use GNU Parted.
WARNING: The size of this disk is 6.0 TB (6001175126016 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).

Disk /dev/sda: 6001.2 GB, 6001175126016 bytes
255 heads, 63 sectors/track, 729601 cylinders, total 11721045168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 4294967295 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.

WDMyCloud:/mnt# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) p
Model: ATA WDC WD60EFRX-68M (scsi)
Disk /dev/sda: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 15.7MB 14.7MB primary
3 15.7MB 528MB 513MB linux-swap(v1) primary
8 4826MB 4828MB 2097kB primary
4 4828MB 6001GB 5996GB ext4 primary

@Bernd5647, [quote=“docbroke, post:1357, topic:93714”]

Copy uImage, uRamdisk and rootfs-jessie.tar.xz to /boot/boot (Overwrite all)

[/quote]

Have you missed this step before deleting partitions ?? If so you can still do this while you have access over ssh or telnet.

Yes, looks like data is on /dev/sda4, /dev/sda3 is swap, that means you probably have deleted root partition. I think you still can recover by creating proper partitions and installing debian on that. Do not delete /dev/sda4

Have copied them and rebooted. done it with WinSCP

Any Idea how to solve this?

(parted) rm 1
Error: Partition(s) 1, 2 on /dev/sda have been written, but we have been unable
to inform the kernel of the change, probably because it/they are in use. As a
result, the old partition(s) will remain in use. You should reboot now before
making further changes.

WDMyCloud:/mnt# mkfs.ext4 /dev/sda1
mke2fs 1.42.5 (29-Jul-2012)
/dev/sda1 is apparently in use by the system; will not make a filesystem here!

I have no experience with winscp, can’t help with it.

I have no /boot/boot the files are in the directory /boot. Do i have another device or need a special Firmware to start from?

WDMyCloud:/# uname --all
Linux WDMyCloud 3.2.26 #1 SMP Thu Jul 9 11:14:15 PDT 2015 wd-2.4-rel armv7l GNU/ Linux

1 Like

AFAIK , your device has different partition scheme. I have no 15 MB partition, like your /dev/sda1. It appears that /dev/sda1 is your ESP partition for GPT (secure boot). I am not sure how to proceed here. You can try creating two new partitions One for swap and another for /root, as in above guide and unpack jessie-rootfs.tar.gz (it is not .xz as in above guide), there and uImage and uRamdisk to /root/boot/ before reboot.

EDIT: At the end try to have only 3 partitions, one with your data /dev/sda4, another one for swap (empty) and one for root, having unpacked jessie-rootfs on / and uimage and uramdisk on /boot/.
You shall also check /etc/fstab to confirm with your current partitioning before reboot, as may be designed by Fox_exe with some other partition scheme in mind.

fake-hwclock save to save current time at shutdown

fake-hwclock load to load saved time at boot
There is init script provided with debian.

Though better options is to use ntp.

apt-get install ntp ntpq -p
if required

dpkg-reconfigure ntp

Thanks docbroke. I used the wrong files. Have a Gen1 and not 2. Recovery was not possible for me, could not write the imsages. Have the system set up anew.
Install of Debian works now but i cant get the openmediavault to install. Any idea what i did wrong?

Hmm change this line:
echo “deb Index of /public erasmus main” > /etc/apt/sources.list.d/openmediavault.list
to
echo “deb Index of /public stoneburner main” > /etc/apt/sources.list.d/openmediavault.list

Now i can install it.

Got another error with collectd
Setting up collectd (5.1.0-3+deb7u3) …
[…] Restarting statistics collection and monitoring daemon: collectd not restarting, conf[FAILtion error failed!

Had to change /etc/hosts line from
127.0.1.1MyCloud.localdomain MyCloud
to
127.0.1.1 MyCloud.localdomain MyCloud

How did you install debian? Something is wrong with your debian installation, it is not willing to install any dependencies of openmediavault.

No luck after restart the Device hangs with green LED and ist only reachable with ping. No Web GUI nor telnet reachable :frowning:

When i use Clean debian - english.7z for OMV Install latests OMV in Wheezy.txt it should be working?
Do i need the config.img in the OpenMediaVault directory?

You may try one more reboot.

Is there a compiled samba 4 bin for 4k debian? I’ve installed a clean debian and updated it to the latest possible version, installed samba v4 but the speed is depressing. I’m getting something around 20MB\s with any settings i try.

Strange. Minimum is 45/30 (Read/Write) MB/s (W/o any tuning).
Up to 75/40MB/s after tuning and ~90mb/s after replace samba to WD version.
Google for “Tuning samba for RaspberyPI”. We have similar hardware, so almost all instructions can work.

1 Like

Just reinstalled a clean system and updated it.

PRETTY_NAME=“Debian GNU/Linux 9 (stretch)”
NAME=“Debian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
Samba version 4.5.8-Debian

Nothing like custom bins and config is default (only 2 shares added). Maximium writing speed i get is 25 MB\s.
I’ve managed to get 130 MB\s using a piece of software named TeraCopy but it drops back to 25 MB\s after writing 1,4GB or so. I’m not even sure if it’s real or a bug (IOTOP never shows DISK WRITE greater than 35 MB\s).
Can you please give me the contents of your smb.conf? Also is there a custom bin i can install for my system?
I’ve tried pretty much any combo of socket options and cache settings from this topic but never got anything better than 25 MB\s.