Thursday, April 16, 2015

Install Bash-Shell in favour of Ash-Shell on your Synology

Objective


I wanted to use the bash-shell on my Synology DS209+II. There are no official packages from Synology provided, but I knew there is a way to install custom and optional packages via ipkg.

Motivation


As my Synology is mostly running 24/7, I wanted establish a custom download-script which is started and stopped as a cron-job at certain periods of time. The script itself uses some commands relying on a bash-shell, but the Synology default command shell is just the less powerful ash-shell.


Prerequisites



Solution


Open a ssh-connection to your Synology


Log into your Synology as root using ssh (e.g "ssh -l root DiskStation").

Install the Bash-Shell-Package:

DiskStation$> ipkg install -A bash

You should see something like this:

DiskStation> ipkg install bash
Installing bash (3.2.54-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/bash_3.2.54-1_powerpc.ipk
Installing readline (6.1-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/readline_6.1-2_powerpc.ipk
Installing ncurses (5.7-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/ncurses_5.7-3_powerpc.ipk
Configuring bash
Configuring ncurses
update-alternatives: Linking //opt/bin/clear to /opt/bin/ncurses-clear
Configuring readline
Successfully terminated.

Now, Bash-Shell is installed, but when you log into your Synology it's not yet automatically started. You are still with Ash-Shell.

Activate automatic log-in with Bash


You could exchange the shell type for log-in in your /etc/passwd on your Synology, by exchanging the line (here it's done for user: root):

root:x:0:0:root:/root:/bin/ash

by

root:x:0:0:root:/root:/bin/bash

Unfortunatelly doing so, has the disadvantage, that you might loose the ability to log into your Synology at all from remote after an upgrade of your Firmware. Because optional packages like Bash are installed into /opt may be inavailable after a system-update. To prevent this accidental lock-out, it's preferred to continue to log-in with Ash-Shell, but start Bash automatically at once after you're successfully logged in.

To achive this you have to create/edit the file .profile in the homeaccount of the user the should be able to log-in on your Synology. Go to your homeaccount (e.g. /root/ for the user: root) and type the following as the proper user on you Synology:

DiskStation$> vi .profile

If the file has content, just add this lines to it:

# ...

if [[ -x /opt/bin/bash ]]; then
    exec /opt/bin/bash
fi

That's it. Next time, when root logs into your Synology, he is on a Bash-Shell.

Refine Configuration


If you want to use a different command prompt or to have some alias-commands, or at least the proper shell name in your "SHELL" environment variable, it's advisable also to create a .bashrc in the homeaccount, with the following example content (feel free to alter it to your convenience):

DiskStation$> vi .bashrc

PS1='\u@\h:\w \$ '
export SHELL=/opt/bin/bash

The first line gives you a nice bash prompt. The second explicitly sets the "SHELL" variable to your correct shell.

If you want also other scripts automatically using Bash instead of Ash, additionally create a symbolic link to it in /bin/:

DiskStation$> ln -s /opt/bin/bash /bin/bash

ADVICE: Keep a separate root shell window open until you have confirmed all of the changes work.

Sunday, April 12, 2015

Prepare your Synology NAS to install custom packages via ipkg

Objective


I wanted to use the bash-shell and a newer wget on my Synology DS209+II. There are no official packages from Synology provided, but I knew there is a way to install custom and optional packages via ipkg. Unfortunatelly ipkg must be so called bootstrapped, because it is already a custom package itself.

Motivation


As my Synology is mostly running 24/7, I wanted establish a custom download-script which is started and stopped as a cron-job at certain periods of time. The script itself uses some commands relying on a bash-shell, but the Synology default command shell is just the less powerful ash-shell. Also some of the wget-options I use in that script seem to be broken in the version of wget that my Synology has installed.

Prerequisites


  • DS209+II
  • Proper bootstrap script for your Synology NAS

Solution


Download the proper boostrap script


First you have to find out which processor is used on your specific Synology NAS.

Log into your Synology as root using ssh (e.g "ssh -l root DiskStation") and type the following command:

DiskStation$> cat /proc/cpuinfo

Doing so on my DS209+II printed the following information:

processor : 0
cpu : e500v2
clock : 1066.560000MHz
revision : 2.2 (pvr 8021 0022)
bogomips : 133.32
timebase : 66660000
platform : MPC8544 DS
model : MPC8544DS
Vendor : Freescale Semiconductor
PVR : 0x80210022
SVR : 0x80340011
PLL setting : 0x4
Memory : 512 MB
Memory : 512 MB

Now I know I have a Freescale PowerPC (e500v*), I can download the proper boostrap script here:

You can find a list of all bootstrap scripts here (column: "Optware-Pfad/IPKG"):
Processors used in Synology NAS Systems (German)

Now download the proper script and copy it to your Synology.

On the (still open) ssh connection "cd" into the folder where you stored the script and type (script name for your Synology type may differ!):

DiskStation$> sh syno-e500-bootstrap_1.2-7_powerpc.xsh

After you hit enter and you see something like this:

Optware Bootstrap for syno-e500.
Extracting archive... please wait
bootstrap/
bootstrap/bootstrap.sh
bootstrap/ipkg-opt.ipk
bootstrap/ipkg.sh
bootstrap/optware-bootstrap.ipk
bootstrap/wget.ipk
1330+1 records in
1330+1 records out

you already have installed an older version of ipkg.

Now you first have to remove this version, before installing the new one.

Backup your old ipkg configuration (only if you already have ipkg on your system)


If you have already installed ipkg and other custom packages via ipkg then make a backup of the following folders on you Synology:

  • /volume1/@optware
  • /usr/lib/ipkg

then remove all existing optware packages:

DiskStation$> rm -rf /volume1/@optware && rm -rf /usr/lib/ipkg

Afterwards, you must *reboot your Synology* and then restart the bootstrap script.

Re-Install ipkg


Again, log-into your Synology via ssh as root and type:

DiskStation$> sh syno-e500-bootstrap_1.2-7_powerpc.xsh

Now you should see a full install log:

Optware Bootstrap for syno-e500.
Extracting archive... please wait
bootstrap/
bootstrap/bootstrap.sh
bootstrap/ipkg-opt.ipk
bootstrap/ipkg.sh
bootstrap/optware-bootstrap.ipk
bootstrap/wget.ipk
1330+1 records in
1330+1 records out
Creating temporary ipkg repository...
Installing optware-bootstrap package...
Unpacking optware-bootstrap.ipk...Done.
Configuring optware-bootstrap.ipk...Setting up ipkg arch-file
Done.
Installing ipkg...
Unpacking ipkg-opt.ipk...Done.
Configuring ipkg-opt.ipk...WARNING: can't open config file: /usr/syno/ssl/openssl.cnf
Done.
Removing temporary ipkg repository...
Installing wget...
Installing wget (1.12-2) to root...
Configuring wget
Successfully terminated.
Creating /opt/etc/ipkg/cross-feed.conf...
Setup complete.

Update your $PATH variable, so that the ipkg can be found after reboot.
Therefore open the file $HOME/.profile and edit the line with your PATH:

PATH=/opt/bin:/opt/sbin:[the content that was already there]

Finally it's recommended to update your ipkg-package to ensure to use the newest version:

DiskStation$> ipkg update

Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.

If you use "ipkg upgrade" instead of "ipkg update", also all already installed custom packages are upgraded, too.

Boostrap done. Now you can install optional packages via the ipkg command on your Synology.

References:

  1. https://www.naschenweng.info/2012/01/17/synology-dsm-4-0-beta-breaks-ipkg/

Saturday, March 7, 2015

Linux Mint: Install new kernel version and update Virtual Box kernel module

Objective


I want to install the latest Linux Kernel available for my system. I also want still to work with my already installed VirtualBox which needs to install a kernel module after a kernel switch.

Motivation


There was no real resaon behind my plans to install the Linux Kernel 3.17.1. I just thought it's time for an upgrade. My current kernel is 3.13.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • Oracle VM VirtualBox Manager 4.3.24

Solution


Install the Linux Kernel packages


To check which kernel packages are currently available you can do a search like (filtered by version "3.17"):

$> apt-cache search linux- | grep 3.17

you'll see some output like this:

linux-headers-3.17.1-031701 - Header files related to Linux kernel version 3.17.1
linux-headers-3.17.1-031701-generic - Linux kernel headers for version 3.17.1 on 64 bit x86 SMP
linux-image-3.17.1-031701-generic - Linux kernel image for version 3.17.1 on 64 bit x86 SMP

For 64-Bit systems download the following packages ...

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701_3.17.1-031701.201410150735_all.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701-generic_3.17.1-031701.201410150735_amd64.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-image-3.17.1-031701-generic_3.17.1-031701.201410150735_amd64.deb

and for 32-Bit systems download the following ...

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701_3.17.1-031701.201410150735_all.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-headers-3.17.1-031701-generic_3.17.1-031701.201410150735_i386.deb

$> wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.1-utopic/linux-image-3.17.1-031701-generic_3.17.1-031701.201410150735_i386.deb

Now install the packages:

$> sudo dpkg -i linux-headers-3.17.1*.deb linux-image-3.17.1*.deb

Reboot the system.

$> sudo reboot

After a successful reboot, you can delete the *.deb packages again:

$> rm linux-*


Uninstall the Linux Kernel again (if you don't like it anymore)


You can uninstall the new kernel with the following command, be aware that this may make your system unusable.

$> sudo apt-get remove 'linux-headers-3.17.1*' 'linux-image-3.17.1*'

Setup the VirtualBox Kernel module


$> sudo /etc/init.d/vboxdrv setup

You'll see output similar to:

Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.

Now you are done!

Linux Mint: Install and configure OpenSSH

Objective


It should be possible to log-into my new desktop computer from my laptop via ssh.

Motivation


Sometimes I want to run a script or program on my more powerful desktop computer, also while I am just sitting in front of my laptop. Furthermore I want to be able to configure my desktop computer from remote. To achive this I need to install and configure openssh inclusive X11 forwarding.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • A second computer or laptop with a ssh-client e.g. putty installed

Solution


Install the OpenSSH packages


Open a terminal. Download and install the openssh server and client package:

$> sudo apt-get install openssh-server openssh-client

you'll see some output like this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-client is already the newest version.
Suggested packages:
rssh molly-guard monkeysphere
Recommended packages:
ncurses-term ssh-import-id
The following NEW packages will be installed:
openssh-server openssh-sftp-server
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 354 kB of archives.
After this operation, 1.072 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-sftp-server amd64 1:6.6p1-2ubuntu2 [34,1 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-server amd64 1:6.6p1-2ubuntu2 [319 kB]
Fetched 354 kB in 0s (781 kB/s)
Preconfiguring packages ...
Selecting previously unselected package openssh-sftp-server.
(Reading database ... 159066 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a6.6p1-2ubuntu2_amd64.deb ...
Unpacking openssh-sftp-server (1:6.6p1-2ubuntu2) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a6.6p1-2ubuntu2_amd64.deb ...
Unpacking openssh-server (1:6.6p1-2ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up openssh-sftp-server (1:6.6p1-2ubuntu2) ...
Setting up openssh-server (1:6.6p1-2ubuntu2) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
ssh start/running, process 3190
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...

Configure OpenSSH


The default configuration for OpenSSh on Linux Mint Rebecca located at /etc/ssh/sshd_config should already work fine without any further adjustment. The only limitation is that yout cannot log in as root by default.

If you want to allow remote login as root, open a shell and edit /etc/ssh/sshd_config:
$> gksu gedit /etc/ssh/sshd_config

Now change the following line to:

PermitRootLogin yes

Now you are done and can do a test log-in.

Saturday, February 28, 2015

Linux Mint: Setup autofs to mount automatically NFS-shares from a Synology

Objective


I installed Linux Mint 17.1 Rebecca on a new computer and I want to access the NFS shares from my Synology Disk Station.

Motivation


As my Synology is not always running 24/7 it would be nice just to mount the NFS shares on my client computers on access and to avoid to integrate the shares statically in fstab. Integrating the shares in fstab would work, but I will always have to wait until a timeout is fullfilled while booting my computer, when the Synology is not running. I already set-up autofs for this "mount on demand" purpose on my laptop, which eves not always in the same network as my Synology.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • DS209+II

Solution


Install the autofs package


Download and install the autofs package via the following command from a shell:

$> sudo apt-get install autofs

you'll see some output like this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
nfs-common
The following NEW packages will be installed:
autofs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 281 kB of archives.
After this operation, 1.671 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main autofs amd64 5.0.7-3ubuntu3.1 [281 kB]
Fetched 281 kB in 0s (496 kB/s)
Selecting previously unselected package autofs.
(Reading database ... 158913 files and directories currently installed.)
Preparing to unpack .../autofs_5.0.7-3ubuntu3.1_amd64.deb ...
Unpacking autofs (5.0.7-3ubuntu3.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up autofs (5.0.7-3ubuntu3.1) ...
Creating config file /etc/auto.master with new version
Creating config file /etc/auto.net with new version
Creating config file /etc/auto.misc with new version
Creating config file /etc/auto.smb with new version
Creating config file /etc/default/autofs with new version
autofs start/running, process 3481
Processing triggers for ureadahead (0.100.0-16) ...

Additionally install the nfs-common package, otherwise you won't be able to access the NFS shares.

$> sudo apt-get install nfs-common

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgssglue1 libnfsidmap2 libtirpc1 rpcbind
Suggested packages:
open-iscsi watchdog
The following NEW packages will be installed:
libgssglue1 libnfsidmap2 libtirpc1 nfs-common rpcbind
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 342 kB of archives.
After this operation, 1.375 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libgssglue1 amd64 0.4-2ubuntu1 [19,7 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libnfsidmap2 amd64 0.25-5 [32,2 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libtirpc1 amd64 0.2.2-5ubuntu2 [71,3 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main rpcbind amd64 0.2.1-2ubuntu2.1 [37,0 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main nfs-common amd64 1:1.2.8-6ubuntu1.1 [182 kB]
Fetched 342 kB in 1s (288 kB/s)
Selecting previously unselected package libgssglue1:amd64.
(Reading database ... 158963 files and directories currently installed.)
Preparing to unpack .../libgssglue1_0.4-2ubuntu1_amd64.deb ...
Unpacking libgssglue1:amd64 (0.4-2ubuntu1) ...
Selecting previously unselected package libnfsidmap2:amd64.
Preparing to unpack .../libnfsidmap2_0.25-5_amd64.deb ...
Unpacking libnfsidmap2:amd64 (0.25-5) ...
Selecting previously unselected package libtirpc1:amd64.
Preparing to unpack .../libtirpc1_0.2.2-5ubuntu2_amd64.deb ...
Unpacking libtirpc1:amd64 (0.2.2-5ubuntu2) ...
Selecting previously unselected package rpcbind.
Preparing to unpack .../rpcbind_0.2.1-2ubuntu2.1_amd64.deb ...
Unpacking rpcbind (0.2.1-2ubuntu2.1) ...
Selecting previously unselected package nfs-common.
Preparing to unpack .../nfs-common_1%3a1.2.8-6ubuntu1.1_amd64.deb ...
Unpacking nfs-common (1:1.2.8-6ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libgssglue1:amd64 (0.4-2ubuntu1) ...
Setting up libnfsidmap2:amd64 (0.25-5) ...
Setting up libtirpc1:amd64 (0.2.2-5ubuntu2) ...
Setting up rpcbind (0.2.1-2ubuntu2.1) ...
Removing any system startup links for /etc/init.d/rpcbind ...
rpcbind start/running, process 5972
Processing triggers for ureadahead (0.100.0-16) ...
Setting up nfs-common (1:1.2.8-6ubuntu1.1) ...
Creating config file /etc/idmapd.conf with new version
Creating config file /etc/default/nfs-common with new version
Adding system user `statd' (UID 115) ...
Adding new user `statd' (UID 115) with group `nogroup' ...
Not creating home directory `/var/lib/nfs'.
statd start/running, process 6205
gssd stop/pre-start, process 6239
idmapd start/running, process 6286
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...

Configure autofs


First create the destination directory where you want to mount the directories of your NFS server into. In my case this is below /mnt/DiskStation


$> sudo mkdir -p /mnt/DiskStation

Now add your exported NFS-Shares root-directory from your server to the "/etc/auto.master":

/mnt/DiskStation /etc/auto.nfs

$> gksu gedit /etc/auto.master

#
# Sample auto.master file
#
# ...
#
#/misc /etc/auto.misc
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# ...
#
+auto.master
/mnt/DiskStation /etc/auto.nfs

Create a "/etc/auto.nfs" with the following content (where "192.168.0.99" is the IP of your Synology and "data" is the name of the exported directory):
data 192.168.0.99:/volume1/data

Finally restart autofs

$> sudo service autofs restart

autofs stop/waiting
autofs start/running, process 4084

Done. Now you should be able to access the files from your Synology at /mnt/DiskStation/data.


More information on autofs can be found here.

Linux Mint: Move your home-directory into a separate partition after installation

Objective


I installed Linux Mint 17.1 Rebecca on new computer with a SSD with the Mint Installer default partitioning scheme, which mounts /boot, /root and /home into the same partition.

Motivation


I decided to have my home-directory in a separate partition which I can mount into /home to make leter upgrading the system a little more painless.

Prerequisites


  • Linux Mint 17.1 Rebecca
  • 512 GB SSD

Solution


Create a new partition


Resize your system partition and create a new partition in the free space. Follow this guide to see how you can resize Ubuntu partitions to complete this step.

Copy the home files into the new partition


Open a terminal and run the following command to create a copy of your current /home directory on the new partition, where /media/HOME is the location of your newly mounted partition (I gave it the LABEL=HOME during the creation process) where the new /home should reside:

$> sudo cp -Rp /home/* /media/HOME

You should check if everything went fine to avoid to loose data:

$> ls /media/HOME

In my case I got:

csch data lost+found

Determine the UUID of the newly created partition


Use the following command to get the UUID of your new home-partition:

$> sudo blkid

In my case I got (you can see the label HOME again here)

...
/dev/sda2: UUID="f270b74b-ce14-4481-bf32-1226b4fd776e" TYPE="ext4"
/dev/sda3: LABEL="HOME" UUID="a9c81163-f588-462a-89b0-dbdad87cef9c" TYPE="ext4"
/dev/sda6: UUID="023cf9e6-199f-475c-9fe1-c70b73d3047c" TYPE="swap"
...

Adapt your mount table in fstab to mount the new partition into "/home"


Make a backup of your current fstab (with a timestamp):

$> sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)_backup

and edit the original fstab:

$>gksu gedit /etc/fstab

Add this line to your fstab and save the file (replace xxxxx with your UUID):

...
# (identifier) (location) (format, eg ext3 or ext4) (some settings)
UUID=xxxxx /home ext4 nodev,nosuid 0 2

Move home-directory into a backup and create a new mount-directory


$> cd / && sudo mv /home /old_home && sudo mkdir /home

Now you're done, finally reboot and prey!

$> sudo shutdown -r now

After your system is up again, you can savely clean-up the system:

$> sudo rm -rf /home_old

Remark

Additional info on how to deal with separate home-partitions can be found here.

Saturday, December 20, 2014

Linux Mint: Install Xbian on Raspberry Pi

Objective


The following decription explains how to install a Xbian image on a SDCard to run on your Raspberry Pi. The installation is done on Linux.

Motivation


Recently, I bought a Raspberry Pi and wanted to connect to my TV to watch movies stored on my NAS via Wifi connection or Youtube videos.

Prerequisites


  • Linux Mint 17 Qiana
  • Raspberry Pi B model (both 512 MB and 256 MB version are supported)
  • 2 GB (or bigger) SD card
  • Power adapter for your Raspbery Pi
  • Something to play your media from (USB disk or network share)
  • Remote, for example your TV remote (if your TV supports CEC), smartphone (XBMC Remote app), infrared remote, keyboard/mouse
  • Computer with a SD card reader for installing XBian on your SD card
  • Ethernet cable or WiFi dongle for your Raspberry Pi

Solution


Preparation of the Xbian image file


Go to the XBian images download section and select the newest XBian image for your download. In my case this was the XBian 1.0 Release Candidate 3.

Open a command shell and go (via 'cd' command) to the folder where you downloaded the image file.

Uncompress the image by the command:

$> gunzip XBian_1.0_RC_3_Raspberry_Pi.img.gz

Preparation of the SDCard


Insert your SDCard into the SDCard slot of your computer. The card usually will be automatically mounted and integrated into the filesystem of your computer. If this is not the case, you can also mout ist via the shell command:

$> sudo mount -t vfat -o ro /dev/mmcblk0p1 /media/mmcblk0p1

The mmcblk0p1 here is the device identifier for your SDCard and may vary in your case. To determine the device identifier, you can use the command:

$> sudo fdisk -l

you will get a result similar to mine:

Disk /dev/sda: 640.1 GB, 640135028736 bytes

<skip the info of the harddisk>

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 Köpfe, 16 Sektoren/Spur, 486192 Zylinder, zusammen 31116288 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x0009be7b

Gerät boot. Anfang Ende Blöcke Id System
/dev/mmcblk0p1 2048 31116287 15557120 b W95 FAT32

Copy the downloaded image onto the SDCard:

$> sudo dd if=XBian_1.0_RC_3_Raspberry_Pi.img of=/dev/mmcblk0

The copying procedure takes some minutes, so be patient...

The final output after a successful copy will be something like:

1135488+0 Datensätze ein
1135488+0 Datensätze aus
581369856 Bytes (581 MB) kopiert, 366,661 s, 1,6 MB/s

Setup done!
Now you can remove the SDCard from your computer an put it into your Raspberry Pi and restart the Pi.