Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

2018-01-06

Linux on Jetway JNF76-N1G-LF in 2017

Back in 2009 I bought the Jetway JNF76 motherboard including ADPE4S-PB daughterboard (4xSATA II marvell controller) for their proprietary connection (Jetway Daughter Board Connector Gen 1). The motherboard was equipped with VIA Nano U2300 1GHz CPU and VX800 chipset. Eventually it replaced another board VIA VT-310DP as my main NAS (network attached storage) server. During that time it took me quite a while to find a properly working setup. I tried all BSDs and some Linux distributions, until I was forced to switch from my initial NetBSD 5.0 setup to Debian Linux 5. Refer to my previous articles by clicking here, here and here. Finally some outstanding issues were resolved during my transition to Debian 6 in 2011. Debian Linux setup worked for around 5 years in my server till my OS installation containing flash drive died. Few weeks ago I decided to revive the system but using a different lighter Linux distribution. The folowing points I listed were the issues I encountered during the time I was using Debian.
  • Debian Linux required additional configuration for drives connected to ADPE4S-PB controller to be recognized (adding ahci.marvell_enable=1 to some file in /etc/modprobe.d/). I was wondering if it is still the case today.
  • A06.1 BIOS version wasn't compatible with any Linux distribution I've tried at that time (boot process was hanging up before any boot messages were available on the screen), only falling back to A05 version was solving the issue.
  • IDE mode was needed to be used for native VX800 SATA controller for ADPE4S-PB daughterboard to initialize during PC boot process (BIOS issue).
  • Graphical install was working during that time.
During this endeavor I have tried to install the following Linux distributions:
I also tested live images of these distributions:

A06.1 Linux issue 

