Update: Boot from USB with HP Microserver Gen8 and OpenMediaVault

Only usable if you use OMV with HP Microserver Gen8 where you cannot boot from a ODD disk (connector) and inserted HDDs in RAID)
Today, a day before my holiday (murphys law). I noticed that suddenly a samba share was not responsive anymore and that OMV was running in read-only mode.

A quick scan showed first a 2,5″ HDD failure (the disk where OMV is on) and a second scan showed that the USB flash drive with grub (this starts OMV) was not accessible anymore.  (probably caused due too high temperatures last week).

The RAID installation with 4 HDDs was expected to be ok.

So I grabbed a new flash drive, and a new 2,5″ 500GB disk (I had those laying around especially for this purpose). a bootable SD card with OMV 4 was also present

Steps:
1. change the 2,5″ disk (remove the failed one and connect the new disk)
2. insert the SD card, boot and OMV splash screen should be shown, install OMV on the 2,5″
3. After reboot insert the USB flash drive after OMV is booted
4. my USB drive is /dev/sdb
5. clean the flash drive
dd if=/dev/zero of=/dev/sdb bs=512 count=1
6. fdisk the flash drive as a bootable linux drive:
I believe the sequence as:
fdisk /dev/sdb
> n
> p
> 1
<enter this>
> a
(toggles boot flag)
>w
write this 

7. format the drive: mkfs.ext3 /dev/sdb1 (please notice the 1 !!, not using this issues with grub !! (Message to self)
8. mount the drive with mount /dev/sdb1 /mnt
9. grub-install –no-floppy –root-directory=/mnt /dev/sdb
Please notice that it is used: dash dash no-floppy dash dash root-directory
10. grub-mkconfig -o /mnt/boot/grub/grub.cfg

Message to self: if there is any issue reported in the screen about ext2, or about blocks .. no correct installation and usage of grub and your system will not boot

 

 

My Simple FTP script

#!/bin/bash
cd /home/backup/server
if [ -e data ]
then
cd /home/backup/server/data/
HOST=’ftp-server-address’
USER=’username’
PASSWD=’password’
ncftp -u $USER -p $PASSWD $HOST << EOT
binary
cd /Volume_1
mkdir `date “+%d-%m-%y”`
cd `date “+%d-%m-%y”`
mput *
bye
EOT
fi
cd /home/backup/server
rm -rf data

with some help of Matthijs en of course myself and a little ‘maggi’ I created a bin/bash shell script to backup data (backup of the server) to one of my other FTP server(s)

it checks if the data folder is available and if so than the a ftp session is started, logged on, a folder with the todays date is made and the data is put in that folder. After that the data folder including the content will be removed. Yes I know there is no validation if A = B but I’ve no idea how to accomplish that, but this works in my test environment. This script is saving me about 4 Hours of datatransfer where FTP is showing me a nice 10MB/s where Samba / NFS is showing me a not satisfied performance at all .. (I believe the total amount of data is about 40GB I have to backup everytime … ) ..

hints and tips welcome to have a A=B comparison before removal of the data folder ;-)

How to mount the CH3SNAS in your Linux System

A few firmware versions ago Conceptronic enabled the NFS kernel module in their CH3SNAS. With the help of Fonz’ fun_plug version 0.4 and it’s NFS addons you can easily mount the CH3SNAS into your Linux System

  1. Download Fun_Plug version 0.4
  2. Install the package and reboot the CH3SNAS
  3. Download NFS Utils
  4. Download Portmap
  5. Download unfs [not necessary for CH3SNAS]

put the 3 files in the root of the CH3SNAS

unpack the files with tar -xzvf [package name] the files will be put in the correct folders now.

Update: above way is not the correct way: you should use funpkg.sh from the fun_plug tools.

You can see the correct installation if nfsd.sh and unfsd.sh are is in the fun_plug start folder /mnt/HD_a2/fun_plug.d/start

Make sure the files can be started during reboot (or boot) by chmodding them:

chmod +x nfsd.sh

chmod +x unfsd.sh

Reboot your device

Go to your Linux System and create a folder where you want the CH3SNAS share to appear. I want to share my Volume_1 and put it in /home/backup/ch3snas. My command to correctly mount the Conceptronic CH3SNAS is:

mount [device-name or device-ip]:/mnt/[path to folder] /target/ folder/linux system

For example:

mount 192.168.1.60:/mnt/HD_a2 /home/backup/ch3snas

you can check now the contents of /home/backup/ch3snas by doing a ls -l for example

Hacking into Conceptronic C54BRS4A router

Conceptronic is selling the C54BRS4A (Atheros Based Wireless Router) for a couple of month’s now. That device should be fully GNU/GPL compliant and therefor Conceptronic has released the SoureCode including Toolchain.

Using alternative configurations / images / firmware with the Conceptronic C54BRS4A should be possible as it is running Linux

Me as nono on Linux took the challenge to see if it was / is possible to create a custome made ‘AroundMyRoom’ firmware version

The steps I followed were:

1. Downloaded the NetInst of Debian (debian-40r1-i386-netinst). Debian is necessary to be able to compile sources. I burned the ISO to a CD-ROM and took an old notebook

2. Intalled Debian on it and installed some additional packages afterwards like MC, some GCC tools, other libs and stuff I saw were necessary to use, the NetInst is simple as it is downloading the content directly from the Internet so no hassle with many CD’s ..

3. after Installation I wgetted the SourceFile from the ftp of Conceptronic. Right now they supply two sourcefiles. I needed both files! especially as 1 file (called: ‘RGDB’) was generating an error and a working was was available in the older sourcefile (sigh.. )

4. After the Tar -xvzf [sourcefile] I read the included readme document and followed the guidelines. (C54BRS4A.GPL.readme.txt)

5. The process is clean and simple and if found any error (I found 2) it could be easily fixed

start with:
1. Building the toolchain
 ~# ./build_tool_chain.sh
Select: Generic (MIPS I) (CONFIG_MIPS_ISA_1) and keep the rest default

check the output and if found any error it must be your system missing some special tools (Bison etc.. )

2. Building the image
 ~# source ./setupenv
 ~# make
 ~# make
 ~# make
  ===================================================
  You are going to build the f/w images.
  Both the release and tftp images will be generated.
  ===================================================
  Do you want to rebuild the linux kernel ? (yes/no) : yes
Issues I found:

in folder: c54brs4a/tools/../rgdb the rgdb file creates a segmentation fault when called through the make process. If you download the first gnu/gpl and take the same file the size is different and replacing the exiting rgdb executable for the other one it works ..

in folder: c54brs4a/templates/../c54br4s4a/ the file gendef.sh was creating a make error due to a missing DDNS statement, when commenting out: issue solved. It seems not to affect the creation of the firmware ..
And finally your system will create the firmware files.. Upgrade through the webinterface and you can have your modified firmware .. Hey .. that is what geeks want .. !

If I have some time left tomorrow I will make some internal images ;-)

HELP: SELinux: unregistering netfilter hooks

HELP

When my USB disk (used for the backup of my (this) server) is connected to the USB port and powered on the Linux CentOS server will not boot after the SELinux: unregistering netfilter hooks message.

When the USB disk is turned off: the server is booting normally and all services are started and everyone can surf onto my sites again, send e-mail etc..

What can be the reason why Linux is not booting properly when my USB disk is on?