Author Archive

Removed /dev/null

Today I removed my /dev/null ;)

If you need to recreade /dev/null just use the following comand.
mknod /dev/null c 1 3 && chmod 666 /dev/null

Software RAID5 with mdadm

Short toturial on how to set up raid5 using mdadm bigger than 2TB

Creating:
mdadm --create /dev/md5 --chunk=64 --level=raid5 --raid-devices=4 /dev/sdg1 /dev/sdh1 /dev/sdd1 /dev/sdc1 --force

Checking the status on how the raid is build
cat /proc/mdstat

md5 : active raid5 sdg1[0] sdc1[3] sdd1[2] sdh1[1]
      5860535808 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

unused devices: 

For more details:

mdadm --detail /dev/md5

/dev/md5:
        Version : 00.90
  Creation Time : Sun Feb 14 11:46:13 2010
     Raid Level : raid5
     Array Size : 5860535808 (5589.04 GiB 6001.19 GB)
  Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 5
    Persistence : Superblock is persistent

    Update Time : Mon Feb 15 11:58:41 2010
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 80766149:664cd4ae:b069a74e:50fc3f3c (local to host server.nsas.lan)
         Events : 0.19

    Number   Major   Minor   RaidDevice State
       0       8       97        0      active sync   /dev/sdg1
       1       8      113        1      active sync   /dev/sdh1
       2       8       49        2      active sync   /dev/sdd1
       3       8       33        3      active sync   /dev/sdc1

After everything is build (took some time) you have to create a partion. Since fdisk cant handel more then 2TB, you have to use parted.
parted /dev/md5

Create a GPT label.
mklable gpt

Create a Partion. Using the max possible space
mkpart primary 0 -0

Exit
exit

Now format the new partion as you like.
mkfs.xfs -L RAID /dev/md5p1

Set you config straight
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Mount it.
mount LABEL=RAID /mnt

How to build from PVR-XBMC from source

Here is a small howto, that will lead you through building PVR-XBMC from subversion.

Checking out PVR-XBMC via svn.
svn co "http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/pvr-testing2"

Then goto where ever you checked the pvr-testing2 out
cd pvr-testing2
./bootstrap && \\
./configure --prefix=$HOME/testing/$(svn info | grep -i revision | cut -d" " -f2) && \\
make -j2 && \\
make install

Here is a little function I wrote to update the PVR when ever I need. (in my case it’s in ~/.zshrc)

function update_xbmc () {
CURRENTPATH=$(pwd)
mkdir -p ~/testing
cd ~/src/XBMC
echo -n "Checking for changes in SVN "
svn update
REVISION=$(svn info | grep -i revision | cut -d" " -f2)
if [ -d $HOME/testing/$REVISION ] >/dev/null
    then
           echo noting to update
    else
           echo building $REVISION export CFLAGS="-O0 -g"
           ./configure --prefix=$HOME/testing/$REVISION && \\
           make -j2 && \\
           make install
           if [ $? -eq 0 ]
               then
                     echo linking
                     cd $HOME/bin
                     ln -sf ../testing/$REVISION/bin/xbmc xbmc-$REVISION
                     ln -sf xbmc-$REVISION xbmc-latest
                     echo -e "XBMC Revision $REVISION has been build. $HOME/testing/$REVISION t enjoy"
           fi
fi
cd $CURRENTPATH }

Copying files via SSH

Copy with permissions to $USER’s home directory on $HOST
scp -p -r $USER@$HOST: file dir/

Return top