[GUIDE] How to Install Debian Linux on the My Cloud PR4100 NAS


ok, interesting.
after running the command (even with r instead of b) with the .encode() the daemon is now starting probably.
till now the two shutdown calls are disabled.
i will activate the systemd service again, restart, see if its working and afterwards uncomment the two shutdown calls



christian@unassigned-hostname:~$ sudo python3 -c 'import serial; s=serial.Serial("/dev/ttyS2"); s.write(b"STA\r\r"); print(s.readline())'


That looks good. The daemon should work now. You can also query the version (VER) instead of the status (STA). Sometimes the serial connection gets a bit messed up during the debugging and querying the status usually helps. Just make sure you clear the buffer (readline). On a healthy normal boot, everything should be fine, but sending an empty '\r' can always help.

ExecStartPre=/bin/echo -ne 'LN1=Look hot\r' > /dev/ttyS2
ExecStartPre=/bin/echo -ne 'LN2=Stay cool\r' > /dev/ttyS2


i took this two lines from your wdhwd.service file right after you posted your files into my file (and everything else as well)

after two painfull days it is really working now.

thank you so much for your help !!


No problem. Enjoy the box now that it’s fully powered!
I’ll try to update the holes in my guide the coming days with the info we gathered.


My setup is now the PR2100 with 2x 3TB WD RED inside, on sda 32GB for Debian, 10GB swap, and a ~6TB software RAID0 made with mdadm.

using the UART Port is very very helpful


If you’ve got WD reds, you can’t use hdparm to manage disk spindown.
This blog post explains how to setup hd-idle



Thanks a lot!


Thank you so much for sharing this! I bought a PR4100 because of your post.

I’m super impressed at how you figured all of this out. I’ve been trying to replicate your results with Ubuntu for the last few hours and failing.

Has anyone done this with Ubuntu? It’s not a big deal but I have a slight preference for it over Debian because it comes with ZFS binaries.

BTW I installed a SSD in the first bay for boot using this 2.5" drive adapter: https://www.amazon.com/gp/product/B00H91BXJU/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1


You didn’t say where it fails… what have you done so far?
Preseed config should be the same, so what is the output of