The board reached EOL long ago however I was still expecting some BIOS upgrades after A06.1 version in 2010. Since then I was communicating with Jetway extensively regarding Linux boot issue (I've tried around 5 major distributions at that time, all of them failed to boot), however their answers didn't help me reach any conclusion. Eventually I just downgraded BIOS back to A05. Unfortunately, visiting their current page showed that A06.1 version is the last upgrade for this board, and no more upgrades can be expected. Out of curiosity I updated BIOS again and I can confirm that during the time I was writing this article, Linux boots unless no USB devices are attached, otherwise system crashes with "Fatal exception in interrupt" message. If you attach USB device after system is loaded, it will work but Linux still can crash at any given with the same error (in my case during system upgrade process). It is  improvement over immediate crash without boot log messages but hardly justifies BIOS upgrade. On the other hand, BIOS release notes stated that it fixed the 2TB hard drive detection issue however I didn't have any problems with >2TB drives on A05 BIOS anyway (over the time I used at least three or four different models from Hitachi, Seagate, Toshiba and possibly WD). I would personally recommend to upgrade the latest BIOS version only if necessary.

LXLE and SparkyLinux

My initial goal was to use CRUX distribution for the NAS server. It didn't have a live image and its installation image was pretty primitive, thus it lead me to search for a light Linux distribution which had live image for initial testing. SparkyLinux and LXLE were the ones which caught my attention because they both used light window managers by default (OpenBox, LXDE). The former is based on testing Debian branch, while the latter on Ubuntu. Unfortunately, it appeared that graphics-based installation failed on both, which meant LXLE was not useful for my needs. Therefore, since SparkyLinux had a console-based boot support then it proved to be a quite good "rescue" type distribution. It is important to note that hard drives attached to ADPE4S-PB daughterboard weren't recognized on SparkyLinux otherwise it worked OK on the system and provided enough tools for my testing needs.

CRUX Linux

I was really hoping to finally grasp this quite unique Linux distribution which uses BSD style unit scripts and ports style package management. Why? Mainly because among all other Linux distributions CRUX has the features closest to BSD since I am more a BSD person than a Linux one. 

Initially setup image boot failed which was caused by an aspm (Active-State Power Management for PCI-E) issue. The solution was to add pcie_aspm=off parameter on every boot (just write CRUX pcie_aspm=off in boot console). Apparently other Linux distributions do that automatically depending on detected PCI-E version (noticed that in boot logs). CRUX installation is similar but even more primitive than NetBSD or OpenBSD. You need to partition disks manually using fdisk, manually edit fstab, hosts and other required configuration. Eventually you run setup script on mounted root partition (to /mnt) which copies system files to a required location. Then you chroot to your system root partition (setup_chroot), compile your own kernel and install bootloader (lilo is default but I used grub2). This Linux distribution doesn't have initial RAM disk (initrd) by default so all drivers must be compiled into the kernel. This condition eventually became my brick wall. I just couldn't find the combination which could boot the system. Even if partitions and hard drives were visible in boot log during boot process (both attached to native VX800 controller or daughterboard one) it was ending up with "VFS: Unable to mount root fs" error. After a week of recompiling different kernel configurations I decided to give up on CRUX.

antiX Linux

Based on the problems I encountered previously, I looked around for faster solution and stumbled upon Antix Linux which was systemd free Debian based system and supported console based installation. Installation went pretty smoothly but I could not resolve an issue for drives attached to an ADPE4S-PB daughterboard. It is based on Marvell 88SE6145-TFE1 controller and similar to my installation back in 2009 it still required disabling marvell pata driver in most Linux distributions manually. I just couldn't find ways on how to do this in antiX but I didn't want to spend more time in searching for answers from forums (I couldn't find the information I needed from old discussions thus getting it would mean starting a new thread). For this reason I just decided to switch again.

Manjaro Linux

There were three reasons why I wanted to try Manjaro Linux:
  1. I use Manjaro as my main distribution on my desktop system from the end of 2013 to present, and I am familiar with it pretty well by now. 
  2. It is based on Arch which had a good description on how to solve marvell SATA issue from their forums. 
  3. Manjaro has a console-based Manjaro-Architect edition which gave me hope to run it successfully on the system.
Unfortunately though, the boot process ended up with a message in my monitor showing "Sync. Out of range", and I couldn't find a quick solution to that. Therefore, Manjaro failed as well, which made me decide to try Arch Linux.

Arch Linux

Arch Linux had a console-based installation and required internet access (at least the image I used). It had a couple of helpful utilities which generated files, like fstab, compared to manual editing which can be found on CRUX, although partition management is still manual using fdisk or cfdisk. Installation went pretty smoothly according to Arch Linux documentation. I won't go into details because this article is not about Arch Linux installation process, but I will describe specific changes that I had made to configuration for my particular setup. Initially, I replaced filesystem references from /dev/sd* to partition UUIDs in fstab file. In addition, I also disabled system beep by adding  /etc/modprobe.d/nobeep.conf file with "blacklist pcspkr" content. Finally I performed changes to enable marvell SATA (for ADPE4S-PB daughterboard to work):
  • Added /etc/moprobe.d/blacklist_pata_marvell.conf
    • blacklist pata_marvell
  • Added /etc/modprobe.d/ahci-enable-marvell.conf
    • options ahci marvell_enable=1
  • Modified /etc/mkinitcpio.conf file
    • MODULES=(ahci)
  • Regenarated initramfs
    • mkinitcpio -g /boot/initramfs-linux.img
The boot disk can now be connected to the daughterboard after the changes in the configuration and system reboot were done.

So far this installation runs OK. Arch Linux is a distribution which is relatively less troublesome to install and fully utilizes my hardware.

Conclusions

  • IDE mode is still required for native controller in BIOS if you want to use ADPE4S-PB daughterboard (including the latest A06.1 BIOS version). LAN boot ROM can be enabled though.
  • Additional configuration is still necessary for Linux to see drives attached to ADPE4S-PB daughterboard. More specifically marvell pata driver needs to be disabled and ahci marvell driver needs to be enabled. It means you can't install OS to drive attached to this daughterboard but it can be reattached to the daughterboard after necessary changes are performed.
  • Linux is booting on A06.1 BIOS version currently but only without USB devices attached, therefore I personally recommend A05 version.
  • It takes hell of a time to find the right distribution and configuration mainly because of SATA daughterboard. If you are not using it, most distributions should work out-of-the-box in case they are using console-based installation. I couldn't boot into CRUX unfortunately but setup image works with pcie_aspi disabled, so probably I just couldn't find the right kernel/system configuration.
  • Arch Linux proved to be the most suitable lightweight distribution to utilize ADPE4S-PB daughterboard.
  • Graphical installation or xserver failed to work on any distro mentioned above (not sure about the reasons, some definitely didn't have openchrome driver but I believe some had. Your experience may be different. Since this particular issue is irrelevant to my setup at the moment, I didn't investigate further. VX800 integrated graphics is supported by openchrome driver, so theoretically it should work with light window managers).

2011-03-01

Upgrade to Debian Linux 6

Debian 6.0.0 "squeeze" was released February 6th, 2011. As I use Debian on my NAS server I decided to upgrade system to this new version. However, I decided to perform a clean install, because of this firstly I backed up some scripts and configuration files (like smb.conf, fstab, rsync scripts, crontab and some others). Later I downloaded small cd image for installation.

My NAS configuration consists of Patriot Xporter XT USB flash drive which is used for operating system (it had one ext3 formatted partition and one swap partition) and two different 1.5TB (Seagate and WD) SATA disk drives (no RAID) . One of them is ext3 formatted and is used to share data across the network, the other one is a xfs formatted disk for back up (rsync is used to synchronize them). Firstly, I connected SATA CD-ROM to ADPE4S-PB controller, however, it worked incorrectly on debian  (I'll discuss later on this matter), because of this I needed to reattach it to USB port (through SATA to USB adapter). Debian CD bootloader gives two general options to install system. The first one is ncurses (text) based and it is selected by default and the other option is graphical install. I chose graphical install and installer loaded without problems. I reformatted my system partition to ext4 this time. Everything else left unchanged. Software selection was made by categories. Firstly I chose everything except graphical desktop environment, laptop and DNS server but the install process didn't go smoothly first time. Deselection of the print server solved the problem and Debian installed correctly. I don't know what was wrong at first time. I selected some Duisburg  repository and it could be the case with some missing packages. The last problem was bootloader (which is grub2). MBR was written to first hdd drive instead of flash drive. Because of this I needed to reinstall bootloader after first boot to Patriot drive though it was configured correctly. 

Configuration went very smoothly. I updated fstab file, copied old smb.conf, rsync, crontab files, reconfigured sshd and my server  was ready. Later I added transmission-daemon with its web interface. I needed to use old torrent-flux in previous Debian version as transmission-daemon didn't work for some reason. 

The boot time and responsiveness feels better but I don't have exact numbers and it is not a fair comparison due to different number of services and other filesystem.  Currently Debian boots between 34 and 40 seconds.


What is more, I decided to test my ADPE4S-PB daughterboard (Marvell 88SE6145). As I mentioned it didn't work correctly during install. However, I found a workaround which helped to solve a problem for me (at least, partially). I added ahci.marvell_enable=1 in separate file stored in /etc/modprobe.d/ folder and ran update-initramfs -u command. Debian recognized attached devices after that and they could be used. You can read on provided link above about what this option does.

Finally, I decided to test HDDs attached to integrated VX800 controller under AHCI mode (RAID option in BIOS). I was very pleased that the bug had been resolved and drives hadn't fall to PIO mode. Everything worked correctly so I think it is possible to make real (soft) RAID finally. Sorry, I still not tested any RAID setup not with VX800 nor with ADPE4S-PB.


I also tried to update to a newer BIOS version once again. Unfortunately, kernel still hanged up just after boot loader started to load it. So the problem remained.

Changes:
  • Debian 6 uses grub2 boot loader instead of grub by default 
  • Option to use ext4 instead of ext3 on root(/) partition (default still ext3) 
  • Transmission-daemon works correctly 
  • HDDs transfer method is not dropped to PIO mode anymore if RAID option is selected in BIOS for integrated VX800 SATA controller
  • System boot is faster now, the system responsiveness is better
  • I found a workaround for ADPE4S-PB (Marvell 88SE6145) SATA controller to make SATA drives to be identified on Debian (It is not a new version workaround but I tried daughterboard with this version only)
The same:
  • Still needs modprobe acpi-cpufreq to be executed to make CPU lower it frequency (another option to recompile the kernel but this time I decided not to). Update: I found this wiki page to solve frequency scaling problem. You need to install cpufrequtils and cpu frequency scaling will be enabled automatically during system start up.
  • Linux kernel still hangs with newer than A05 BIOS version (Jetway JNF76-N1GL-LF motherboard)
 Not tested:
  • Graphical environment (openchrome), though graphical install worked ok
  • any RAID setup (system BIOS supports only one RAID controller at once, ADPE4S-PB can be used only if VX800 SATA controller is set to IDE mode)

Final words
I was very happy with smooth Debian Linux update. I didn't expect that I would do everything in less than one evening. What is more, it solved some problems like VX800 AHCI/RAID support, added new features (for example, ext4 and grub2), upgraded my software and felt faster, cleaner and more responsive. Finally I managed to solve some old problems like ADPE4S-PB support and transmission-daemon. This upgrade was very successful and useful for me and it gave a big plus for Debian in my mind :). If you think about such upgrade too, give it a try. Especially if you have SMP system. Don't forget to backup current system. The last thing I wish to be solved is kernel hang up problem with newer than A05 BIOS versions.