Category Archives: Hardware Configuration

Synology installation of ipkg DSM yum or apt-get equivalent

The reference for the first part is at but is in German.

First up we need a package installer, ipkg

Check the Synology device for which cpu it has,

#cat /proc/cpuinfo | grep cpu

Then select the appropriate script

CPU Bootstrap Script
ARM (armv5tejl)
PowerPC (ppc_6xx)
PowerPC (ppc_85xx, e500v?)
Marvell Kirkwood 88F6281, 88F6282, 88FR131 (ARMv5TE Feroceon)
Intel Atom

and get it with

#wget http://your_selected_cpu_bootstrap_script_here

then run it with

#sh your_selected_cpu_bootstrap_script_here

This install ipkg, but it is not in the path for the Synology system. To add it to the path:

1. check the path

#cat /etc/profile

and this should be there

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin export PATH

extend the path to include our /opt directories with two command lines

# PATH=/opt/bin:/opt/sbin:$PATH
# export PATH

Then we can test that ipkg is installed and will run from anywhere with

# ipkg -v

Should respond with something like

# ipkg version 0.99.163

If you now try to install a package, you will get an error

#ipkg install mc
Nothing to be done
An error ocurred, return value: 4.

Which is ok, this is expected because the new install does not yet know where to look for ‘mc’

Note: ‘mc’ is just a favourite package of mine, (midnight commander, with the excellent mcedit editor) but you could try any packge you want like ‘nano’, etc.

The final step for installing ipkg is to update the repositories

# ipkg update

Then try again and as ipkg now has a repository to call on, it should find the install package and install it.

Much Later: Corrected a couple of text errors, thanks to all who pointed them out!

Raid 1 repair on SMEServer

I had the displeasure to find a failing drive within a server earlier today.

But with trusty SME Server and the Linux software raid process it was relatively painless, albeit that I had the wrong drive out at the first attempt.

The reference at How-to Forge was the one I used and it made it easy to follow.

Dlink DSL-502T fails to save DMZ

Damn Dlink.

Trying to update the firmware because the DMZ setting was not saving or at least was being reset to disabled despite my best efforts to save it into the modem. A restart seemed to be ok, but a while later the DMZ was disabled again.

So I downloaded the most recent firware and used the upload option to install it. I then did the reset via the pinhole button on the rear and boom!

Power LED comes on but no-one is home any more. The damn thing has trashed itself internally. In this location I had a spare and replaced it straight away which gets the site back on the internet, etc. But what pain that is when a simple firmware update blows up the modem.

So why was it not saving the DMZ. Guess I’ll never know.

Adding new drives to SMEServer as a raid pair

Adding two new 1Tbyte drives into my SMEServer v7.4 as a raid pair for backups. Made good use of the LVM How-To (again!)

Obviously installing the physical drives comes first and they should be recognised by the bios and then as the server booted mine were flagged as /dev/sda and sdb respectively.

Because these are new drives and I am adding them rather than modding the current drives I am working in the normal console.

#fdisk /dev/sda
>p –print the current state (should show as blank)
>n –add a new partition
>p –primary partition
>1 –partition number
>t –change the type or id of the drive
>hex= fd –change to Linux raid
>p –print again the details and shows now as approx 1T lvm partition
>w –write the partition table and exit

repeat for /dev/sdb

#shutdown -r now

Restarting the server should automatically match the two drives as a raid pair.  Check by reading through

#cat /var/log/dmesg

for something like this:

md: Autodetecting RAID arrays.
md: could not bd_claim hda1.
md: could not bd_claim hda2.
md: could not bd_claim hdb1.
md: could not bd_claim hdb2.
md: autorun …
md: considering sdb1 …
md:  adding sdb1 …
md:  adding sda1 …
md: created md3
md: bind
md: bind
md: running:
raid1: raid set md3 active with 2 out of 2 mirrors
md: … autorun DONE.

Next check what is showing for LVM


PV /dev/md2   VG main            lvm2 [186.19 GB / 64.00 MB free]
PV /dev/md3                      lvm2 [931.51 GB]
Total: 2 [1.09 TB] / in use: 1 [186.19 GB] / in no VG: 1 [931.51 GB]

shows my new pair ready for inclusion in the LVM volume groups and logical volume.

Here I ran into an annoyance with a message Insufficient Extents.

I figure I want the whole disk and the above indicates 931.51G is free

lvm> lvcreate /dev/backups -L931.51G -n backups
  CTRL-c detected: giving up waiting for lock
  Rounding up size to full physical extent 931.51 GB
  Insufficient free extents (238466) in volume group backups: 238467 required

I have since learnt that lvm does some rounding and that using the ‘byte’ size is not the best option.

  — Volume group —
  VG Name               backups
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.51 GB
  PE Size               4.00 MB
  Total PE              238466
  Alloc PE / Size       0 / 0
  Free  PE / Size       238466 / 931.51 GB
  VG UUID               #######################

In the above screen the important bit is the “Total PE              238466” which tells me the Physical Extents available.

Changing my command to create the lv so that I use the PE rather than byte value

lvm> lvcreate /dev/backups -l238466 -n backups
  Logical volume “backups” created

gives a successful outcome.

lvm> lvscan
  ACTIVE            ‘/dev/main/root’ [184.19 GB] inherit
  ACTIVE            ‘/dev/main/swap’ [1.94 GB] inherit
  ACTIVE            ‘/dev/backups/backups’ [931.51 GB] inherit 

Next to format the new backups volume

#mke2fs /dev/backups/backups

Add the journalling

#tune2fs -j /dev/backups/backups

Edit fstab to add the mounting of this drive by inserting this line

/dev/backups/backups /backups ext3 usrquota,grpquota 1 1

and create the mount point – in my case – /backups

#mkdir /backups

Then one final restart of the server to see that it all starts ok and its done.