lspci -k -s 00:1e
ls -l /sys/class/tty/*/device/driver
sudo dmesg | grep tty

I’m using zfs on debian with the kernel headers as above and then

apt-get install zfs-dkms zfsutils-linux


I tried using http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso in place of …/debian-cd/current/amd64/iso-cd/debian-9.2.1-amd64-netinst.iso. SSH never came up and I don’t have a UART port cable to diagnose why.

I did install Debian successfully with ZFS, thank you. I found this guide to be helpful: https://unix.stackexchange.com/a/396160/48189


From https://help.ubuntu.com/community/Installation/MinimalCD

mini system in UEFI mode
While the minimal iso image is handy, it isn’t useful for installing on UEFI-based systems that you want to run in UEFI mode. The mini iso lacks the proper files for booting the computer in UEFI mode. Thus, the computer will boot in BIOS compatibility mode, and the installation will be in BIOS mode.

I’d use the ubuntu server iso.


It should be fairly simple to install Ubuntu Server, but the required steps would likey be different from the Debian installation outlined in the OP. The desktop version of Ubuntu won’t work because it’s generally not compiled/configured to run in headless mode without a monitor/keyboard.


Thanks for your hints. Encouraged, I gave it another go with Ubuntu. I tried testing it first on another Linux machine I just acquired so I could see what I was doing.

Big mistake. I wasted hours and regret it. Ubuntu has TWO server installers. The default is http://releases.ubuntu.com/18.04.1/ubuntu-18.04.1-live-server-amd64.iso which doesn’t appear to work with preseeding but there’s no good documentation explaining that or why.

The other, http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/ubuntu-18.04.1-server-amd64.iso, supposedly does but fails with the error “Your installation CD-ROM couldn’t be mounted.” This is a bug that’s been known for years and requires manual intervention to pass.

Both images are available via HTTP only, no SSL! This is 2018! Shame on you, Ubuntu!

Conclusion: Ubuntu installers are a giant mess and I’m sticking with Debian.


@dswv42 You may want to remove the nomodeset kernel parameter from the GRUB config.
This prevents the i915 intel video driver getting loaded, required for vaapi HW video transcoding.
Thanks reference

I removed it from /etc/default/grub default params and then did

# sudo update-grub
# sudo reboot
# ls -l /dev/dri/renderD128
# vainfo      
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 1.7.3
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD

E.g. Emby media server can now use it

ps fax | grep vaapi
 2706 ?        Sl     0:15  \_ /opt/emby-server/bin/ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:/MM/Trailers/SomeMovie.mkv -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=692 -b:v 3680000 -maxrate 3680000 -bufsize 7360000 -profile:v 578 -level 41 -force_key_frames expr:if(isnan(prev_forced_t),eq(t,t),gte(t,prev_forced_t+3)) -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 320000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list /var/lib/emby/transcoding-temp/74f5332ba1271fcece2c3cba79a6d129.m3u8 -y /var/lib/emby/transcoding-temp/74f5332ba1271fcece2c3cba79a6d129%d.ts


Here’s how to get hardware control with much less effort / time by building an in-tree kernel module.

Install the 4.9 kernel, headers and source. At the moment this is a meta package for linux-image-4.9.0-8, or the 4.9.110-3 kernel. This may bump in the future

sudo apt install linux-image-4.9-amd64 linux-headers-4.9-amd64 linux-source-4.9

Verify that the current kernel is 4.9.0-8-amd64 with uname -r
If it isn’t, update the grub bootloader to select the correct menuentry by setting the grub default.

Prepare kernel build directory and extract the source

mkdir ~/kbuild && cd ~/kbuild
tar xf /usr/src/linux-source-4.9.tar.xz
cd linux-source-4.9

Get the module symvers from the headers. This file is generated when you build the full kernel, so we save a few hours by skipping this.

cp /usr/src/linux-headers-4.9.0-8-amd64/Module.symvers .

Get the current kernel config (usually found at /boot/config-$(uname -r))

make oldconfig

Enable the Intel LPSS UART driver in the kernel config.

Directly with an editor

Enable these 2 parameters in the .config in your favorite editor


Note that these parameters may change in future kernels.

or select it in the menu
sudo apt install libncurses5-dev
make nconfig

Enable support as a module.

   -> Device Drivers
     -> Character devices
       -> Serial drivers
        -> <M> Support for serial ports on Intel LPSS platforms. 

Save and exit.

Now compile the module

make prepare
make modules_prepare
make M=scripts/mod
make M=drivers/tty/serial

And install it

sudo make M=drivers/tty/serial modules_install
sudo depmod
sudo modprobe 8250_lpss

Verify it’s active

lsmod | grep 8250_lpss

This lighter module is easier to keep in sync with the mainline kernel.
All that’s left is to put all this in a post-install script.


Openmediavault 4 (Arrakis) has finally been released for Debian 9 (Stretch), and after giving it a lot of thought, I’ve decided that this is probably the most viable option for the PR4100/PR2100 NAS boxes.

However, hardware control will need to be addressed, and this time I intend to do it properly. No more complicated instructions, just a downloadable ISO file that can be burned to USB for a full plug and play installation.

The only real caveat is the need for the OS to reside on one of the hard drives because eMMC memory is too small and it wears out quickly from too many write operations, but I have some ideas for that too.

This is going to take time… a lot of time.


I’d suggest a 4GB image file with OMV already installed and just inflate the partitions on first boot.
Then the user only needs to update OMV to the latest version and change the password.
The image can be installed on a disk but I’d recommend to run it from a USB drive.


I have something very similar in mind, but haven’t worked out the specifics yet. Currently, my main concern is PR4100 hardware identification so the Debian kernel can be configured/compiled to run with full hardware control. Linux distribution kernels tend to be rather bloated, so this will have the added benefit of keeping the kernel’s size and performance within reason.


I have a new Linux kernel 4.9.127 packaged up for easy installation on Debian 9 (Stretch), with full PR4100 hardware support, if anyone wants to give it a try. I’ve tested it and everything seems to work fine, with only a few minor .config tweaks to iron out to make the kernel more efficient. The kernel source code was not modified prior to compilation, only the .config was changed to make it suitable to run on the PR4100 hardware.

Use at your own risk and only use on the PR4100/PR2100 with Debian 9 (Stretch).

Download from:


Install it to Debian using:

sudo dpkg -i linux-headers-4.9.127_1.0.PRX_amd64.deb
sudo dpkg -i linux-image-4.9.127_1.0.PRX_amd64.deb

Reboot, then use uname -r to verify that the new Linux kernel 4.9.127 is running.

If you’d rather compile the Linux kernel yourself, simply download config-4.9.127.txt (95.4 KB) and save it to the /usr/src directory, then execute the following Linux commands as the root (or sudo) user. It may take several hours to compile, depending on many variables.

apt-get update && apt-get upgrade
apt-get install -y build-essential libncurses5-dev gcc libssl-dev libelf-dev u-boot-tools bc git

cd /usr/src
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.127.tar.gz
tar xvzf linux-4.9.127.tar.gz
cd linux-4.9.127
cp ../config-4.9.127.txt .config

make -j4 KDEB_PKGVERSION=1.0.PRX deb-pkg

dpkg -i ../linux-headers-4.9.127_1.0.PRX_amd64.deb
dpkg -i ../linux-image-4.9.127_1.0.PRX_amd64.deb

I’m developing a fully automated (plug and play) Debian/OMV install process, but I still need to work out a few kinks and test it for stability. And the best part is that the factory warranty (whatever it’s worth) should not be affected because no changes the firmware are made. The NAS is designed to boot from other media, so they can’t argue that it’s been altered.

BTW: The PR4100 is about to become so useful (without the crippled factory firmware) that I ordered a second one to use as a remote backup target.


How to use sysvinit instead of systemd in Debian Stretch.